Testing
ZuriPay provides a sandbox environment for testing your integration without processing real payments. Use test API keys to simulate payment flows.
Test API keys
Test API keys have the prefix sk_test_ or pk_test_. They connect to the same API endpoints but route to a sandbox environment.
| Key Type | Prefix | Purpose |
|---|---|---|
| Secret (test) | sk_test_* | Server-side test operations |
| Public (test) | pk_test_* | Client-side test operations |
| Secret (live) | sk_live_* | Server-side production operations |
| Public (live) | pk_live_* | Client-side production operations |
Obtain your test keys from the ZuriPay Dashboard under Settings > API Keys.
Test mode and live mode use the same API endpoints. The API key prefix determines which environment processes the request.
Test transactions
When using test keys, you can simulate different transaction outcomes.
EcoCash mobile money testing
For EcoCash payments in test mode, include the requested_response parameter to simulate different outcomes:
- Name
requested_response- Type
- string
- Description
Simulated response type. Use
"success"for successful payments or"failed"for failed payments.
Card payment testing
For card payments (Zimswitch/DPO), the test environment provides a simulated checkout flow that mimics the production experience.
Test transaction with EcoCash
curl -X POST https://api.zuripay.app/v1/transactions \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"email": "[email protected]",
"currency": "USD",
"payment_method_type": "mobile_money",
"payment_method_code": "ecocash",
"mobile_money_number": "0771234567",
"requested_response": "success"
}'
Going live
When you are ready to accept real payments, follow these steps:
- Complete business verification -- Submit your business details and documentation in the Dashboard
- Submit a Go Live Request -- Found under Settings > API Keys in the Dashboard
- Wait for approval -- The ZuriPay team will review your application
- Replace test keys with live keys -- Update your server configuration to use
sk_live_*keys
Checklist before going live
- All test transactions pass successfully
- Webhook endpoints are configured and responding
- Error handling covers all edge cases
- Success and failure redirect URLs are working
- Customer email notifications are formatted correctly
Your business must be approved for live transactions before live keys will work. Attempting to use live keys without approval returns an error: "Business is not approved for live transactions."