Developer Resources

Airtimly API documentation

Integrate Airtimly services into your application using your developer API key. Keep your key private and check transaction status before retrying a purchase.

Manage API keys

API reference

Browse each service below. Every endpoint has its own explanation and, where provided in the API reference, a separate cURL or JSON example.

Getting started

AIRTIMLY API DOCUMENTATION

Base URL: https://airtimly.co/api
Format: JSON requests and JSON responses
API keys: generate and manage keys from Settings > Developer API

AUTHENTICATION

Send your key in the Authorization header on EVERY request:

Example
Authorization: Token YOUR_API_KEY
    Content-Type: application/json

Missing or wrong key (HTTP 401):

JSON example
{
      "status": false,
      "message": "Invalid or revoked API token."
    }

Notes
- Your key can be locked to specific server IPs. Ask the admin.
- Limit: 120 requests per minute per key (HTTP 429 when exceeded).
- Phone numbers: 08012345678 and 2348012345678 are both accepted.

NETWORK IDS

Example
1 = MTN
    2 = GLO
    3 = 9MOBILE
    4 = AIRTEL

Plan ids, cable provider/plan ids, disco ids and meter type ids come from the
GET endpoints below. Always use the "id" values they return.

USER

GET /api/user

cURL request
curl --location 'https://airtimly.co/api/user' \
    --header 'Authorization: Token YOUR_API_KEY' \
    --header 'Content-Type: application/json'

Response (HTTP 200):

JSON example
{
      "status": true,
      "message": "Okay",
      "user": {
        "id": 12,
        "name": "John Doe",
        "email": "john@mail.com",
        "phone": "08012345678",
        "balance": 5000
      }
    }

DATA

GET PLANS

Example
GET /api/data
     GET /api/data?network=1          (one network only)

Response (HTTP 200):

JSON example
{
      "status": true,
      "networks": [
        {
          "id": 1,
          "name": "MTN",
          "plans": [
            { "id": "PLAN_CODE", "name": "1GB SME (30 Days)", "amount": 250 },
            { "id": "PLAN_CODE_2", "name": "2GB SME (30 Days)", "amount": 500 }
          ]
        },
        { "id": 2, "name": "GLO", "plans": [ ... ] },
        { "id": 3, "name": "9MOBILE", "plans": [ ... ] },
        { "id": 4, "name": "AIRTEL", "plans": [ ... ] }
      ]
    }

The plan "id" is the value you send as "plan" when buying.

BUY DATA

Example
POST /api/data
cURL request
curl --location 'https://airtimly.co/api/data' \
    --header 'Authorization: Token YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "network": 1,
      "mobile_number": "08012345678",
      "plan": "PLAN_CODE",
      "Ported_number": true
    }'

Success (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Data Purchase Successful.",
      "response": "MTN 1GB SME (30 Days) sent to 08012345678",
      "api_response": "MTN 1GB SME (30 Days) sent to 08012345678",
      "request-id": "API_66bbd45c67b7b",
      "service": "data",
      "amount": "250",
      "old_balance": 5000,
      "new_balance": 4750
    }

CHECK A DATA PURCHASE

Example
GET /api/data?request-id=API_66bbd45c67b7b

Response (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Transaction successful.",
      "response": "MTN 1GB SME (30 Days) to 08012345678",
      "api_response": "MTN 1GB SME (30 Days) to 08012345678",
      "request-id": "API_66bbd45c67b7b",
      "service": "data",
      "amount": "250",
      "created_at": "2026-10-16 10:21:05"
    }

status here can be "success", "processing" or "fail".
Unknown id (HTTP 404):

JSON example
{
      "status": "fail",
      "Status": "failed",
      "message": "Transaction not found.",
      "request-id": "API_unknown"
    }

AIRTIME

NETWORKS

Example
GET /api/topup

Response (HTTP 200):

JSON example
{
      "status": true,
      "networks": [
        { "id": 1, "name": "MTN" },
        { "id": 2, "name": "GLO" },
        { "id": 3, "name": "9MOBILE" },
        { "id": 4, "name": "AIRTEL" }
      ],
      "airtime_types": ["VTU"],
      "min_amount": 50
    }

BUY AIRTIME (minimum 50, VTU only)

Example
POST /api/topup
cURL request
curl --location 'https://airtimly.co/api/topup' \
    --header 'Authorization: Token YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "network": 1,
      "amount": 100,
      "mobile_number": "08012345678",
      "Ported_number": true,
      "airtime_type": "VTU"
    }'

Success (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Airtime Purchase Successful.",
      "response": "₦100 MTN airtime sent to 08012345678",
      "api_response": "₦100 MTN airtime sent to 08012345678",
      "request-id": "API_66bbd45c67b8c",
      "service": "airtime",
      "amount": "100",
      "old_balance": 4750,
      "new_balance": 4650
    }

