Skip to Content
Pesa VoucherDeveloper Documentation

Testing & Sandbox

Test your integration safely with full simulation of deposits, withdrawals, and float behavior.


Testing & Go-Live Checklist

Sandbox Environment

Use the sandbox to test your integration safely — no real money moves.

ItemValue
Base URLhttps://sandbox.payments.pesavoucher.com/api/v1
CredentialsSeparate test keys (pk_test_... / sk_test_...)
Callback IPs196.201.214.136 and 196.201.214.137
Real moneyNever — all transactions are simulated

Magic Test Phone Numbers (Sandbox Only)

Phone NumberSTK Push ResultB2C Result
254708374149Success instantlySuccess instantly
254711223344Failed – Insufficient balanceFailed – Insufficient balance
254722334455Cancelled by userN/A
254733445566Timeout (no response)Timeout
  1. Use test credentials + sandbox URL
  2. Initiate an STK Push or B2C request
  3. Callback is sent within 5–10 seconds
  4. Verify your webhook receives and processes correctly
  5. Check logs and database for correct status updates
  6. Test all flows: Success, Failed, Cancelled, Timeout

Go-Live Checklist

Tick every item before switching to production.

Integration & Code

  • [ ] All API calls use production URL and live keys
  • [ ] Webhook endpoint is publicly accessible over HTTPS
  • [ ] Webhook verifies and whitelists our production callback IPs
  • [ ] Webhook returns 200 OK quickly and processes asynchronously
  • [ ] Idempotency implemented using payment_id
  • [ ] Proper error handling and retry logic in place
  • [ ] Logging & monitoring set up (errors, callbacks, latencies)

Security & Compliance

  • [ ] Your server IPs are whitelisted in merchant portal
  • [ ] Production callback IPs are allowed in your firewall/load balancer
  • [ ] API Secret stored only in environment variables (never in code)
  • [ ] SSL certificate valid and not expiring soon
  • [ ] Rate limiting / abuse protection configured

Final Real-Money Tests

  • [ ] Perform 2–3 small live STK Push transactions (e.g., 10.00 KES)
  • [ ] Perform 1–2 small live B2C payouts (if applicable)
  • [ ] Confirm funds arrive correctly and callbacks fire
  • [ ] Verify reconciliation (receipt numbers match in dashboard)

Activation

  • [ ] Contact support and request production activation
  • [ ] Receive confirmation that your account is live
  • [ ] Update your app/config to use live keys permanently
  • [ ] Remove test keys from production servers

Production Activation Process

  1. Send email to support@pesavoucher.com with:
    • Merchant ID
    • Statement “Please activate production mode”
    • Confirmation that go-live checklist is complete
  2. Support enables live mode (usually within 1 business day)
  3. You receive new live API keys (if not already issued)
  4. Start with low-value transactions and monitor closely for 24–48 hours

Post Go-Live Recommendations

  • Monitor callback delivery and processing latency
  • Set up alerts for failed webhooks or high error rates
  • Reconcile daily with the merchant dashboard
  • Keep an eye on balance and top up before it runs low

You’re now fully prepared to go live safely and confidently!