Skip to content

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.

The formula
number = operator_prefix + outcome_suffix

+23767      +  000002   =  +237670000002
MTN Cameroon   failure      a payment that always fails

The six suffixes

SuffixOutcomeWhat your integration sees
000000Successpayment.succeeded after about 3 seconds
000001Insufficient fundsA 402 on the charge itself, with error_code: insufficient_funds, as a live decline. The payment stays pending and payment.attempt_failed is sent
000002Failurepayment.failed, refused by the operator
000003Timeoutpayment.expired, and the payment ends expired
000004Cancelledpayment.cancelled, and the payment ends cancelled
000009Success, then a refund that failspayment.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.

CountryOperatorPrefix
CameroonCameroonMTN MoMoMTN MoMo+23767
CameroonCameroonOrange MoneyOrange Money+23769
CameroonCameroonExpress UnionExpress Union+23768
CameroonCameroonYoomeeYoomee+23766
Ivory CoastIvory CoastMTN MoMoMTN MoMo+22505
Ivory CoastIvory CoastOrange MoneyOrange Money+22507
Ivory CoastIvory CoastMoovMoov+22501
Ivory CoastIvory CoastWaveWave+22503
Ivory CoastIvory CoastGreen+22509
NigeriaNigeriaMTNMTN+2348
NigeriaNigeriaOrangeOrange+2347
SenegalSenegalOrange MoneyOrange Money+22177
SenegalSenegalFree+22176
SenegalSenegalWaveWave+22178
GhanaGhanaMTN MoMoMTN MoMo+23324
GhanaGhanaVodafone+23320
GhanaGhanaAirtelAirtel+23326
GhanaGhanaAirtelTigo+23327
KenyaKenyaM-PesaM-Pesa+25470
KenyaKenyaM-Pesa TillM-Pesa Till+25471
KenyaKenyaAirtel TillAirtel Till+25473
KenyaKenyaEquitel+25476
KenyaKenyaT-Kash+25477
KenyaKenyaAirtelAirtel+25478
TanzaniaTanzaniaAirtelAirtel+25567
TanzaniaTanzaniaTigo+25565
TanzaniaTanzaniaVodafone+25574
TanzaniaTanzaniaHaloPesa+25562
TanzaniaTanzaniaM-PesaM-Pesa+25576
UgandaUgandaMTNMTN+25677
UgandaUgandaAirtelAirtel+25675
RwandaRwandaMTNMTN+25078
RwandaRwandaAirtelAirtel+25073
DRCDRCAirtelAirtel+24399
DRCDRCOrangeOrange+24389
DRCDRCVodacom+24381
DRCDRCExpress UnionExpress Union+24382
DRCDRCAfricell+24390
BeninBeninMTNMTN+22990
BeninBeninMoovMoov+22991
BeninBeninGlo+22997
Burkina FasoBurkina FasoOrangeOrange+22670
Burkina FasoBurkina FasoMoovMoov+22671
GabonGabonAirtelAirtel+2410
GabonGabonExpress UnionExpress Union+2411
GabonGabonMoovMoov+2416
CongoCongoExpress UnionExpress Union+24205
CongoCongoMTNMTN+24206
CongoCongoAirtelAirtel+24204
ChadChadExpress UnionExpress Union+23566
Central African RepublicCentral African RepublicExpress UnionExpress Union+23670
ZambiaZambiaMTNMTN+26096
ZambiaZambiaAirtelAirtel+26097
ZambiaZambiaZamtel+26095
MalawiMalawiAirtelAirtel+26599
MalawiMalawiTNM+26588
MaliMaliOrangeOrange+22370
MaliMaliMoovMoov+22366
TogoTogoMoovMoov+22899
TogoTogoT-Money+22890
GuineaGuineaMTNMTN+22466
GuineaGuineaOrangeOrange+22462
LiberiaLiberiaMTNMTN+23188
MozambiqueMozambiqueM-PesaM-Pesa+25884
EgyptEgyptVodafone Cash+2010
Sierra LeoneSierra LeoneOrangeOrange+23276
South AfricaSouth AfricaCapitec Pay+2761

Worked examples

ScenarioMTN CameroonOrange Ivory CoastM-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

CardNetworkOutcome
4242 4242 4242 4242VisaSucceeds
5555 5555 5555 4444MastercardSucceeds
4000 0000 0000 5423VisaSucceeds, 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.

CardOutcome of the challenge
4000 0566 5566 5556Passes, payment succeeds
4000 0025 0000 3155Passes, payment succeeds
4000 0027 6000 3184Passes, payment succeeds
4000 0025 0000 3063Authentication fails
4000 0025 0000 3089Authentication fails
4000 0025 0000 3018Authenticates, then the issuer declines
4000 0025 0000 3026Authenticates, then the issuer declines
4000 0025 0000 3034The payer abandons the challenge
4000 0025 0000 3042The payer abandons the challenge
4000 0025 0000 3050The challenge times out
4000 0025 0000 3097The challenge times out

Fails without 3D Secure

CardOutcome
4000 0000 0000 9995Insufficient funds
4000 0000 0000 0002Declined
4000 0000 0000 9987Declined
4000 0000 0000 9979Declined
4000 0000 0000 0069Declined
4000 0000 0000 0127Declined
4000 0000 0000 0119Declined
4000 0000 0000 0341Declined
4000 0000 0000 6975Declined
4242 4242 4242 4241Declined

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 withOutcome
00Success
01Insufficient funds
02Failure
03Timeout
04Cancelled

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_address out of the charge and the payment succeeds.
  • Send one of the scenarios addresses as wallet_address and you get that outcome.
  • Any other address is refused with a 422 on data.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 withThe refund
4000 0000 0000 5423Always fails
A number ending 000009Always fails
A number ending 000000Succeeds
Any other card, a bank account, a crypto walletSucceeds

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.

SuffixThe transferfailure_reason
000000succeeded
000001Refused at once: 422 with error_code: insufficient_funds, nothing created
000002failedfailure
000003failednetwork_error
000004failedinvalid_recipient
The 422 when it does not
{
"code": 422,
"status": "Unprocessable Content",
"error_code": "invalid_test_number",
"message": "Invalid sandbox test number. Use a recognised Mobile Money test number, e.g. +237670000000 (success), +237670000001 (insufficient funds), +237670000002 (failure), +237670000003 (timeout), +237670000004 (canceled).",
"errors": {
"beneficiary": [
"Invalid sandbox test number. Use a recognised Mobile Money test number, e.g. +237670000000 (success), +237670000001 (insufficient funds), +237670000002 (failure), +237670000003 (timeout), +237670000004 (canceled)."
]
}
}

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.

What did you think of this content?