Test your integration
Try your integration in the Hubtel Sandbox before you go live, with sandbox keys, test numbers and integration checks.
Use the sandbox to test requests, customer responses and callbacks without moving money or sending messages to real phones. It simulates the documented APIs; some operations return example data rather than processing a complete workflow.
Sandbox keys
Your sandbox API ID and key are in Workbench → Test keys. Send them with HTTP Basic authentication, exactly as you would your production credentials. In the sandbox, the same key also authenticates SMS requests.
To call the sandbox, put https://developers.hubtel.com/sandbox/v1/ and the first part of the production host in front of the production path:
| Production | Sandbox |
|---|---|
https://rmp.hubtel.com/merchantaccount/… | https://developers.hubtel.com/sandbox/v1/rmp/merchantaccount/… |
https://api-txnstatus.hubtel.com/transactions/… | https://developers.hubtel.com/sandbox/v1/api-txnstatus/transactions/… |
Test numbers
For supported simulations, use these numbers to select an outcome. Check the operation’s sandbox metadata in the OpenAPI spec before relying on a simulated result:
| Customer number | What happens | Final state |
|---|---|---|
233240000001 | Approved. Customer approves the prompt. One callback arrives about 3 seconds later. | success |
233240000002 | Insufficient funds. The wallet balance is too low. The callback reports a failure. | failed |
233240000003 | Declined. Customer declines the prompt on their phone. | failed |
233240000004 | No response. The customer does not respond. The prompt expires after 5 minutes of sandbox time. | expired |
233240000005 | Callback lost. The payment succeeds but no callback is delivered. Reconcile with the Status Check API. | success |
233240000006 | Duplicate callback. Sandbox drill: the same successful callback is delivered twice. Production sends one final callback per payment, but your handler must still fulfil the order once. | success |
233240000007 | Out of order. Sandbox drill: a pending callback arrives after the success callback. Production only sends final results, but keep the order marked as paid either way. | success |
233240000008 | Not a wallet. The number is not registered for mobile money. Rejected immediately with a validation error. | failed |
Any other number | You decide. Any other number shows the prompt on the Virtual Phone. Approve or decline it yourself. | You decide |
For any other valid number, approve or decline the prompt yourself on the Workbench Virtual Phone.
| Card number | Result |
|---|---|
4000 0000 0000 0002 | Visa, approved. |
4000 0000 0000 0010 | Visa, declined by issuer. |
5200 0000 0000 0007 | Mastercard, asks for 3-D Secure (use code 123456). |
Online Checkout in the sandbox
A sandbox checkoutUrl opens the portal’s simulated checkout page. Use it to test the payment flow; it is not the production payment service.
Create a checkout
Send the request with your test key, or create the checkout from your own server:
Pay on the page
Open the checkoutUrl from the response and pay:
- Mobile Money: use a test number. For any other number, approve or decline the prompt on the Workbench Virtual Phone.
- Card: use a test card from the Cards tab above. The 3-D Secure card opens a sandbox issuer page; enter
123456to pass, or any other code to fail.
Wallet, GHQR, PaySmallSmall and Bank Pay appear on the page but aren't available in the sandbox.
Handle the result
Your callbackUrl receives the documented callback shape, with PaymentDetails.PaymentType set to mobilemoney or card. When the customer finishes, the page sends them to your returnUrl with checkoutid added to the query string. Confirm the payment from the callback or a status check before you fulfil the order, as in production.
To embed the page, load the checkoutDirectUrl in an iframe. The mobile and JavaScript Checkout SDKs always run against production, so test them with production keys and small amounts.
Simulate errors and time
Add a Hubtel-Simulate header to a sandbox request to test how your client handles failures: timeout, 500, 503, rate_limit (the simulated per-number limit) or slow:4000.
The sandbox implements these behaviours:
- A reused
ClientReferenceis rejected for an hour of sandbox time withDuplicate Client Reference. - A customer number gets at most 4 payment requests a minute. Advance the clock to reset the limit.
- Callbacks are retried 30 seconds and then 60 seconds after a failed attempt, 3 attempts in all, each allowed 30 seconds.
- A payout your disbursement balance can't cover is accepted, then fails with a
4075callback. Payout callbacks are sent once, without retries. - A reused payout
ClientReferenceis rejected for 48 hours, and an Online CheckoutclientReferencefor 7 days, across every merchant. The example above adds the time to its reference so you can run it again. - Where production's answer gives no reason, the sandbox explains in a
Hubtel-Sandbox-Noteresponse header.
The hosted sandbox only sends callbacks to public addresses. To receive them on your own machine, expose your local server with a tunnel and use its public URL as the callback URL:
cloudflared tunnel --url http://localhost:3000
# or
ngrok http 3000To test the 5-minute reconciliation window without waiting, ask your AI agent to move the sandbox clock forward with the MCP advance_sandbox_clock tool (300 seconds).
Integration checks
Run the checks from Workbench → Webhooks → Integration checks, or use run_certification through the Hubtel MCP server.
Use a public test deployment of your handler with test data and real-world delivery disabled. The checks send synthetic callbacks, including references that are not real orders. Keep your production sender checks in place; sandbox requests come from the sandbox, not the production callback addresses.
The checks cover:
- Acknowledgement of a success callback, a duplicate and a late pending notification.
- Sandbox activity showing a failed payment and a status lookup for a payment with a lost callback (
233240000005). These observations do not prove that your application updated its own records correctly. - An optional lookup of your fulfilment record after the repeated callbacks.
To enable the fulfilment lookup, add this route on the same host as your test callback URL. Return the actual stored result for the requested reference, not a hardcoded response:
GET /hubtel/certification/orders/:reference{ "fulfilments": 1, "status": "paid" }Without this route, the exactly-once check reports not checked. A passing report is sandbox evidence, not production approval. Also verify your own order records for success, failure, duplicate delivery and a lost callback.
Normal sandbox deliveries include a Hubtel-Signature header; integration-check callbacks do not.