CHECK AN AIRTIME PURCHASE

Example
GET /api/topup?request-id=API_66bbd45c67b8c

Response (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Transaction successful.",
      "response": "₦100 MTN airtime to 08012345678",
      "api_response": "₦100 MTN airtime to 08012345678",
      "request-id": "API_66bbd45c67b8c",
      "service": "airtime",
      "amount": "100",
      "created_at": "2026-10-16 10:25:41"
    }

CABLE TV

PROVIDERS AND PLANS

Example
GET /api/cablesub

Response (HTTP 200):

JSON example
{
      "status": true,
      "providers": [
        {
          "id": "DSTV",
          "name": "DStv",
          "plans": [
            { "id": "PLAN_CODE", "name": "Compact", "amount": 15700 },
            { "id": "PLAN_CODE_2", "name": "Padi", "amount": 4400 }
          ]
        },
        { "id": "GOTV", "name": "GOtv", "plans": [ ... ] }
      ]
    }

"cablename" = provider id, "cableplan" = plan id (both from this list).

VALIDATE SMARTCARD (recommended before buying)

Example
GET /api/validateiuc?cablename=DSTV&cableplan=PLAN_CODE&smart_card_number=1234567890

Response (HTTP 200):

JSON example
{
      "status": true,
      "message": "Okay",
      "customer_name": "JOHN DOE",
      "smart_card_number": "1234567890",
      "provider": "DStv",
      "plan": "Compact",
      "amount": 15700
    }

Invalid card (HTTP 400):

JSON example
{
      "status": false,
      "message": "We could not verify that smartcard number."
    }

SUBSCRIBE

Example
POST /api/cablesub
cURL request
curl --location 'https://airtimly.co/api/cablesub' \
    --header 'Authorization: Token YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "cablename": "DSTV",
      "cableplan": "PLAN_CODE",
      "smart_card_number": "1234567890"
    }'

Success (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Cable Subscription Successful.",
      "response": "DStv Compact subscription for JOHN DOE (1234567890)",
      "api_response": "DStv Compact subscription for JOHN DOE (1234567890)",
      "request-id": "API_66bbd45c67b9d",
      "service": "cable",
      "amount": "15700",
      "old_balance": 50000,
      "new_balance": 34300,
      "customer_name": "JOHN DOE",
      "smart_card_number": "1234567890"
    }

CHECK A CABLE PURCHASE

Example
GET /api/cablesub?request-id=API_66bbd45c67b9d

Response (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Transaction successful.",
      "response": "DStv Compact subscription for 1234567890",
      "api_response": "DStv Compact subscription for 1234567890",
      "request-id": "API_66bbd45c67b9d",
      "service": "cable",
      "amount": "15700",
      "created_at": "2026-10-16 10:30:12"
    }

ELECTRICITY

DISCOS AND METER TYPES

Example
GET /api/billpayment

Response (HTTP 200):

JSON example
{
      "status": true,
      "min_amount": 500,
      "max_amount": 500000,
      "discos": [
        {
          "id": "DISCO_CODE",
          "name": "Ikeja Electric",
          "meter_types": [
            { "id": "METER_TYPE_CODE", "name": "Prepaid" },
            { "id": "METER_TYPE_CODE_2", "name": "Postpaid" }
          ]
        }
      ]
    }

"disco_name" = disco id, "MeterType" = meter type id (both from this list).
For MeterType you may also send 1 (prepaid) or 2 (postpaid).

VALIDATE METER (recommended before paying)

Example
GET /api/validatemeter?disco_name=DISCO_CODE&MeterType=METER_TYPE_CODE&meter_number=1234567890

Response (HTTP 200):

JSON example
{
      "status": true,
      "message": "Okay",
      "customer_name": "JOHN DOE",
      "meter_number": "1234567890",
      "disco": "Ikeja Electric",
      "meter_type": "Prepaid"
    }

Invalid meter (HTTP 400):

JSON example
{
      "status": false,
      "message": "We could not verify that meter number."
    }

PAY ELECTRICITY (amount 500 - 500,000)

Example
POST /api/billpayment
cURL request
curl --location 'https://airtimly.co/api/billpayment' \
    --header 'Authorization: Token YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "disco_name": "DISCO_CODE",
      "MeterType": "METER_TYPE_CODE",
      "meter_number": "1234567890",
      "amount": 2000
    }'

Success (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Electricity Purchase Successful.",
      "response": "Ikeja Electric electricity for JOHN DOE (1234567890)",
      "api_response": "Ikeja Electric electricity for JOHN DOE (1234567890)",
      "request-id": "API_66bbd45c67bae",
      "service": "electricity",
      "amount": "2000",
      "old_balance": 34300,
      "new_balance": 32300,
      "token": "5271 8659 3341 7720 1182",
      "details": null,
      "customer_name": "JOHN DOE",
      "meter_number": "1234567890"
    }

