Get started

Testing

Test keys, and amounts and numbers that fail on purpose.

A sk_test_ key reaches the same API, with the same validation, and moves no money. Its outcomes are decided by the amount, or for a payout the destination, that you send.

Key requirements

  • A test key, beginning sk_test_, from Settings → API & developer in the dashboard.
  • No balance. Test charges and payouts never touch a balance, the test one included, so a test payout needs no funds.

How it works

  1. You call the API with a test key, exactly as you would with a live one.
  2. The request is checked as live checks it, and refused where live would refuse it. The exceptions are under Uganda in test mode.
  3. Instead of a phone or a bank, the sandbox decides the outcome, at once, in the same request.
  4. Webhooks go to the endpoints you registered with a test key, about five seconds later.

Test and live never touch. A test key sees test charges, payouts and webhook endpoints only, and its idempotency keys are its own: an order reference you used while building cannot collide with a real one later.

Charges

amount_minorResultWebhooks
999999failed, failure_reason: insufficient_fundscharge.created, charge.failed
999998pending, and it stays therecharge.created
anything elsesucceededcharge.created, charge.succeeded

A charge's payer number is never consulted: only the amount decides.

Payouts

amount_minorDestinationResultWebhooks after payout.created
999999+250788000002failedpayout.processing, payout.failed
999998+250788000003stays processing: the outcome is unknownpayout.processing, payout.reconciling
999997+250788000004failed, then returnedpayout.processing, payout.failed, payout.returned
999996+250788000005parked_for_reviewpayout.parked
anything else+250788000001, or any othercompletedpayout.processing, payout.completed

The destinations are Rwandan wallet numbers: send them as destination.phone_number, exactly as written, with "network": "MTN". The destination wins where both are magic. A payout to a saved beneficiary has no destination of its own, so use the amounts. A payout over your approval threshold waits for approval first, as in live, and resolves once approved.

What each outcome says:

OutcomeWhere to read it
failedfailure_reason is unknown
stays processingpayout.reconciling carries reason: upstream_timeout
parked_for_reviewpayout.parked carries reason: manual_review_required

Branch on the status, never on the reason or the message. Live reasons come from one vocabulary: insufficient_funds, invalid_account, cancelled_by_payer, timeout, rejected_by_provider, account_unavailable and unknown.

Uganda in test mode

There are no Ugandan test numbers. Use the amounts.

  • A UGX charge resolves by amount, as above. Test mode does not check whether the number is a Ugandan MTN or Airtel number, whether the amount is whole shillings between 1,000 and 5,000,000 UGX, or whether UGX is activated on your business; live does, and leaves such a charge created with nobody prompted. See Accepted, then never sent.
  • A UGX payout meets every live check first: whole shillings, the amount bounds, a Ugandan MTN or Airtel number, a bank_code from /payout-banks. A payout that passes completes. The magic amounts are not whole shillings, so they are refused (400 INVALID_PAYOUT): rehearse failures with an RWF test payout.
  • Account lookups are simulated: a number or account ending in 0000 is not valid, anything else is held by TEST ACCOUNT HOLDER. See Account lookups.

Webhooks

Register an endpoint with your test key. It receives test events only, and a live endpoint never receives one. Test events are sent about five seconds after they happen.

Errors

A test key is refused exactly as a live key would be, with three exceptions: the IP allowlist applies to live keys only, a charge's limits and pauses apply to live keys only, and GET /wallets refuses every test key with 401 WRONG_KEY_MODE. See Errors.

Developer notes

  • Test and live share one host. The key decides the mode; there is no sandbox URL.
  • Nothing reconciles against money. Test rows never appear in a balance or a statement.

What's next

On this page