Xtopay Docs
Getting Started

Environments

Sandbox for development and testing, Live for production.

Overview

Xtopay provides two isolated environments:

SandboxLive
PurposeDevelopment & testingProduction
Credentials prefixcid_test_ / csk_test_cid_live_ / csk_live_
Base URLhttps://api.xtopay.co/v1https://api.xtopay.co/v1
Real money movesNoYes
Dashboardapp.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 numberResult
4084 0840 8408 4081Successful payment
4084 0840 8408 4084Declined — insufficient funds
4084 0840 8408 4085Declined — invalid card

Use any future expiry date, any 3-digit CVV, and any billing address.

Test mobile money

NetworkNumberResult
MTN Ghana0551234567Successful
Vodafone Ghana0201234567Successful
MTN Ghana0559999999Failed — 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

On this page