Test Cards & Phone Numbers
Card numbers and mobile-money phone numbers for testing approvals and declines in test mode.
Test Card Numbers (Visa / Mastercard)
Card payments complete on a hosted checkout page — RohoPay never receives or
transmits the card number, so there's no RohoPay-owned sandbox card to
publish here. The card_number/card_expiry/card_cvv fields on the
/api/v1/checkout request are format-validated locally only (used to reject
obviously-malformed input before creating an order) and then discarded; the
customer enters their real card details on the hosted page itself.
Using a test_ API key routes the checkout to RohoPay's test wallet, so no
real settlement happens on RohoPay's side regardless of what's entered on the
hosted page. For a card number that's guaranteed not to attempt a real
charge on the hosted page itself, contact RohoPay support for the current
sandbox card accepted by the underlying processor — this can change without
notice since it's provider-owned, not RohoPay's.
Older sandbox card numbers you may have seen elsewhere (4111 1111 1111 1111, 4000 0000 0000 0002,
5500 0000 0000 0004, 5200 8282 8210 0001, 5531 8866 5214 2950) do not apply to the hosted checkout page.
The mobile-money sandbox numbers below are unaffected.
Test Mobile Money Numbers
Use these with a test_ API key for mobile-money collections (mtn, airtel,
etc.). These are RohoPay's sandbox numbers — the last digit selects the outcome.
You can send them either in short form (0111...) or with the
256 country prefix (256111...); RohoPay accepts both in test mode.
RohoPay automatically routes each mobile-money collection through the most reliable available channel, with automatic failover to a backup channel if the primary is temporarily unavailable — which channel is used is an internal implementation detail (see Reliability & automatic failover). These sandbox numbers are guaranteed to work regardless of which internal channel ultimately handles the request.
| Phone (short form) | Phone (256 prefix) | Outcome |
|---|---|---|
011177777(0-9) | 25611177777(0-9) | ✅ Success |
011177799(0-9) | 25611177799(0-9) | ❌ Failed |
011177778(0-9) | 25611177778(0-9) | ⏳ Pending |
011177779(0-9) | 25611177779(0-9) | 🔄 SentToVendor |
Examples: 0111777771 (success) or 256111777771 (same number, success);
0111777995 (failed).
The public hosted checkout requires a 256/254/255/250 country prefix
even in test mode — send 256111777771, not 0111777771, there. Direct API
calls to /api/v1/collect accept the short form too.
Mobile-money test numbers only work with test_ keys. Never use sandbox phone
numbers with a live_ key.
Testing an Approval
curl -X POST https://api.rohopay.com/api/v1/checkout \
-H "Content-Type: application/json" \
-d '{
"api_key": "test_YOUR_KEY",
"amount": 10000,
"currency": "UGX",
"customer_name": "Test User",
"customer_email": "test@example.com",
"return_url": "https://your-site.com/checkout/return",
"card_number": "5531886652142950",
"card_expiry": "09/32",
"card_cvv": "564"
}'
You'll get back a payment_url — redirect the browser there. The values
above are placeholders; RohoPay validates their format but never sends them
anywhere, so what you enter on the hosted page itself is what determines the
outcome.
Testing a Decline
RohoPay doesn't currently publish a dedicated decline-outcome test card number —
reach out to RohoPay support if you need to exercise a card-decline path in test
mode. Regardless of card, a decline surfaces as status: "failed" on the
transaction, and the webhook fires with deposit.failed.
Testing Expired Card Validation
RohoPay validates expiry server-side before hitting any provider. Submit a past date to test:
-d '{ ..., "card_expiry": "01/23" }'
# Response: 400 VALIDATION_ERROR — card has expired
Pre-Launch Checklist
Test the success path
Use a Visa/MC success card number and confirm your return URL and webhook both fire correctly.
Test the decline path
Use a decline card and confirm your error UI handles it gracefully.
Test expired card validation
Submit a past expiry date and confirm your frontend shows an appropriate error.
Verify webhook signature
Confirm your webhook handler verifies x-rohopay-signature before processing.
Switch to live_ key
Replace your test_ key with live_ in production environment variables.
