Appearance
EcoCash
Sends a payment prompt to an Econet number. The owner approves it with their EcoCash PIN and the amount is added to your USD wallet.
POST /api/v1/ecocash/pay
Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | USD to add to your wallet. At least 0.1. |
ecocash_phone | string | Yes | The payer's Econet number (077, 078 or 079). |
charge_currency | string | No | USD (default) or ZWG. See Charging in ZWG. |
request_id | string | No | A UUID that makes the start safe to repeat. Recommended. |
callback_url | string | No | Where to send the callback. |
Example
bash
curl -X POST https://app.xash.co.zw/api/v1/ecocash/pay \
-H "Authorization: Bearer YOUR_SERVER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 5,
"ecocash_phone": "0770000001",
"request_id": "00000000-0000-4000-8000-000000000001",
"callback_url": "https://shop.example.com/hooks/xash?order=1001"
}'Response 200
json
{
"success": true,
"message": "Check mobile to complete payment.",
"data": {
"id": 9001,
"amount": "5.00",
"currency": "USD",
"payment_method": "ecocash",
"status": "PENDING",
"archived": false,
"reconciliation_required": false,
"start_unconfirmed": false,
"expires_at": "2026-11-19T08:30:00.000000Z",
"created_at": "2026-11-19T08:15:00.000000Z",
"poll_url": "https://app.xash.co.zw/api/v1/ecocash/poll/9001",
"charge_amount": "5.00",
"charge_currency": "USD",
"exchange_rate": null,
"order_reference": "DEP_EXAMPLE001",
"request_id": "00000000-0000-4000-8000-000000000001",
"debit_reported": false,
"debit_report_status": null,
"status_message": "Check mobile to complete payment."
}
}Fields are explained under The deposit object.
When you repeat a request with a request_id whose deposit has already finished, message tells you so: Payment received., This payment request was not completed. Use a new request to try again. or This payment request expired. Use a new request to try again.
Then
Poll the deposit every few seconds until status is SUCCESS, FAILED or EXPIRED, or wait for the callback and then poll once to confirm.
Errors
See When starting a deposit fails. The validation errors specific to EcoCash:
| Status | When |
|---|---|
422 | ecocash_phone is missing, is not a Zimbabwean number, or is not an Econet number. |
The payer was charged but the deposit failed
This is rare, but it happens when the confirmation from the mobile network is lost. Xash rechecks open and failed deposits with the bank on its own. The payer can also report the debit with the approval code from their EcoCash SMS.