This section provides details about the Airtime API, including endpoints for direct airtime purchase and airtime voucher purchase.
Direct Airtime Purchase
Allows users to directly purchase airtime for a specified mobile number.
Purchase airtime directly for a specified mobile number.
POSThttps://domain.xash.co.zw/api/airtime/direct
Headers
Name
Type
Description
Authorization*
String
This endpoint requires a Firebase Bearer token for authorization. The token should be included in the Authorization header in the format Bearer {token}.
This endpoint provides a list of available airtime vouchers based on specified filters, including network, currency, and amount. The response includes details such as network, currency, value, and a distinct of unique voucher types.
Query Parameters
Name
Type
Description
network
String
Filter vouchers by network (e.g., "NetOne", "Econet", "Telecel").
currency
String
Filter vouchers by currency (e.g., "USD", "ZWL").
amount
Float
Filter vouchers by a specific amount.
min_amount
Float
Minimum value for filtering vouchers by amount (used optionally with max_amount).
max_amount
Float
Maximum value for filtering vouchers by amount (used optionally with min_amount).
Headers
Name
Type
Description
Authorization*
String
This endpoint requires a Firebase Bearer token for authorization. The token should be included in the Authorization header in the format Bearer {token}.
Airtime Voucher Purchase
This API allows users to purchase airtime vouchers.
This endpoint enables users to buy airtime vouchers based on the provided network, currency, quantity, and value. The operation performs a series of checks, including validating the input parameters, checking the user's balance, and processing the airtime purchase. Upon successful purchase, the API returns details of the purchased vouchers.
Headers
Name
Type
Description
Authorization*
String
This endpoint requires a Firebase Bearer token for authorization. The token should be included in the Authorization header in the format Bearer {token}.
Request Body
Name
Type
Description
network*
String
The network for which the vouchers are being purchased.
value*
Float
The value of each voucher (From list of vouchers above)
quantity*
Integer
The quantity of vouchers to be purchased (must be greater than or equal to 1).