Test Mobile Payments
Validate mobile money payment flows in Test Mode without charging real wallets.
Testing Mobile allows you to validate mobile money payment flows (such as Telebirr, CBE Birr, M-Pesa, etc.) in Test Mode, without charging real wallets.
This helps you test:
- Direct Charge mobile flows
- USSD / PIN / OTP–based authentication
- Webhook delivery for mobile payments
- Verification and error handling
Mobile testing is available only in Test Mode and behaves differently from live wallets.
Supported Mobile Payment Methods (Test Mode)
Common mobile methods you can test include:
telebirrcbebirrmpesaawashbirrebirr
Availability may vary depending on:
- Currency
- Country
- Merchant configuration
Test Mode Requirements
To test mobile payments:
- Use test API keys (
CHAPA_TEST_...) - Ensure the environment is set to test
- Use test phone numbers (no real wallet interaction)
Test Phone Numbers
Success Scenario
| Field | Value |
|---|---|
| Phone Number | 251900000000 |
Expected Result: Payment succeeds
Insufficient Funds
| Field | Value |
|---|---|
| Phone Number | 251911111111 |
Expected Result: Payment fails with INSUFFICIENT_FUNDS
User Cancellation
| Field | Value |
|---|---|
| Phone Number | 251922222222 |
Expected Result: Payment cancelled by user
Timeout / No Response
| Field | Value |
|---|---|
| Phone Number | 251933333333 |
Expected Result: Payment becomes INCOMPLETE
These phone numbers are simulated — no real USSD or SMS is sent.
Example Test Flow (Direct Charge)
This request uses the success phone number from the table above. Use a new merchant reference and idempotency key for each new test payment. To test another outcome, replace customer.phone_number with the corresponding test number.
For cURL, set PRIVATE_KEY in your shell. Set IDEMPOTENCY_KEY for this operation and reuse it on retries. Replace the placeholders in the JavaScript example before running it.
{
"payment_method": "telebirr",
"amount": 10000,
"currency": "ETB",
"merchant_reference": "mobile-test-001",
"customer": {
"phone_number": "251900000000"
}
}curl -X POST 'https://api.chapa.global/v2/payments/direct' \
-H "Authorization: Bearer $PRIVATE_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{
"payment_method": "telebirr",
"amount": 10000,
"currency": "ETB",
"merchant_reference": "mobile-test-001",
"customer": {
"phone_number": "251900000000"
}
}'const response = await fetch("https://api.chapa.global/v2/payments/direct", {
method: "POST",
headers: {
"Authorization": "Bearer <PRIVATE_KEY>",
"Idempotency-Key": "<IDEMPOTENCY_KEY>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"payment_method": "telebirr",
"amount": 10000,
"currency": "ETB",
"merchant_reference": "mobile-test-001",
"customer": {
"phone_number": "251900000000"
}
})
});
const data = await response.json();
console.log(data);Expected Webhook Events
Depending on the test phone number used, you'll receive:
| Scenario | Webhook Event |
|---|---|
| Success | payment.success |
| Failure | payment.failed |
| Cancelled | payment.cancelled |
| Timeout | payment.incomplete |
Each webhook includes:
{
"mode": "test"
}Use this field to separate test and live processing.
Verification
Always confirm the final result using:
GET /v2/payments/{paymentReference}/verifyVerification results should match the webhook status.
Best Practices
- Test all mobile scenarios before going live
- Handle
AUTH_NEEDEDeven in test mode - Build timeout and retry logic
- Keep test data separate from live data
Common Errors
| Error | Meaning |
|---|---|
INVALID_PHONE | Invalid phone format |
INSUFFICIENT_FUNDS | Simulated low balance |
USER_CANCELLED | Simulated cancellation |
PROCESSING_FAILED | Test engine error |
Next Steps
- Test Card Payments - Test card payments
- Direct Charge - Initiate mobile payments
- Payment Webhooks - Handle payment events