Appearance
Quickstart
This page takes you from nothing to a first successful airtime purchase. Every step is a real request you can run yourself with curl.
This is the live system
There is no test environment. The purchase in step 6 spends real money from your wallet. Use a small amount and a phone number you own.
All requests go to:
https://app.xash.co.zw/api/v11. Get a Xash account
You sign in with a user number and a password. If you already use the Xash app, you have both and can go to step 2.
If you do not have an account, create one in either of these ways:
- In the Xash mobile app. Register, enter the code sent to you by SMS and set a password.
- With the API. Call
POST /api/v1/auth/register, thenPOST /api/v1/auth/set-passwordwith the code from the SMS. The second call returns a session token, so you can go straight to step 3.
Either way you need:
- a Zimbabwean mobile number that can receive SMS. Your user number and a 5-digit verification code are sent to it;
- your name, date of birth and national ID number.
No Zimbabwean mobile number?
A Zimbabwean mobile number is required, even if Xash staff help set up the account.
2. Sign in
bash
curl -X POST https://app.xash.co.zw/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"user_number":"1234567890","password":"YOUR_PASSWORD"}'json
{
"success": true,
"token": "41|EXAMPLEsessionTOKENdoNOTuse000000000000000000",
"tokenType": "Bearer",
"has_address": false,
"has_business": false,
"message": "Login successful."
}token is a session token. It is meant for the next step only. A wrong user number or password answers 401. See Sign in.
3. Create a server token
A server token is what your backend should use from now on. It does not expire and it keeps working when you change your password.
bash
curl -X POST https://app.xash.co.zw/api/v1/auth/server-tokens \
-H "Authorization: Bearer 41|EXAMPLEsessionTOKENdoNOTuse000000000000000000" \
-H "Content-Type: application/json" \
-d '{"name":"production-backend"}'json
{
"success": true,
"message": "Server token created.",
"data": {
"id": 42,
"name": "production-backend",
"token": "42|EXAMPLEserverTOKENdoNOTuse0000000000000000000"
}
}The token is shown once. Store it as a secret on your server. Every request below sends it as Authorization: Bearer YOUR_SERVER_TOKEN. See Server tokens.
Xash can cap what server tokens spend per purchase and per day. Many accounts have no cap. If yours has one, a purchase over it fails with LIMIT_PER_TRANSACTION or LIMIT_DAILY and nothing is charged. See Spending limits.
4. Check your wallet
bash
curl https://app.xash.co.zw/api/v1/wallet/USD \
-H "Authorization: Bearer YOUR_SERVER_TOKEN"json
{
"success": true,
"message": "Wallet retrieved successfully",
"commission_release_date": "2026-11-23T04:30:00+02:00",
"data": {
"currency": "USD",
"name": "US Dollar",
"profit_on_hold": "0.000",
"balance": "0.00"
}
}A new account has a balance of zero, so the next step is to add money.
5. Add funds
The fastest way from an Econet line is EcoCash. This sends a payment prompt to the phone; the owner approves it with their EcoCash PIN.
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"}'json
{
"success": true,
"message": "Check mobile to complete payment.",
"data": {
"id": 9001,
"amount": "5.00",
"currency": "USD",
"payment_method": "ecocash",
"status": "PENDING",
"poll_url": "https://app.xash.co.zw/api/v1/ecocash/poll/9001",
"request_id": "00000000-0000-4000-8000-000000000001"
}
}The response is shortened here. Then ask for the result until status is SUCCESS, FAILED or EXPIRED:
bash
curl https://app.xash.co.zw/api/v1/ecocash/poll/9001 \
-H "Authorization: Bearer YOUR_SERVER_TOKEN"When it is SUCCESS, the money is in your wallet. Other ways to pay (InnBucks, OMari, card, USDT) are on Adding funds. If none of them suits you, for example you want to pay by bank transfer, write to [email protected]: bank deposits are credited by our staff.
6. Make your first purchase
Buy USD 1 of airtime for a phone you own. Send your own reference: it is what makes the request safe to repeat.
bash
curl -X POST https://app.xash.co.zw/api/v1/airtime/direct \
-H "Authorization: Bearer YOUR_SERVER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mobile_phone":"0770000001","amount":1,"currency":"USD","reference":"order-1001"}'A 200 means the airtime was delivered:
json
{
"success": true,
"message": "Recharge to +263770000001 was successful",
"data": {
"name": "Econet airtime",
"type": "direct_airtime",
"id": "00000000-0000-4000-8000-00000000a001",
"reference": "order-1001",
"amount": "1.00",
"currency": "USD",
"mobile_phone": "+263770000001",
"status": "processed",
"balance": {
"currency": "USD",
"name": "US Dollar",
"profit_on_hold": "0.060",
"balance": "4.00"
},
"commission": "USD0.06",
"receipt_footer": "Get airtime/bundle on your change from as little as 10 cents.",
"created_at": "2026-11-19T10:15:00+02:00",
"provider_reference": null,
"product": "airtime",
"recipient": "+263770000001",
"transaction_id": "00000000-0000-4000-8000-00000000a001",
"fulfilment": null,
"error_code": null
}
}There are only three kinds of answer, and your code must handle all three:
| Status | Meaning | What to do |
|---|---|---|
200 | Delivered. | Record the sale. |
4xx or 503 with an error_code | Failed. Nothing was delivered and your wallet was not charged (or was refunded). | Show the failure. To try again, use a new reference, but not after REFERENCE_CONFLICT, DUPLICATE_TRANSACTION, DUPLICATE_PURCHASE, METER_BUSY or PURCHASE_IN_PROGRESS: those point at another purchase that may have been delivered. Check it first. |
202 with OUTCOME_UNKNOWN | Not known yet. The money is held. | Do not buy again. Check the status in step 7. |
If your request times out or the connection drops, you do not know which of the three happened. Send the same request again with the same reference. It will not buy twice. Never switch to a new reference while the outcome is unknown. See References and safe retries.
7. Check what happened
bash
curl "https://app.xash.co.zw/api/v1/transactions/status?reference=order-1001" \
-H "Authorization: Bearer YOUR_SERVER_TOKEN"json
{
"success": true,
"message": "OK",
"data": {
"reference": "order-1001",
"status": "processed",
"provider_reference": null,
"amount": "1.00",
"currency": "USD",
"product": "airtime",
"recipient": "+263770000001",
"transaction_id": "00000000-0000-4000-8000-00000000a001",
"fulfilment": null,
"error_code": null,
"created_at": "2026-11-19T10:15:00+02:00"
}
}status is processed (delivered), failed, processing or unknown. See Check a purchase.
Where to go next
- Sell something else: ZESA electricity, DStv, data bundles, airtime vouchers, WiFi vouchers. Each of them takes a reference in the same way.
- Read Outcomes and error codes before you go live.
- See whether your server tokens have spending limits.
- Reconcile each day with transaction history.