Skip to content

WiFi vouchers ​

Sell Equal WiFi voucher PINs. The customer connects to an Equal WiFi hotspot and enters the PIN.

Vouchers come from stock, so a purchase either completes at once or fails at once. Prices are in USD.

Not on every account

WiFi vouchers are not in the default set of services. Check for the wifi_voucher slug in GET /api/v1/services, and ask Xash to add it if you need it.

List the options ​

GET /api/v1/wifi/vouchers

Returns each kind of voucher that is in stock now.

bash
curl https://app.xash.co.zw/api/v1/wifi/vouchers \
  -H "Authorization: Bearer YOUR_SERVER_TOKEN"
json
{
  "success": true,
  "message": "Available Equal voucher values",
  "data": [
    {
      "amount": "1.00",
      "duration": 24,
      "duration_in": "hours",
      "data_limit": "1GB",
      "currency": "USD"
    },
    {
      "amount": "10.00",
      "duration": 30,
      "duration_in": "days",
      "data_limit": "Unlimited",
      "currency": "USD"
    }
  ]
}

A kind of voucher is identified by all four of amount, duration, duration_in and data_limit. Send them back exactly as listed when you buy. A kind that has sold out disappears from the list.

Buy vouchers ​

POST /api/v1/wifi/vouchers/buy

Body ​

FieldTypeRequiredDescription
amountnumberYesThe price of one voucher, from the list.
durationintegerYesFrom the list.
duration_instringYesFrom the list.
data_limitstringYesFrom the list.
currencystringYesUSD.
quantityintegerYesHow many vouchers. At least 1.
client_referencestringNo, but send itYour own id for this purchase. 6 to 64 characters: letters, digits, - and _. Makes the request safe to repeat.

You are charged amount × quantity.

The field is client_reference, not reference

WiFi vouchers have their own idempotency field, with slightly different rules from the reference used by the other products. See how it differs.

Example ​

bash
curl -X POST https://app.xash.co.zw/api/v1/wifi/vouchers/buy \
  -H "Authorization: Bearer YOUR_SERVER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1,
    "duration": 24,
    "duration_in": "hours",
    "data_limit": "1GB",
    "currency": "USD",
    "quantity": 2,
    "client_reference": "order-4001"
  }'

Response 200 ​

json
{
  "success": true,
  "message": "Equal WiFi Voucher purchase was successful",
  "data": {
    "status": "success",
    "type": "equal_voucher",
    "id": "00000000-0000-7000-8000-000000000e01",
    "reference": "000000000E01",
    "client_reference": "order-4001",
    "name": "Equal WiFi Voucher",
    "amount": "2.00",
    "voucher_value": "1.00",
    "currency": "USD",
    "balance": {
      "currency": "USD",
      "name": "US Dollar",
      "profit_on_hold": "0.100",
      "balance": "41.00"
    },
    "vouchers": [
      { "id": 501, "pin": "0000 1111", "data_limit": "1GB", "amount": "1.00", "duration": 24, "duration_in": "hours" },
      { "id": 502, "pin": "2222 3333", "data_limit": "1GB", "amount": "1.00", "duration": 24, "duration_in": "hours" }
    ],
    "commission": "USD0.10",
    "receipt_footer": "Get airtime/bundle on your change from as little as 10 cents.",
    "created_at": "2026-11-19T08:15:00.000000Z",
    "recharge_instructions": "1. Connect to \"Equal WiFi.\"\n2. Click \"Sign In\" to access the network.\n3. Enter your voucher and press \"Connect\" or visit eql.co.zw"
  }
}
FieldDescription
vouchersOne object per voucher. pin is what the customer enters, with spaces added for reading.
amountThe total charged.
voucher_valueThe price of one.
client_referenceYour reference, or null.
idThe Xash transaction id. You can also check the purchase with it.
referenceA short receipt code.
recharge_instructionsHow the customer uses the voucher.

When you repeat a client_reference that already succeeded, you get the same vouchers again with "replayed": true added to data. Nothing new is bought.

Errors ​

Statuserror_coderefundedMeaning
400noneYou do not have enough balance to make this transaction.
409OUT_OF_STOCKtrueNot enough vouchers of this kind. Your balance was not debited. Try a lower quantity or another kind.
409IDEMPOTENCY_CONFLICTThis client_reference was already used for a different purchase.
409PURCHASE_IN_PROGRESSA purchase with this client_reference is still running. Check its status before trying again.
422LIMIT_PER_TRANSACTION, LIMIT_DAILYA spending limit on your server tokens refused the purchase. Nothing was charged, and the client_reference is not used up: send it again when the amount fits the limit.
422VEND_FAILEDtrueThe purchase failed and the money was returned.
422VEND_FAILEDfalseThe purchase failed and the money could not be released automatically. It is held for review. data.reference is the transaction id; contact support with it.
404noneWiFi vouchers are not available.
422noneA field is missing or has a value Xash does not sell at all. Validation error. A combination of valid values that is not in stock answers 409 OUT_OF_STOCK instead.

Example:

json
{
  "success": false,
  "error_code": "OUT_OF_STOCK",
  "message": "Not enough vouchers of this type are in stock. Try a lower quantity or another package. Your balance has not been debited.",
  "refunded": true
}

Check a purchase ​

GET /api/v1/wifi/vouchers/purchases/{reference}

reference is your client_reference, or the Xash transaction id for a purchase made without one. Read-only.

bash
curl https://app.xash.co.zw/api/v1/wifi/vouchers/purchases/order-4001 \
  -H "Authorization: Bearer YOUR_SERVER_TOKEN"

A purchase that is found always answers 200. Read data.status:

data.statusOther fieldsMeaning
successThe full purchase, as in the buy response, including vouchers.Delivered.
failed"refunded": trueFailed and refunded. You can buy again with the same client_reference.
failed"refunded": falseThe purchase never completed and its money is still held. Buy again with the same client_reference: that releases the held money first.
in_progressStill running. Check again shortly.
json
{
  "success": true,
  "message": "Voucher purchase failed and has been refunded",
  "data": {
    "status": "failed",
    "refunded": true
  }
}
Statuserror_codeWhen
404PURCHASE_NOT_FOUNDNo WiFi purchase of yours matches this reference.

How client_reference differs from reference ​

client_reference (WiFi)reference (airtime, bundles, vouchers, ZESA, DStv)
Characters6 to 64: letters, digits, -, _Up to 120: letters, digits, :, ., _, -
Repeat after successReturns the same vouchers, with replayed: true.Returns the same answer.
Repeat after failureStarts a new attempt.Returns the same failure. Use a new reference.
Repeat while running409 PURCHASE_IN_PROGRESS202 OUTCOME_UNKNOWN
Different details409 IDEMPOTENCY_CONFLICT409 REFERENCE_CONFLICT
Status lookupGET /api/v1/wifi/vouchers/purchases/{reference}GET /api/v1/transactions/status