Click Airtime

Send Airtime

Create a new airtime top-up transaction that deducts from your pre-funded wallet.

Send Airtime

Create a new airtime top-up. The cost is deducted from your pre-funded wallet and the airtime (or bundle) is delivered to the recipient's phone number.

POST /v2/topups

Permission required: airtime.write

This call is synchronous. POST /v2/topups waits for the operator to confirm delivery and returns the final result: a 201 response with status: "completed", or an error response (for example DELIVERY_FAILED). There is nothing to poll. To re-check a transaction later, call GET /v2/topups/:id or search by your reference with GET /v2/topups?reference=....

Headers

HeaderRequiredDescription
AuthorizationYesBearer ce_live_…
Content-TypeYesapplication/json
Idempotency-KeyNoCaller-provided idempotency key (1-255 characters; empty or longer values return 400 INVALID_REQUEST). Repeating a request with the same key within 24 hours returns the original result without charging your wallet again. Strongly recommended for production integrations — use a new UUID per logical top-up, and send the same key when you retry it. If omitted, the API falls back to a body-derived duplicate-prevention check with a 5-minute window.

Request Body

FieldTypeRequiredDescription
phone_numberstringYesRecipient phone number in E.164 format (+ followed by digits, e.g. +233541112259)
network_idintegerYesNetwork ID from the catalog (e.g. 11 for MTN Ghana)
amountobjectConditionalCustom airtime amount. Send either amount or product_id.
amount.valuenumberYes (with amount)Positive amount in the destination's local currency. Must be between the network's custom_airtime.min_amount_local and custom_airtime.max_amount_local from the catalog.
amount.currencystringYes (with amount)The destination's local currency code exactly as returned by the catalog in custom_airtime.local_currency (e.g. GHS)
product_idintegerConditionalThe id of an entry in fixed_bundles from the catalog for this network (e.g. 4264). Send either amount or product_id.
smsobjectNoSMS notification settings
sms.enabledbooleanNoSend an SMS to the recipient (default: false)
sms.messagestringNoCustom SMS message
referencestringNoYour own reference for this transaction. Can be used to search history with GET /v2/topups?reference=....
metadataobjectNoCustom key-value pairs stored with the transaction
wallet_modestringNoWhich wallet to debit. auto (default), global (force USD wallet), or local (force destination-country local-currency wallet).

amount or product_id — exactly one.

  • Sending both returns 400 INVALID_REQUEST. Sending neither returns 400 MISSING_REQUIRED_FIELD.
  • product_id must be an integer id from fixed_bundles for the same network_id. Strings, unknown or inactive ids, ids belonging to another network, and open-range products return 400 INVALID_PRODUCT.
  • A custom amount outside the network's min_amount_local..max_amount_local, in a currency other than the network's local_currency, or on a network whose catalog shows custom_airtime.available: false (fixed bundles only — use product_id) returns 400 INVALID_AMOUNT.
  • An unknown network_id returns 404 NETWORK_NOT_FOUND.

Wallet selection. Omit wallet_mode (or set it to auto) and the API picks the best wallet for the destination. Set global to always pay from your USD wallet, or local to use a destination-country local wallet (returns WALLET_TYPE_UNAVAILABLE if you don't have one for that country). Geography rules still apply: a Zambia (ZMW) wallet can't pay for a Malawi top-up regardless of wallet_mode.

Timeouts and Retries

A top-up call usually completes in a few seconds but can take up to about 15 seconds while the operator confirms delivery. Set your HTTP client timeout to at least 30 seconds.

If a call times out or the connection drops, you don't know whether the top-up was delivered. Do one of the following — never send the request again with a new key:

  1. Retry with the same Idempotency-Key. If the original request already went through, you receive the original result and your wallet is not charged again.
  2. Or look it up first with GET /v2/topups?reference=<your reference> and only send a new top-up if nothing is found.

If you retry while the original request is still being processed, you get 409 DUPLICATE_REQUEST — nothing is sent twice. Wait a few seconds and retry with the same key again (or look it up by reference).

Example: Custom Amount

curl -X POST "https://api.clickairtime.com/v2/topups" \
  --max-time 30 \
  -H "Authorization: Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: dc331c03-8acf-4766-8bf1-5da625683d52" \
  -d '{
    "phone_number": "+233541112259",
    "network_id": 11,
    "amount": {
      "value": 1,
      "currency": "GHS"
    },
    "reference": "invoice-12345",
    "metadata": {
      "customer_id": "cust_001"
    }
  }'
const response = await fetch('https://api.clickairtime.com/v2/topups', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json',
    'Idempotency-Key': 'dc331c03-8acf-4766-8bf1-5da625683d52',
  },
  body: JSON.stringify({
    phone_number: '+233541112259',
    network_id: 11,
    amount: { value: 1, currency: 'GHS' },
    reference: 'invoice-12345',
    metadata: { customer_id: 'cust_001' },
  }),
  signal: AbortSignal.timeout(30000), // at least 30 seconds
});
const data = await response.json();
import requests

