Appearance
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
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | The price of one voucher, from the list. |
duration | integer | Yes | From the list. |
duration_in | string | Yes | From the list. |
data_limit | string | Yes | From the list. |
currency | string | Yes | USD. |
quantity | integer | Yes | How many vouchers. At least 1. |
client_reference | string | No, but send it | Your 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"
}
}| Field | Description |
|---|---|
vouchers | One object per voucher. pin is what the customer enters, with spaces added for reading. |
amount | The total charged. |
voucher_value | The price of one. |
client_reference | Your reference, or null. |
id | The Xash transaction id. You can also check the purchase with it. |
reference | A short receipt code. |
recharge_instructions | How 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
| Status | error_code | refunded | Meaning |
|---|---|---|---|
400 | none | You do not have enough balance to make this transaction. | |
409 | OUT_OF_STOCK | true | Not enough vouchers of this kind. Your balance was not debited. Try a lower quantity or another kind. |
409 | IDEMPOTENCY_CONFLICT | This client_reference was already used for a different purchase. | |
409 | PURCHASE_IN_PROGRESS | A purchase with this client_reference is still running. Check its status before trying again. | |
422 | LIMIT_PER_TRANSACTION, LIMIT_DAILY | A 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. | |
422 | VEND_FAILED | true | The purchase failed and the money was returned. |
422 | VEND_FAILED | false | The 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. |
404 | none | WiFi vouchers are not available. | |
422 | none | A 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.status | Other fields | Meaning |
|---|---|---|
success | The full purchase, as in the buy response, including vouchers. | Delivered. |
failed | "refunded": true | Failed and refunded. You can buy again with the same client_reference. |
failed | "refunded": false | The purchase never completed and its money is still held. Buy again with the same client_reference: that releases the held money first. |
in_progress | Still running. Check again shortly. |
json
{
"success": true,
"message": "Voucher purchase failed and has been refunded",
"data": {
"status": "failed",
"refunded": true
}
}| Status | error_code | When |
|---|---|---|
404 | PURCHASE_NOT_FOUND | No WiFi purchase of yours matches this reference. |
How client_reference differs from reference
client_reference (WiFi) | reference (airtime, bundles, vouchers, ZESA, DStv) | |
|---|---|---|
| Characters | 6 to 64: letters, digits, -, _ | Up to 120: letters, digits, :, ., _, - |
| Repeat after success | Returns the same vouchers, with replayed: true. | Returns the same answer. |
| Repeat after failure | Starts a new attempt. | Returns the same failure. Use a new reference. |
| Repeat while running | 409 PURCHASE_IN_PROGRESS | 202 OUTCOME_UNKNOWN |
| Different details | 409 IDEMPOTENCY_CONFLICT | 409 REFERENCE_CONFLICT |
| Status lookup | GET /api/v1/wifi/vouchers/purchases/{reference} | GET /api/v1/transactions/status |