What Is the Sandbox?
The sandbox is a complete copy of the production API that uses fake money. Everything works exactly the same way as production — the same endpoints, the same request formats, the same response structures, the same error codes, the same webhook events — but nothing is real. You can:- Create virtual accounts
- Make transfers between test accounts
- Verify test BVNs, NINs, and CAC numbers
- Register and receive webhook notifications
- Test error scenarios
Your sandbox API key only works with the sandbox base URL. Your production API key only works with the production base URL (
https://api.unionbank.ng). There is no way to mix them up accidentally — the wrong key will receive a 401 Unauthorized response.Sandbox Features
Same API, same responses
Every endpoint, request format, response schema, and error code is identical to production. Code that works in sandbox works in production — just swap the base URL and key.
Fake money
No real transfers happen. Virtual accounts have balances you can manipulate freely. No fees, no charges, no limits on how many test transactions you run.
Free to use
Sandbox access is free for all registered partners. There are no costs during development, regardless of how many calls you make.
Outbox preview
See the emails and SMS messages we would have sent to your customers — without needing a real email server or phone number.
Development Outbox
In production, when a customer completes an action (like a successful transfer), we send them an email or SMS notification. In the sandbox, those notifications go to the outbox preview instead of a real inbox. This means you can test the full notification flow — including email verification during onboarding — without setting up a real email server or using real phone numbers.Test Data Reference
Use the following values when making API calls in the sandbox. These are pre-configured to return predictable, successful responses.KYC — BVN Verification
KYC — BVN Verification
Use any 11-digit number starting with These will always return a successful BVN match. Numbers that do not start with
222.222 will return a not found response — useful for testing your error handling.KYC — NIN Verification
KYC — NIN Verification
Use any 11-digit number starting with These will always return a successful NIN match. Numbers not starting with
123.123 return not found.KYB — CAC Number
KYB — CAC Number
Use To test an
RC-1234567 to get a company that always returns ACTIVE status with full director information.INACTIVE company response, use RC-9999999.Payments — Account Enquiry & Transfers
Payments — Account Enquiry & Transfers
Use the following account details for transfer testing:
This account always returns a valid enquiry response. Transfers to this account are always accepted and complete immediately with a
| Field | Value |
|---|---|
| Account Number | 0123456789 |
| Bank Code | 058 (GTBank test instance) |
| Account Name | Returns TEST ACCOUNT USER |
SUCCESS status.To simulate a failed transfer, use account number 0000000000.Testing Webhooks Locally with ngrok
When you develop locally (on your laptop or a development machine), your application is not accessible from the internet. Our webhook system cannot reachhttp://localhost:3000.
ngrok solves this. It creates a temporary, publicly accessible URL that tunnels through to your local machine. Think of it as a temporary doorbell on the internet that rings your local server.
Install ngrok
Start your local server
Make sure your application is running locally. For example, if you are using Node.js:
Expose your local server
In a separate terminal window, run:ngrok will print output like:The
https://abc123.ngrok.io URL is now publicly accessible and forwards to your local server.Register the ngrok URL as your webhook endpoint
In the sandbox portal, register your webhook endpoint using the ngrok URL:Now when events fire in the sandbox (a transfer completes, an account is credited), the webhook notification will be sent to that URL, which ngrok forwards to your local server.
Moving from Sandbox to Production
When your integration is ready, switching to production is a two-step change:- Change the base URL from
https://sandbox.api.unionbank.ngtohttps://api.unionbank.ng. - Change your API key from your sandbox key to your production key (obtained after go-live approval).
Sandbox Limitations
The sandbox is designed to be a faithful replica of production, but there are a few things it cannot do:| Limitation | Detail |
|---|---|
| No real money movement | Transfers are simulated. No actual funds move between real bank accounts. |
| Email and SMS go to outbox preview | Notifications do not reach real inboxes or phone numbers. Use GET /dev/outbox-preview to inspect them. |
| Some bank codes return test responses only | Not all bank codes available in production are active in the sandbox. Use bank code 058 for reliable test responses. |
| Transfer settlement is instant | In production, NEFT transfers settle within T+1. In the sandbox, all transfers settle immediately to make testing faster. |