response = requests.post(
    'https://api.clickairtime.com/v2/topups',
    headers={
        'Authorization': 'Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        'Content-Type': 'application/json',
        'Idempotency-Key': 'dc331c03-8acf-4766-8bf1-5da625683d52',
    },
    json={
        'phone_number': '+233541112259',
        'network_id': 11,
        'amount': {'value': 1, 'currency': 'GHS'},
        'reference': 'invoice-12345',
        'metadata': {'customer_id': 'cust_001'},
    },
    timeout=30,  # at least 30 seconds
)
data = response.json()
$ch = curl_init('https://api.clickairtime.com/v2/topups');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        'Content-Type: application/json',
        'Idempotency-Key: dc331c03-8acf-4766-8bf1-5da625683d52',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'phone_number' => '+233541112259',
        'network_id' => 11,
        'amount' => ['value' => 1, 'currency' => 'GHS'],
        'reference' => 'invoice-12345',
        'metadata' => ['customer_id' => 'cust_001'],
    ]),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30, // at least 30 seconds
]);
$response = json_decode(curl_exec($ch));

Example Response (201 Created)

{
  "success": true,
  "data": {
    "id": "6683ace0-794c-48fe-936b-b0f543baa7af",
    "status": "completed",
    "phone_number": "+233541112259",
    "network": {
      "id": 11,
      "name": "MTN",
      "country": "Ghana",
      "country_code": "GH"
    },
    "amount": {
      "value": 1,
      "currency": "GHS"
    },
    "cost": {
      "value": 0.0886,
      "currency": "USD"
    },
    "wallet": {
      "id": "094a21a0-ec42-4fbb-8a0c-97084de27b2c",
      "type": "global",
      "currency": "USD",
      "strategy": "AUTO_PRIMARY"
    },
    "product_id": null,
    "product_name": null,
    "sms": {
      "enabled": false,
      "message": null
    },
    "reference": "invoice-12345",
    "provider_reference": "7688491163",
    "failure_reason": null,
    "metadata": {
      "customer_id": "cust_001"
    },
    "created_at": "2026-10-13T13:24:48.420Z",
    "completed_at": "2026-10-13T13:24:49.592Z"
  },
  "meta": {
    "request_id": "req_c937fe484e15",
    "timestamp": "2026-10-13T13:24:49.604Z"
  }
}

Response Fields

FieldTypeDescription
idstringUnique transaction ID (UUID). Use it with GET /v2/topups/:id.
statusstringFinal status. A 201 response is always completed; a failed delivery returns an error response instead.
phone_numberstringRecipient phone number
networkobjectNetwork the top-up was sent on (id, name, country, country_code)
amountobjectWhat was delivered to the recipient, in the destination's local currency (currency is an ISO code, e.g. GHS)
costobjectWhat was charged to your wallet, after your rate and discount, in the wallet's currency (cost.currency, e.g. USD). This is not necessarily USD — a top-up paid from a local-currency wallet is charged in that wallet's currency.
walletobject | nullThe wallet that was debited. id matches an entry from GET /v2/balance. type is global (USD wallet) or local. strategy describes how the wallet was selected (e.g. AUTO_PRIMARY, USD_EXPLICIT_SELECTION, LOCAL_EXPLICIT_SELECTION).
product_idinteger | nullThe fixed bundle id (when you sent product_id), otherwise null
product_namestring | nullThe fixed bundle name (when applicable)
smsobjectSMS notification settings (enabled, message)
referencestring | nullYour reference for this transaction
provider_referencestring | nullThe operator's reference / serial for the delivery. Quote it to the operator if the recipient disputes receiving the top-up.
failure_reasonstring | nullReason for failure (on failed transactions)
metadataobjectCustom metadata you attached
created_atstringISO 8601 creation timestamp
completed_atstring | nullISO 8601 completion timestamp

Example: Fixed Bundle

Pick a bundle from fixed_bundles in the catalog and send its integer id as product_id. Do not send amount.

curl -X POST "https://api.clickairtime.com/v2/topups" \
  --max-time 30 \
  -H "Authorization: Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 3f9b2c1e-6a47-4d0b-9e1f-0b6c2d8a7e55" \
  -d '{
    "phone_number": "+233541112259",
    "network_id": 11,
    "product_id": 4264
  }'

The response has the same shape as above, with product_id and product_name set to the bundle you bought and cost set to what your wallet was charged.

Transaction Statuses

POST /v2/topups only returns a transaction once it has reached a final state. When you list or re-check transactions, you may see:

StatusDescription
pendingTransaction created, awaiting processing
processingAirtime delivery in progress
completedSuccessfully delivered
failedDelivery failed (check failure_reason)

Common Errors

CodeHTTP StatusWhen
INVALID_PHONE_NUMBER400phone_number is missing or not E.164
MISSING_REQUIRED_FIELD400Neither amount nor product_id was sent
INVALID_REQUEST400Both amount and product_id were sent, or the Idempotency-Key header is empty or longer than 255 characters
INVALID_AMOUNT400Amount out of range, wrong currency, or custom amounts not available on this network
INVALID_PRODUCT400product_id is not an integer bundle id available on this network
NETWORK_NOT_FOUND404Unknown network_id
DUPLICATE_REQUEST409The same request (same Idempotency-Key, or without a key the same body within 5 minutes) is still being processed
INSUFFICIENT_BALANCE400Your wallet cannot cover the cost
DELIVERY_FAILED500The operator did not deliver the top-up

See Error Codes for the full list.