"token" is the prepaid token. If no token could be read from the provider's
message, "token" is null and "details" carries the provider's message.

CHECK AN ELECTRICITY PURCHASE

Example
GET /api/billpayment?request-id=API_66bbd45c67bae

Response (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Transaction successful.",
      "response": "Ikeja Electric electricity for meter 1234567890 - Token: 5271 8659 3341 7720 1182",
      "api_response": "Ikeja Electric electricity for meter 1234567890 - Token: 5271 8659 3341 7720 1182",
      "request-id": "API_66bbd45c67bae",
      "service": "electricity",
      "amount": "2000",
      "created_at": "2026-10-16 10:35:50"
    }

VIRTUAL CARDS (USD)

Creating a card needs identity and address verification completed in the app.
Card top-up and withdrawal amounts are in USD ($1 to $1,000). The "amount"
field in the response is the NAIRA charged to (or credited to) your wallet.

LIST CARDS AND PRICING

Example
GET /api/card

Response (HTTP 200):

JSON example
{
      "status": true,
      "message": "Okay",
      "ready": true,
      "pricing": {
        "creation_usd": 3,
        "creation_ngn": 5400,
        "rate": 1800,
        "topup_fee_percent": 2,
        "withdraw_rate": 1500
      },
      "cards": [
        {
          "id": 7,
          "status": "active",
          "name": "JOHN DOE",
          "brand": "visa",
          "type": "virtual",
          "last4": "4821",
          "masked_number": "**** **** **** 4821",
          "expiry": "09/29",
          "balance_usd": 10,
          "created_at": "2026-10-10 09:12:44"
        }
      ]
    }

"ready" is false until KYC is complete.
Card status values: pending, active, frozen, failed.

CARD DETAILS (live number, expiry, CVV)

Example
GET /api/card/7

Response (HTTP 200):

JSON example
{
      "status": true,
      "message": "Okay",
      "card": {
        "id": 7,
        "status": "active",
        "name": "JOHN DOE",
        "brand": "visa",
        "type": "virtual",
        "last4": "4821",
        "masked_number": "**** **** **** 4821",
        "expiry": "09/29",
        "balance_usd": 10,
        "created_at": "2026-10-10 09:12:44",
        "number": "4111 1111 1111 4821",
        "cvv": "123",
        "billing": {
          "street": "12 Example Street",
          "city": "Lagos",
          "zip": "100001",
          "country": "NG"
        }
      }
    }

Keep the number and CVV private. Not available (HTTP 404):

Example
{ "status": false, "message": "Card not available." }

CARD TRANSACTIONS

Example
GET /api/card/7/transactions

Response (HTTP 200):

JSON example
{
      "status": true,
      "message": "Okay",
      "transactions": [
        { "...": "latest 30 card transactions as returned by the card provider" }
      ]
    }

CREATE A CARD

Example
POST /api/card        (no body needed; "ref" optional)
cURL request
curl --location 'https://airtimly.co/api/card' \
    --header 'Authorization: Token YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{ "ref": "my-unique-id-1" }'

Accepted (HTTP 202):

JSON example
{
      "status": "processing",
      "Status": "processing",
      "message": "Your card is being created. Check GET /api/card until its status is active.",
      "response": "Your card is being created. Check GET /api/card until its status is active.",
      "api_response": "Your card is being created. Check GET /api/card until its status is active.",
      "request-id": "CRD261016103512A1B2C3D4",
      "service": "card",
      "amount": "5400",
      "old_balance": 20000,
      "new_balance": 14600,
      "card_id": 8
    }

Failed (HTTP 400, wallet refunded):

JSON example
{
      "status": "fail",
      "Status": "failed",
      "message": "Card creation failed. Your wallet has been refunded.",
      "response": "Provider reason here",
      "api_response": "Provider reason here",
      "request-id": "CRD261016103512A1B2C3D4",
      "service": "card",
      "amount": "5400",
      "old_balance": 20000,
      "new_balance": 20000
    }

KYC missing (HTTP 403):

JSON example
{
      "status": "fail",
      "Status": "failed",
      "message": "Card access needs identity and address verification. Complete KYC in the app first."
    }

TOP UP A CARD

Example
POST /api/card/topup
Example
--data '{ "card_id": 7, "amount": 10 }'

Success (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Card Top-up Successful.",
      "response": "Card topped up with $10.00",
      "api_response": "Card topped up with $10.00",
      "request-id": "TUP261016104001E5F6A7B8",
      "service": "card_topup",
      "amount": "18360",
      "old_balance": 50000,
      "new_balance": 31640,
      "card_id": 7,
      "amount_usd": 10,
      "fee_usd": 0.2
    }

Failed (HTTP 400, wallet refunded):

