Test scenarios
The numbers, cards and accounts that force each outcome.
In sandbox the outcome is not random, it is addressed. You pick it by choosing the phone number, the card, the bank account or the wallet you pay with. Everything on this page comes from the sandbox's list of test numbers, cards and accounts.
Mobile money
A test number is an operator prefix followed by a six digit suffix that names the outcome.
number = operator_prefix + outcome_suffix
+23767 + 000002 = +237670000002
MTN Cameroon failure a payment that always failsThe six suffixes
| Suffix | Outcome | What your integration sees |
|---|---|---|
000000 | Success | payment.succeeded after about 3 seconds |
000001 | Insufficient funds | A 402 on the charge itself, with error_code: insufficient_funds, as a live decline. The payment stays pending and payment.attempt_failed is sent |
000002 | Failure | payment.failed, refused by the operator |
000003 | Timeout | payment.expired, and the payment ends expired |
000004 | Cancelled | payment.cancelled, and the payment ends cancelled |
000009 | Success, then a refund that fails | payment.succeeded, then refund.failed |
Leading zeros are tolerated
The subscriber part may carry extra leading zeros before the suffix, so +2376700000000 matches
000000 too. Anything else between the prefix and the suffix does not match, and the charge
answers a 422 on data.phone that lists the numbers to use, with the prefix of the channel's
operator: Invalid sandbox test number. Use a test number of the channel's operator, e.g. +237670000000 (success), +237670000001 (insufficient funds), ….
Prefixes
Twenty-six countries, sixty-seven operators: every Mobile Money channel the catalogue announces. A wallet held whatever the payer's operator, such as Capitec Pay, also takes the test number of any other operator, and its suffix still sets the outcome; a number that is no test number is refused.
| Country | Operator | Prefix |
|---|---|---|
+23767 | ||
+23769 | ||
+23768 | ||
+23766 | ||
+22505 | ||
+22507 | ||
+22501 | ||
+22503 | ||
| Green | +22509 | |
+2348 | ||
+2347 | ||
+22177 | ||
| Free | +22176 | |
+22178 | ||
+23324 | ||
| Vodafone | +23320 | |
+23326 | ||
| AirtelTigo | +23327 | |
+25470 | ||
+25471 | ||
+25473 | ||
| Equitel | +25476 | |
| T-Kash | +25477 | |
+25478 | ||
+25567 | ||
| Tigo | +25565 | |
| Vodafone | +25574 | |
| HaloPesa | +25562 | |
+25576 | ||
+25677 | ||
+25675 | ||
+25078 | ||
+25073 | ||
+24399 | ||
+24389 | ||
| Vodacom | +24381 | |
+24382 | ||
| Africell | +24390 | |
+22990 | ||
+22991 | ||
| Glo | +22997 | |
+22670 | ||
+22671 | ||
+2410 | ||
+2411 | ||
+2416 | ||
+24205 | ||
+24206 | ||
+24204 | ||
+23566 | ||
+23670 | ||
+26096 | ||
+26097 | ||
| Zamtel | +26095 | |
+26599 | ||
| TNM | +26588 | |
+22370 | ||
+22366 | ||
+22899 | ||
| T-Money | +22890 | |
+22466 | ||
+22462 | ||
+23188 | ||
+25884 | ||
| Vodafone Cash | +2010 | |
+23276 | ||
| Capitec Pay | +2761 |
Worked examples
| Scenario | MTN Cameroon | Orange Ivory Coast | M-Pesa Kenya |
|---|---|---|---|
| Success | +237670000000 | +225070000000 | +254700000000 |
| Insufficient funds | +237670000001 | +225070000001 | +254700000001 |
| Failure | +237670000002 | +225070000002 | +254700000002 |
| Timeout | +237670000003 | +225070000003 | +254700000003 |
| Cancelled | +237670000004 | +225070000004 | +254700000004 |
Cards
The card number alone decides the outcome. The other fields must still be well formed, or the
charge is refused with a 422 on the field: a holder name, an expiry as MM/YY or MM/YYYY with a
year from this one to thirty years ahead, and a CVV of three or four digits. The
Direct API page shows the four fields of a sandbox card charge.
Succeeds without 3D Secure
| Card | Network | Outcome |
|---|---|---|
4242 4242 4242 4242 | Visa | Succeeds |
5555 5555 5555 4444 | Mastercard | Succeeds |
4000 0000 0000 5423 | Visa | Succeeds, and every refund on it fails |
Requires 3D Secure
The hosted checkout asks for a code sent by email, as described in
Sandbox mode. These
return 202 first, and the final status arrives once the challenge is resolved.
| Card | Outcome of the challenge |
|---|---|
4000 0566 5566 5556 | Passes, payment succeeds |
4000 0025 0000 3155 | Passes, payment succeeds |
4000 0027 6000 3184 | Passes, payment succeeds |
4000 0025 0000 3063 | Authentication fails |
4000 0025 0000 3089 | Authentication fails |
4000 0025 0000 3018 | Authenticates, then the issuer declines |
4000 0025 0000 3026 | Authenticates, then the issuer declines |
4000 0025 0000 3034 | The payer abandons the challenge |
4000 0025 0000 3042 | The payer abandons the challenge |
4000 0025 0000 3050 | The challenge times out |
4000 0025 0000 3097 | The challenge times out |
Fails without 3D Secure
| Card | Outcome |
|---|---|
4000 0000 0000 9995 | Insufficient funds |
4000 0000 0000 0002 | Declined |
4000 0000 0000 9987 | Declined |
4000 0000 0000 9979 | Declined |
4000 0000 0000 0069 | Declined |
4000 0000 0000 0127 | Declined |
4000 0000 0000 0119 | Declined |
4000 0000 0000 0341 | Declined |
4000 0000 0000 6975 | Declined |
4242 4242 4242 4241 | Declined |
One decline, not ten reasons
Only …9995 carries a distinct reason. The other nine produce the same generic decline, so use
whichever you like when testing a failure path. A card that is not on this page is refused for
not being a test card.
Bank accounts
Any account number or IBAN of at least four characters is accepted. The last two digits choose the outcome.
| Ends with | Outcome |
|---|---|
00 | Success |
01 | Insufficient funds |
02 | Failure |
03 | Timeout |
04 | Cancelled |
Anything else succeeds, so an account ending in 47 simply works.
Crypto
Crypto is switched on or off for the whole sandbox platform, not per account: when it is off, the
channel is not offered at all. When it is on, a crypto charge answers with crypto.deposit, and
its scenarios object holds one deposit address per outcome: success, insufficient_funds,
failure, timeout and canceled.
- Leave
wallet_addressout of the charge and the payment succeeds. - Send one of the
scenariosaddresses aswallet_addressand you get that outcome. - Any other address is refused with a
422ondata.wallet_address.
Each address is derived from the payment, the channel and the scenario (address_derivation gives
the recipe), so the same test twice gives the same address. It expires after 30 minutes.
The address suffixes _success, _insufficient, _failure, _timeout and _canceled choose the
outcome of a payout to a crypto beneficiary, not of a payment.
Refunds
A refund's outcome comes from the original payment, not from the refund call.
| The payment was made with | The refund |
|---|---|
4000 0000 0000 5423 | Always fails |
A number ending 000009 | Always fails |
A number ending 000000 | Succeeds |
| Any other card, a bank account, a crypto wallet | Succeeds |
The numbers ending 000001 to 000004 have no row because their payments never succeed, so there
is nothing to refund: POST /refunds answers 422 with Transaction must be completed to be refunded. To test a failed refund, pay with …000009 or the card 4000 0000 0000 5423.
Transfers
A payout uses the beneficiary's details, and the same suffixes apply. A mobile money beneficiary must carry a recognised test number. A bank test account picks its outcome with its last two digits, a crypto test address with its suffix, the same way.
| Suffix | The transfer | failure_reason |
|---|---|---|
000000 | succeeded | |
000001 | Refused at once: 422 with error_code: insufficient_funds, nothing created | |
000002 | failed | failure |
000003 | failed | network_error |
000004 | failed | invalid_recipient |
A transfer debits your sandbox balance, so run a successful payment first, or the payout fails for lack of funds exactly as it would in live.