Airtime
Send airtime to Kenyan mobile numbers using your Galatext airtime balance. These endpoints require a bearer JWT; an API key alone is not accepted.
| Method | Path | Purpose |
|---|---|---|
GET | /api/airtime/networks | List available network IDs and names |
GET | /api/airtime/balance | Get your airtime balance |
GET | /api/airtime/transactions | Get recent airtime transactions |
POST | /api/airtime/purchase | Top up one or more recipients |
Check networks and balance
const networks = await client.airtime.networks();
const { balance } = await client.airtime.balance();The current network IDs are safaricom, airtel, telkom, and faiba. Use the network list returned by the API when building a selector. Each purchase specifies one network.
Send airtime
const result = await client.airtime.purchase({
network: 'safaricom',
recipients: [
{ recipient: '254712345678', amount: 100 },
{ recipient: '254798765432', amount: 50 },
],
});For a single recipient, the endpoint also accepts:
{
"network": "safaricom",
"phone_number": "254712345678",
"amount": 100
}Amounts are in KES. A purchase sends actual airtime and consumes your airtime balance. Review the result for each recipient; do not treat HTTP 200 alone as confirmation of every top-up. After a timeout, check transactions before repeating a purchase because this endpoint does not accept an idempotency key.
Fund the airtime balance
Purchasing airtime credit and topping up a phone are separate operations:
// This account method uses the developer API key.
const payment = await client.account.buyCredits('airtime', null, 1000);
// Complete checkout at payment.authorizationUrl, then verify the payment.
await client.account.verifyPayment(payment.reference);
// This method uses the bearer token.
const transactions = await client.airtime.transactions();Pass both credentials when one client needs to fund the balance and send airtime. Verify only after checkout has completed.