Overview
The Airtime service provides endpoints for sending airtime to phone numbers and handling validation and status callbacks through Africa’s Talking Airtime API.GET /airtime/
Check Airtime service status.Response
Service name (“airtime”)
Service status (“ready”)
Example Request
Example Response
GET /airtime/invoke-send-airtime
Send airtime to a phone number.Query Parameters
Phone number to send airtime to (without the + prefix, e.g., 254711XXXYYY)
Amount of airtime to send (must be a positive number)
Currency code (e.g., KES, USD, UGX)
Idempotency key to prevent duplicate transactions
Response
Success message indicating airtime was sent
Response object from Africa’s Talking API
Example Request
Example Response
Error Codes
- 400 - Missing ‘phone’ query parameter, invalid amount (must be positive number)
- 500 - Internal server error or Africa’s Talking API error
POST /airtime/validation
Validation callback webhook for airtime transactions.Request Body (JSON)
Unique transaction ID
Phone number receiving airtime
Source IP address of the transaction
Currency code (e.g., KES, USD)
Amount of airtime being sent
Response
Validation status: “Validated” or “Failed”
Example Request
Example Response
Error Codes
- 400 - Missing required fields
POST /airtime/status
Status callback webhook for airtime delivery updates.Request Body (JSON)
Phone number that received airtime
Description of the delivery status
Delivery status (e.g., “Success”, “Failed”)
Request ID from the original airtime send request
Discount amount applied (e.g., “KES 0.6000”)
Total value sent (e.g., “KES 100.0000”)
Response
Returns “OK” with status 200.Example Request
Example Response
Status Values
Common status values:- Success - Airtime delivered successfully
- Failed - Airtime delivery failed
- Sent - Airtime has been sent to the network
- Queued - Transaction is queued for processing
- InvalidRequest - Request was invalid
- NotSupported - Operation not supported for this number
- InsufficientBalance - Insufficient balance in your account
- UserInInvalidState - User account is in invalid state
- UserNotFound - Phone number not found on network
Error Codes
- 400 - Missing required fields in request body
