Skip to content

Buy direct airtime ​

Loads airtime straight onto a mobile number. The network is worked out from the number.

POST /api/v1/airtime/direct

Body ​

FieldTypeRequiredDescription
mobile_phonestringYesThe number to top up. A Zimbabwean mobile number on a network with has_direct_airtime (list).
amountnumberYesAt least 0.1.
currencystringYesThe wallet to pay from, for example USD.
referencestringNo, but send itYour own id for this purchase. Up to 120 characters: letters, digits, :, ., _ and -. Makes the request safe to repeat.

Example ​

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"}'

Response 200: 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": "49.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
  }
}
FieldDescription
referenceYour reference, as you sent it.
statusprocessed.
transaction_id, idThe Xash transaction id. Quote it to support. It appears as id in transaction history.
amount, currencyWhat your wallet was charged.
balanceYour wallet after the purchase.
commissionWhat you earned on this sale.
productairtime.
recipient, mobile_phoneThe number that was topped up.
provider_reference, fulfilmentAlways null for airtime.

A repeat of the same request returns this same answer and does not top up again.

Response 202: not known yet ​

json
{
  "success": false,
  "error_code": "OUTCOME_UNKNOWN",
  "message": "This purchase is still being confirmed. Do not buy again; check its status with this reference.",
  "data": {
    "reference": "order-1001",
    "status": "unknown",
    "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"
  }
}

The network did not give a clear answer. The money is held. Do not buy again. Check the status later with the same reference. data.status is processing instead of unknown when an earlier request with this reference is still running.

Failures ​

A failure means nothing was delivered and your wallet was not charged, or was refunded.

json
{
  "success": false,
  "error_code": "INSUFFICIENT_FUNDS",
  "message": "You do not have enough balance to make this transaction.",
  "data": {
    "reference": "order-1002",
    "status": "failed",
    "provider_reference": null,
    "amount": "500.00",
    "currency": "USD",
    "product": "airtime",
    "recipient": "+263770000001",
    "transaction_id": "00000000-0000-4000-8000-00000000a002",
    "fulfilment": null,
    "error_code": "INSUFFICIENT_FUNDS",
    "created_at": "2026-11-19T10:16:00+02:00"
  }
}
Statuserror_codeMeaning
422INSUFFICIENT_FUNDSYour balance is lower than the amount.
422LIMIT_PER_TRANSACTION, LIMIT_DAILYA spending limit on your server tokens refused the purchase. Nothing was charged. data also carries the limit figures.
422PROVIDER_REJECTEDThe network refused the top-up. message carries its reason. Refunded.
503SERVICE_UNAVAILABLEThis network is not available right now. Nothing was charged.
503NOT_SENTThe purchase could not be started. Nothing was charged or sent to the network.
409REFERENCE_CONFLICTThis reference belongs to an earlier purchase for a different number, amount or currency. That purchase may have been delivered: look it up before buying again.
422noneA field is invalid. Validation error. No purchase was recorded, so the reference is still free.

A failed reference stays failed. Repeating it returns the same failure. To try the purchase again, send a new reference. REFERENCE_CONFLICT is not such a failure: see codes that point at an earlier purchase.

Without a reference ​

The endpoint also works without reference, as it always has. Then a repeat is a new purchase, and the answers are less precise:

StatusBodyMeaning
200data.reference is a short receipt code, data.status is success, data.id is the transaction id.Delivered.
400{"success": false, "message": "You do not have enough balance to make this transaction."}Not enough balance.
400message from the network, data.reference is the transaction id.The network refused it. Refunded.
202error_code is OUTCOME_UNKNOWN, data.reference is the transaction id, data.status is on_hold.Not known yet. Do not buy again. Find the transaction in history with include_pending.
409error_code is RECENT_DUPLICATE.NetOne only: the same number and amount were topped up successfully in the last 10 minutes.
422error_code is LIMIT_PER_TRANSACTION or LIMIT_DAILY.A spending limit on your server tokens refused the purchase. Nothing was charged.
500{"success": false, "message": "..."}Airtime is not set up for this network. Nothing was charged.

If you cannot send a reference, treat a timeout as "unknown" and check transaction history before trying again.