The selected wallet's geography rules forbid this destination (e.g. a ZMW wallet cannot pay for a Malawi top-up). Use your USD global wallet, or a wallet whose currency matches the destination country.
WALLET_TYPE_UNAVAILABLE
400
You requested wallet_mode: "global" but your company has no USD wallet, or wallet_mode: "local" and your company has no local-currency wallet for the destination country.
Transaction Errors
Code
HTTP Status
Description
TRANSACTION_NOT_FOUND
404
No transaction found with the given ID
INSUFFICIENT_BALANCE
400
Wallet balance is too low for this transaction
DELIVERY_FAILED
500
Airtime delivery to the provider failed
DUPLICATE_TRANSACTION
409
A duplicate transaction was detected
Rate Limiting
Code
HTTP Status
Description
RATE_LIMIT_EXCEEDED
429
Too many requests. Wait and retry.
System Errors
Code
HTTP Status
Description
INTERNAL_ERROR
500
Unexpected server error. Contact support if it persists.
Always check the error.code field programmatically rather than parsing the message string, as messages may change.
Handling Errors
const response = await fetch('https://api.clickairtime.com/v2/topups', { method: 'POST', headers: { 'Authorization': 'Bearer ce_live_xxx', 'Content-Type': 'application/json', }, body: JSON.stringify({ /* ... */ }),});const result = await response.json();if (!result.success) { switch (result.error.code) { case 'INSUFFICIENT_BALANCE': // Prompt user to fund wallet break; case 'INVALID_PHONE_NUMBER': // Ask user to re-enter phone number break; case 'RATE_LIMIT_EXCEEDED': // Implement exponential backoff break; default: // Log error for debugging console.error('API Error:', result.error); }}