ChapaChapa Docs

Testing Mobile

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:

  • telebirr
  • cbebirr
  • mpesa
  • awashbirr
  • ebirr

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

FieldValue
Phone Number251900000000

Expected Result: Payment succeeds


Insufficient Funds

FieldValue
Phone Number251911111111

Expected Result: Payment fails with INSUFFICIENT_FUNDS


User Cancellation

FieldValue
Phone Number251922222222

Expected Result: Payment cancelled by user


Timeout / No Response

FieldValue
Phone Number251933333333

Expected Result: Payment becomes incomplete

These phone numbers are simulated — no real USSD or SMS is sent.

Example Test Flow (Direct Charge)

POST /v2/payments/initialize/direct
Authorization: Bearer CHAPA_TEST_xxxxxxxxxxxxx
Content-Type: application/json
{
  "amount": 5000,
  "currency": "ETB",
  "payment_method": "telebirr",
  "customer": {
    "phone_number": "251900000000"
  }
}

Expected Webhook Events

Depending on the test phone number used, you'll receive:

ScenarioWebhook Event
Successpayment.success
Failurepayment.failed
Cancelledpayment.cancelled
Timeoutpayment.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/{reference}/verify

Verification results should match the webhook status.

Best Practices

  • Test all mobile scenarios before going live
  • Handle auth_needed even in test mode
  • Build timeout and retry logic
  • Keep test data separate from live data

Common Errors

ErrorMeaning
INVALID_PHONEInvalid phone format
INSUFFICIENT_FUNDSSimulated low balance
USER_CANCELLEDSimulated cancellation
PROCESSING_FAILEDTest engine error

Next Steps

On this page