JSON example
{
      "status": "fail",
      "Status": "failed",
      "message": "Card top-up failed. Your wallet has been refunded.",
      "response": "Provider reason here",
      "api_response": "Provider reason here",
      "request-id": "TUP261016104001E5F6A7B8",
      "service": "card_topup",
      "amount": "18360",
      "old_balance": 50000,
      "new_balance": 50000
    }

WITHDRAW FROM A CARD TO YOUR WALLET

Example
POST /api/card/withdraw
Example
--data '{ "card_id": 7, "amount": 5 }'

At least $2 must always stay on the card.

Success (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Card Withdrawal Successful.",
      "response": "Withdrew $5.00 from your card to your wallet",
      "api_response": "Withdrew $5.00 from your card to your wallet",
      "request-id": "WDR261016104512C9D0E1F2",
      "service": "card_withdraw",
      "amount": "7500",
      "old_balance": 31640,
      "new_balance": 39140,
      "card_id": 7,
      "amount_usd": 5
    }

Too much (HTTP 400):

JSON example
{
      "status": "fail",
      "Status": "failed",
      "message": "You must leave at least $2.00 on your card. Maximum withdrawal: $8.00."
    }

FREEZE / UNFREEZE A CARD

Example
POST /api/card/freeze
Example
--data '{ "card_id": 7, "mode": "freeze" }'        ("freeze" or "unfreeze")

Response (HTTP 200):

JSON example
{
      "status": "success",
      "Status": "successful",
      "message": "Card frozen. Payments will be declined until you unfreeze it.",
      "service": "card_freeze",
      "card_id": 7,
      "card_status": "frozen"
    }

On unfreeze, message is "Card is active again." and card_status is "active".

ERRORS

POST requests return:

JSON example
{
      "status": "fail",
      "Status": "failed",
      "message": "What went wrong"
    }

GET requests return:

JSON example
{
      "status": false,
      "message": "What went wrong"
    }

Common errors

Example
Insufficient wallet balance (HTTP 402)
      "Insufficient wallet balance. Please fund your wallet and try again."
Example
Invalid network (HTTP 400)
      "Invalid network. Use 1 = MTN, 2 = GLO, 3 = 9MOBILE, 4 = AIRTEL."
Example
Invalid phone (HTTP 400)
      "Enter a valid 11-digit mobile_number starting with 0, e.g. 08012345678."
Example
Airtime below minimum (HTTP 400)
      "Minimum airtime amount is ₦50."
Example
Plan not found (HTTP 400)
      "That plan is not available for this network. Get plan ids from GET /api/data."
Example
Duplicate ref (HTTP 409)
      "Duplicate request: this ref was already used. Check the transaction status before retrying."
Example
Daily limit reached (HTTP 403)
      the message says the limit that was reached.
Example
IP not allowed (HTTP 403)
      "This IP address is not allowed for this API key."
Example
Account inactive (HTTP 403)
      "This account is not active."
Example
Too many requests (HTTP 429)
      "Too many requests. Slow down and try again shortly."
Example
Server error (HTTP 500)
      "Something went wrong on our side. If you were charged, it is refunded automatically."

HTTP STATUS CODES

Example
200  Success
    202  Processing (wallet charged, check with request-id)
    400  Invalid input, or the purchase failed and was refunded
    401  Missing or invalid token
    402  Insufficient wallet balance
    403  IP not allowed, account inactive, daily limit, or KYC needed
    404  Not found
    409  Duplicate ref
    429  Too many requests
    500  Server error

GIFT CARDS

LIST AVAILABLE GIFT CARDS AND OPTIONS

Example
GET /api/gift-cards

Returns active gift cards, available countries, supported face values, and
the NGN rate used by the application. Use the returned card_id and country_id
values when purchasing.

PURCHASE A GIFT CARD

Example
POST /api/gift-cards

Headers:

Example
Authorization: Token YOUR_API_KEY
    Content-Type: application/json

Example body:

JSON example
{
      "card_id": 1,
      "country_id": 1,
      "amount": 25,
      "ref": "your-unique-giftcard-reference"
    }

The amount is the gift card face value in the currency listed for that country.
The user's Airtimly wallet is charged the calculated NGN price. Orders are
created as pending and fulfilled through the gift-card fulfilment workflow.

A processing response includes request-id, service="gift_card", amount,
old_balance, and new_balance. Do not retry a processing purchase. Check it
using GET /api/gift-cards?request-id=REQUEST_ID.

CHECK GIFT CARD PURCHASE STATUS

Example
GET /api/gift-cards?request-id=REQUEST_ID

Status is success when delivered, processing while awaiting fulfilment, and
fail if rejected/refunded. The response is scoped to the authenticated user.

Use a unique ref for every purchase. A duplicate ref is rejected with HTTP 409.

Simplify your payments
with Airtimly