Skip to content

API basics ​

Everything on this page applies to every endpoint.

Base URL ​

https://app.xash.co.zw/api/v1

All 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 ​

HeaderValueWhen
AuthorizationBearer YOUR_TOKENEvery endpoint except sign-in and the public Xash app endpoints.
Content-Typeapplication/jsonEvery request with a body.
Acceptapplication/jsonOptional. The API always answers in JSON.

Tokens ​

There are two kinds of token. Both are sent the same way.

Session tokenServer token
How you get itPOST /api/v1/auth/loginPOST /api/v1/auth/server-tokens
Meant forSigning in, then creating a server token. The Xash app.Your backend.
ExpiresNo fixed lifetime.Never.
Stops working whenYou 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": {}
}
  • success is true or false.
  • message is a short sentence you may show to a person.
  • data holds the result. Some errors also put details in data.

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 ​

StatusBodyMeaning
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. USD is the main one. Call GET /api/v1/wallet to see the currencies your account has.
  • Send amounts as JSON numbers (5 or 5.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:

PrefixNetwork
077, 078, 079Econet
071, 072NetOne
073Telecel

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.

This is the main reason to always send a reference. See References and safe retries.