Environments
Sandbox for development and testing, Live for production.
Overview
Xtopay provides two isolated environments:
| Sandbox | Live | |
|---|---|---|
| Purpose | Development & testing | Production |
| Credentials prefix | cid_test_ / csk_test_ | cid_live_ / csk_live_ |
| Base URL | https://api.xtopay.co/v1 | https://api.xtopay.co/v1 |
| Real money moves | No | Yes |
| Dashboard | app.xtopay.co (toggle in sidebar) | app.xtopay.co (toggle in sidebar) |
The API base URL is the same for both environments — the credentials you use determine which environment your requests hit.
Sandbox
Use sandbox to build and test your integration without moving real money.
Test cards
| Card number | Result |
|---|---|
4084 0840 8408 4081 | Successful payment |
4084 0840 8408 4084 | Declined — insufficient funds |
4084 0840 8408 4085 | Declined — invalid card |
Use any future expiry date, any 3-digit CVV, and any billing address.
Test mobile money
| Network | Number | Result |
|---|---|---|
| MTN Ghana | 0551234567 | Successful |
| Vodafone Ghana | 0201234567 | Successful |
| MTN Ghana | 0559999999 | Failed — number not registered |
Sandbox webhooks
Webhooks fire in sandbox just as in production. Use a tool like ngrok or the Xtopay dashboard's webhook tester to receive sandbox events during local development.
Live
Live credentials are issued after completing KYB (Know Your Business) verification in the dashboard. Go to Settings → Verification to start the process.
Sandbox and Live credentials are completely separate. Switching to Live requires re-configuring environment variables in your production environment.
Switching environments
In the Xtopay dashboard, use the Test / Live toggle in the top navigation bar. All pages — payments, subscriptions, customers, webhooks — show data for the active environment only.
In your code, switch environments by changing your environment variables:
# Sandbox
XTOPAY_CLIENT_ID=cid_test_xxxxxxxxxxxxxxxxxxxx
XTOPAY_CLIENT_SECRET=csk_test_xxxxxxxxxxxxxxxxxxxx
# Live
XTOPAY_CLIENT_ID=cid_live_xxxxxxxxxxxxxxxxxxxx
XTOPAY_CLIENT_SECRET=csk_live_xxxxxxxxxxxxxxxxxxxx