Skip to main content
All sandbox API calls must use the base URL https://sandbox.nomba.com and your sandbox credentials. Mixing production credentials with the sandbox URL (or vice versa) will cause authentication errors. See Environment for details.

Before you start

Get your sandbox credentials

Log in to the Nomba dashboard, navigate to API Keys, and copy your test clientId, clientSecret, and accountId. These are generated alongside your production credentials and only work with https://sandbox.nomba.com.

Generate a sandbox access token

Exchange your test credentials for an access token. The sandbox token is short-lived โ€” if you get 401 errors mid-test, generate a new one.
Response
All sandbox checkout endpoints are under the /sandbox/checkout/ path prefix, not /v1/checkout/. This is the key difference between sandbox and production.

Card payment flow

Step 1 โ€” Create a checkout order

Response
If you omit orderReference, Nomba generates one in the format {accountId_prefix}_{timestamp} and returns it in the response. Use that value for all subsequent calls.
The sandbox checkout link has the format https://checkout.nomba.com/sandbox/{encryptedRef} โ€” note the /sandbox/ segment, which distinguishes it from production links. Orders and their data are stored for 48 hours before expiring.

Step 2 โ€” Submit card details

Submit the test card details to the checkout. The response depends entirely on which card number you use.

Submit Card with Detail Form

Test card numbers

Use one of these three cards to simulate different payment outcomes:
Card expiry, CVV, and PIN values are not validated in the sandbox โ€” any values are accepted. Only the card number determines the outcome.

Submit Card Detail Form

Step 3 - Submit Card Pin (if required)

Enter 1234 as the card pin

Submit Card Detail Form

Declined card (5484497218317651) response:

Submit Card Detail for Failed Transaction


Step 4 โ€” Submit OTP

After submitting the successful Mastercard (5434621074252808), the customer is prompted for an OTP. Submit one of the following test values to control the outcome:

Submit Card Detail Form

Successful card (5434621074252808) response:

Submit Card Detail Form

On a successful OTP submission, Nomba immediately fires a webhook to your configured callbackUrl with a payment_success event. See Webhook payload below.

Step 4 โ€” Verify the transaction

Use the sandbox-specific fetch endpoint to confirm the transaction result:
Response
You can query by idType=orderReference or idType=orderId. The id value changes accordingly.
The sandbox transaction fetch endpoint is GET /sandbox/checkout/transaction โ€” not GET /v1/checkout/transaction, which is production-only. Transaction IDs in the sandbox follow the format WEB-ONLINE_C-{first6charsOfAccountId}-{UUID}.

Webhook payload

The sandbox fires webhooks synchronously immediately after a successful transaction โ€” either after OTP approval (card) or confirm-transaction-receipt (bank transfer). Webhooks include HMAC-SHA256 signature headers for verification. Signature headers: Sample card payment webhook payload:
To receive webhooks during local development, use a tunnel tool (e.g. ngrok) to expose your local server and set the public URL as your callbackUrl when creating the order.

Refund testing

Refunds are available in the sandbox. Use POST /sandbox/checkout/refund with the transactionId from the fetch transaction response.
To simulate a failed refund, use this specific transactionId:
This always returns code: "400" regardless of the amount.

Simulating error states


Sandbox vs production โ€” whatโ€™s different


Next steps

Create a Checkout Order

Full field reference and production code examples

Verify Transactions

Confirm payment status before delivering value

Webhooks

Set up and verify webhook signatures

Environment

Understand sandbox vs production base URLs