Quick Start
Send your first airtime top-up in under 5 minutes with the Click Airtime V2 API.
Quick Start
Send your first airtime top-up in under 5 minutes.
Prerequisites
- A Click Airtime enterprise account
- An API key from the Enterprise Portal
Get Your API Key
Log in to the Enterprise Portal, go to Settings → API Keys, and generate a new key. Your key will look like:
ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxCopy your key immediately — it won't be shown again.
Look Up Products
Use the catalog endpoint to find available products for a phone number:
curl -X GET "https://api.clickairtime.com/v2/catalog/lookup?phone_number=%2B233541112259" \
-H "Authorization: Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"const response = await fetch(
'https://api.clickairtime.com/v2/catalog/lookup?phone_number=%2B233541112259',
{
headers: {
'Authorization': 'Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
},
}
);
const { data } = await response.json();
console.log(data.network.name); // "MTN Ghana"
console.log(data.network.id); // 42 — you'll need thisimport requests
response = requests.get(
'https://api.clickairtime.com/v2/catalog/lookup',
params={'phone_number': '+233541112259'},
headers={'Authorization': 'Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
)
data = response.json()['data']
print(data['network']['name']) # "MTN Ghana"
print(data['network']['id']) # 42 — you'll need this$ch = curl_init('https://api.clickairtime.com/v2/catalog/lookup?phone_number=%2B233541112259');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
echo $result['data']['network']['name']; // "MTN Ghana"HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.clickairtime.com/v2/catalog/lookup?phone_number=%2B233541112259"))
.header("Authorization", "Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());The response includes the network.id (e.g., 42 for MTN Ghana) and available products.
Send Airtime
Create a topup using the network ID from the catalog lookup:
curl -X POST "https://api.clickairtime.com/v2/topups" \
-H "Authorization: Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+233541112259",
"network_id": 42,
"amount": {
"value": 10,
"currency": "GHS"
}
}'const response = await fetch('https://api.clickairtime.com/v2/topups', {
method: 'POST',
headers: {
'Authorization': 'Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+233541112259',
network_id: 42,
amount: { value: 10, currency: 'GHS' },
}),
});
const { data } = await response.json();
console.log(data.status); // "completed"
console.log(data.id); // transaction IDimport requests
response = requests.post(
'https://api.clickairtime.com/v2/topups',
headers={
'Authorization': 'Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json',
},
json={
'phone_number': '+233541112259',
'network_id': 42,
'amount': {'value': 10, 'currency': 'GHS'},
}
)
data = response.json()['data']
print(data['status']) # "completed"
print(data['id']) # transaction ID$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',
],
CURLOPT_POSTFIELDS => json_encode([
'phone_number' => '+233541112259',
'network_id' => 42,
'amount' => ['value' => 10, 'currency' => 'GHS'],
]),
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
echo $result['data']['status']; // "completed"HttpClient client = HttpClient.newHttpClient();
String body = """
{
"phone_number": "+233541112259",
"network_id": 42,
"amount": { "value": 10, "currency": "GHS" }
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.clickairtime.com/v2/topups"))
.header("Authorization", "Bearer ce_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());That's it! The airtime is delivered and the cost is deducted from your wallet.
What's Next?
- Authentication — API key details and permissions
- Catalog Lookup — Full catalog API reference
- Supported Networks — Browse networks by country
- Send Airtime — Complete topup API reference
- Webhooks — Receive real-time status updates
- Wallet Balance — Check your wallet balance
- Error Codes — Handle errors gracefully
