Appearance
Airtime
There are two ways to sell airtime.
| Direct airtime | Airtime vouchers | |
|---|---|---|
| What happens | The airtime is loaded onto the phone number you send. | You receive recharge PINs. The customer dials a code to load one. |
| Amounts | Any amount from 0.1. | Fixed values per network, unless the network allows custom amounts. |
| Safe to retry | Yes, with reference. | Yes, with reference. A repeat returns the same PINs. |
| Endpoint | POST /api/v1/airtime/direct | POST /api/v1/airtime/voucher/{carrier}/buy |
For a server integration, direct airtime with a reference is the one to build first.
Both accept an optional reference. Without one, a repeated request is a second purchase. See References and safe retries.
The steps
- List the networks to see which ones offer direct airtime and vouchers, and their ids.
- For vouchers, list the values a network sells.
- Buy: direct airtime or vouchers.
Commission
Each successful purchase returns a commission such as "USD0.06". It is held, then released into your balance on the date shown by GET /api/v1/wallet/{currency}. The rate per network is the commission percentage in the network list, unless Xash has agreed a different rate for your account.