Appearance
API basics
Everything on this page applies to every endpoint.
Base URL
https://app.xash.co.zw/api/v1All paths in these docs are written in full, for example POST /api/v1/airtime/direct. Use HTTPS. There is one environment: the live one. There is no sandbox.
Headers
| Header | Value | When |
|---|---|---|
Authorization | Bearer YOUR_TOKEN | Every endpoint except sign-in and the public Xash app endpoints. |
Content-Type | application/json | Every request with a body. |
Accept | application/json | Optional. The API always answers in JSON. |
Tokens
There are two kinds of token. Both are sent the same way.
| Session token | Server token | |
|---|---|---|
| How you get it | POST /api/v1/auth/login | POST /api/v1/auth/server-tokens |
| Meant for | Signing in, then creating a server token. The Xash app. | Your backend. |
| Expires | No fixed lifetime. | Never. |
| Stops working when | You log out with it, or the account password is changed or reset (all session tokens are deleted). | You revoke it. |
Use a server token for an integration. A password change will not break it.
A request without a valid token answers 401:
json
{
"message": "Unauthenticated."
}Response format
Most responses have the same three keys:
json
{
"success": true,
"message": "Wallet retrieved successfully",
"data": {}
}successistrueorfalse.messageis a short sentence you may show to a person.dataholds the result. Some errors also put details indata.
Failures that your code should act on also carry a stable error_code, for example INSUFFICIENT_FUNDS. Branch on error_code and the HTTP status, never on the text of message. The codes are listed on Outcomes and error codes.
Validation errors
A request with a missing or invalid field answers 422 in this shape. Note that it has no success key:
json
{
"message": "The amount field must be at least 0.1. (and 1 more error)",
"errors": {
"amount": ["The amount field must be at least 0.1."],
"currency": ["The selected currency is invalid."]
}
}Other standard answers
| Status | Body | Meaning |
|---|---|---|
401 | {"message": "Unauthenticated."} | Missing, wrong or revoked token. |
404 | {"message": "..."} | No such path, or the item in the path does not exist. |
405 | {"errors": "Method not allowed."} | Wrong HTTP method for this path. |
429 | {"message": "Too Many Attempts."} | Rate limit reached. See below. |
Rate limits
The API allows 60 requests per minute per IP address. When you pass it you get 429 with a Retry-After header (seconds). Every response carries X-RateLimit-Limit and X-RateLimit-Remaining.
Some endpoints have their own, tighter limits. Each is noted on its page. The main one is sign-in: 5 attempts per minute for one account from one IP.
Money and currencies
- Your wallet holds one balance per currency.
USDis the main one. CallGET /api/v1/walletto see the currencies your account has. - Send amounts as JSON numbers (
5or5.50). Responses return most amounts as strings ("5.00"). - Currency codes are case-sensitive. Send them exactly as the wallet returns them.
Phone numbers
Zimbabwean mobile numbers are accepted in any of these forms: 0770000001, 263770000001, +263770000001. Responses return them as +263770000001.
The network is worked out from the number:
| Prefix | Network |
|---|---|
077, 078, 079 | Econet |
071, 072 | NetOne |
073 | Telecel |
Times
Times are ISO 8601. Most are UTC (2026-11-19T08:15:00.000000Z). Some carry the Zimbabwe offset (2026-11-19T10:15:00+02:00). Parse the offset; do not assume one or the other.
When you get no answer, or an HTML page
If a request times out, the connection drops, or you receive a 502 or 504 page that is not JSON, you do not know whether the purchase happened.
- If you sent a
reference, send the same request again or check its status. - If you did not, look in transaction history before trying again.
This is the main reason to always send a reference. See References and safe retries.