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
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer ce_live_… |
Content-Type | Yes | application/json |
Idempotency-Key | No | Caller-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
| Field | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes | Recipient phone number in E.164 format (+ followed by digits, e.g. +233541112259) |
network_id | integer | Yes | Network ID from the catalog (e.g. 11 for MTN Ghana) |
amount | object | Conditional | Custom airtime amount. Send either amount or product_id. |
amount.value | number | Yes (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.currency | string | Yes (with amount) | The destination's local currency code exactly as returned by the catalog in custom_airtime.local_currency (e.g. GHS) |
product_id | integer | Conditional | The id of an entry in fixed_bundles from the catalog for this network (e.g. 4264). Send either amount or product_id. |
sms | object | No | SMS notification settings |
sms.enabled | boolean | No | Send an SMS to the recipient (default: false) |
sms.message | string | No | Custom SMS message |
reference | string | No | Your own reference for this transaction. Can be used to search history with GET /v2/topups?reference=.... |
metadata | object | No | Custom key-value pairs stored with the transaction |
wallet_mode | string | No | Which 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 returns400 MISSING_REQUIRED_FIELD. product_idmust be an integeridfromfixed_bundlesfor the samenetwork_id. Strings, unknown or inactive ids, ids belonging to another network, and open-range products return400 INVALID_PRODUCT.- A custom
amountoutside the network'smin_amount_local..max_amount_local, in a currency other than the network'slocal_currency, or on a network whose catalog showscustom_airtime.available: false(fixed bundles only — useproduct_id) returns400 INVALID_AMOUNT. - An unknown
network_idreturns404 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:
- 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. - 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
| Field | Type | Description |
|---|---|---|
id | string | Unique transaction ID (UUID). Use it with GET /v2/topups/:id. |
status | string | Final status. A 201 response is always completed; a failed delivery returns an error response instead. |
phone_number | string | Recipient phone number |
network | object | Network the top-up was sent on (id, name, country, country_code) |
amount | object | What was delivered to the recipient, in the destination's local currency (currency is an ISO code, e.g. GHS) |
cost | object | What 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. |
wallet | object | null | The 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_id | integer | null | The fixed bundle id (when you sent product_id), otherwise null |
product_name | string | null | The fixed bundle name (when applicable) |
sms | object | SMS notification settings (enabled, message) |
reference | string | null | Your reference for this transaction |
provider_reference | string | null | The operator's reference / serial for the delivery. Quote it to the operator if the recipient disputes receiving the top-up. |
failure_reason | string | null | Reason for failure (on failed transactions) |
metadata | object | Custom metadata you attached |
created_at | string | ISO 8601 creation timestamp |
completed_at | string | null | ISO 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:
| Status | Description |
|---|---|
pending | Transaction created, awaiting processing |
processing | Airtime delivery in progress |
completed | Successfully delivered |
failed | Delivery failed (check failure_reason) |
Common Errors
| Code | HTTP Status | When |
|---|---|---|
INVALID_PHONE_NUMBER | 400 | phone_number is missing or not E.164 |
MISSING_REQUIRED_FIELD | 400 | Neither amount nor product_id was sent |
INVALID_REQUEST | 400 | Both amount and product_id were sent, or the Idempotency-Key header is empty or longer than 255 characters |
INVALID_AMOUNT | 400 | Amount out of range, wrong currency, or custom amounts not available on this network |
INVALID_PRODUCT | 400 | product_id is not an integer bundle id available on this network |
NETWORK_NOT_FOUND | 404 | Unknown network_id |
DUPLICATE_REQUEST | 409 | The same request (same Idempotency-Key, or without a key the same body within 5 minutes) is still being processed |
INSUFFICIENT_BALANCE | 400 | Your wallet cannot cover the cost |
DELIVERY_FAILED | 500 | The operator did not deliver the top-up |
See Error Codes for the full list.
