Airtime, data and bill payment API documentation
One REST API for airtime and data on MTN, Airtel, Glo and 9mobile, electricity tokens on every DisCo, and DStv, GOtv and StarTimes renewals. JSON over HTTPS, one API key, amounts in kobo.
Quick facts
- Base URL:
https://api.airtimereport.com/api - Auth:
Authorization: Bearer <API key> - Amounts: kobo (₦100 =
10000) - Every sale takes your own unique
ref - Failed vends reverse to your wallet automatically
Getting started
Create an account
Register on the partner portal with your business name, CAC (RC) number and contact details. We review new accounts, usually within a day.
Get your API key
Once approved, create an API key in the portal. Keep it on your server, never in an app or web page.
Fund your wallet
Transfer to your dedicated virtual account. The wallet is credited automatically.
Make your first sale
Start with a small amount, check it by reference, then go live.
Authentication and conventions
API key
Send Authorization: Bearer <API key> on every request, with Content-Type: application/json on POSTs.
Amounts in kobo
All amounts are whole kobo: ₦50 is 5000, ₦1,000 is 100000.
Your reference
Send a unique ref with every sale. Reusing one is refused with 409, so a retry can never charge twice.
Timeouts
If a call times out, check /transaction-by-ref/{ref} before trying again.
Account and wallet
Check your wallet before a batch of sales, and see wallet top-ups.
| Method | Endpoint | What it does |
|---|---|---|
GET | /me/balance | Wallet balance (kobo) |
GET | /me/credit-history | Wallet top-ups |
POST | /me/generate-account-number | Create your dedicated virtual account for funding |
Airtime and data
Airtime and data bundles on MTN, Airtel, Glo and 9mobile. Network codes: mtn, airtel, glo, ninemobile. Get the bundle codes from /data-plan.
| Method | Endpoint | What it does |
|---|---|---|
POST | /airtime | Buy airtime |
GET | /data-plan | Data bundles and their codes |
POST | /data | Buy a data bundle |
# Buy ₦100 MTN airtime (amount in kobo)
curl -X POST https://api.airtimereport.com/api/airtime \
-H "Authorization: Bearer $TELEDEUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"msisdn": "08030000000",
"amount": 10000,
"network": "mtn",
"ref": "order-10293"
}'
# Data: same call on /data with a bundle code instead of an amount
# {"msisdn": "08030000000", "network": "mtn", "bundle_code": "M020010", "ref": "order-10294"}Electricity tokens and postpaid bills
Every DisCo, prepaid and postpaid. Verify the meter first and show the customer the name returned, then vend with the details from the verification.
| Method | Endpoint | What it does |
|---|---|---|
GET | /bills/electricity/billers | DisCos and their biller codes |
POST | /bills/electricity/verify | Check a meter number; returns the customer name and address |
POST | /bills/electricity/vend | Pay; returns the token for prepaid meters |
# Verify a prepaid meter, then pay ₦1,000
curl -X POST https://api.airtimereport.com/api/bills/electricity/verify \
-H "Authorization: Bearer $TELEDEUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"biller": "AEDC_PREPAID", "meter": "45700000000", "product": "Prepaid", "amount": 100000}'
curl -X POST https://api.airtimereport.com/api/bills/electricity/vend \
-H "Authorization: Bearer $TELEDEUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"biller": "AEDC_PREPAID",
"meter": "45700000000",
"product": "Prepaid",
"amount": 100000,
"name": "<beneficiary_name from verify>",
"address": "<beneficiary_details from verify>",
"ref": "power-55120"
}'Cable TV: DStv, GOtv and StarTimes
List the bouquets, verify the smartcard number, then renew with the product code.
| Method | Endpoint | What it does |
|---|---|---|
GET | /bills/cable/billers | Cable TV providers |
GET | /bills/cable/biller-products?biller=GOTV | Bouquets and their product codes |
POST | /bills/cable/verify | Check a smartcard number; returns the customer name |
POST | /bills/cable/vend | Renew the bouquet |
# Renew a GOtv bouquet
curl -X POST https://api.airtimereport.com/api/bills/cable/vend \
-H "Authorization: Bearer $TELEDEUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"biller": "GOTV",
"number": "8070000000",
"product": "<product code from biller-products>",
"name": "<beneficiary_name from verify>",
"address": "<beneficiary_details from verify>",
"ref": "tv-88412"
}'Status, history and reports
Look up any sale by your own reference: if your request timed out, check before you try again.
| Method | Endpoint | What it does |
|---|---|---|
GET | /transaction-by-ref/{ref} | A sale by your reference |
GET | /transaction/{transaction_id} | A sale by Teledeus transaction ID |
GET | /history?msisdn=&ref=&page= | Your sales, newest first |
GET | /reversal-history?page= | Sales reversed to your wallet |
GET | /availability/{service} | Whether a network or service is up before you route a sale |
# Check a sale by your reference
curl https://api.airtimereport.com/api/transaction-by-ref/order-10293 \
-H "Authorization: Bearer $TELEDEUS_API_KEY"Responses and status values
Every sale answers with a status, a message and the sale in data. Decide on status, not on the HTTP code alone.
# Example airtime response (fields abridged)
{
"status": "Successful",
"status_code": "00",
"message": "Transaction Successful",
"data": {
"transaction_id": "3774504967720407040",
"external_ref": "order-10293",
"msisdn": "08030000000",
"network": "mtn",
"amount": 10000,
"status": "Successful"
}
}| status | status_code | Meaning |
|---|---|---|
Successful | 00 | Delivered to the customer. |
Pending / Processing | 06 | Sent to the network, final answer not yet in. Check by reference; do not resend. |
Failed | 01 | Not delivered. The amount is reversed to your wallet. |
InvalidMsisdn | 02 | The phone number is not valid for that network. Reversed to your wallet. |
InvalidAmount | 03 | The amount is not accepted. Nothing is charged. |
InsufficientBalance | 08 | Your wallet does not cover the sale. Nothing is charged. |
InvalidTelco | 09 | The network code is not accepted. Nothing is charged. |
HTTP codes
| Code | Meaning |
|---|---|
200 | Accepted. Read status in the body for the outcome. |
400 | The request is missing a field or has an invalid value (message explains which). |
401 | Missing or wrong API key. |
402 | Insufficient wallet balance. |
409 | Duplicate reference: a sale with this ref already exists. Check it by reference instead of resending. |
Full reference and tools
PDF guides
The full partner API reference, the service availability API and the bulk airtime guide.
Download from the partner portal