Balances
Retrieve account balances from the Click Airtime V1 API using GET /adp/balances.
Version 1 API (v1.4) — This API is in maintenance mode. New integrations should use the Version 2 API which provides wallet balance queries with detailed transaction history.
GET /adp/balances
Retrieve the balances for all airtime services that have been configured with your account. This endpoint provides an overview of available balances across different airtime services, allowing for efficient monitoring and management.
Request
GET https://api.clickairtime.com/adp/balances
X-Click-Airtime-Email: your@email.com
X-Click-Airtime-Token: your-api-token
No request body or query parameters are required. The API credentials are used to determine the organization for which the account information is being fetched.
Code Examples
curl -X GET https://api.clickairtime.com/adp/balances \
-H "X-Click-Airtime-Email: your@email.com" \
-H "X-Click-Airtime-Token: your-api-token"const response = await fetch('https://api.clickairtime.com/adp/balances', {
headers: {
'X-Click-Airtime-Email': 'your@email.com',
'X-Click-Airtime-Token': 'your-api-token',
},
});
const { data } = await response.json();
data.forEach(account => {
console.log(`${account.serviceName} (${account.serviceCountry}): ${account.balance}`);
});import requests
response = requests.get(
'https://api.clickairtime.com/adp/balances',
headers={
'X-Click-Airtime-Email': 'your@email.com',
'X-Click-Airtime-Token': 'your-api-token',
}
)
data = response.json()['data']
for account in data:
print(f"{account['serviceName']} ({account['serviceCountry']}): {account['balance']}")$response = Http::withHeaders([
'X-Click-Airtime-Email' => 'your@email.com',
'X-Click-Airtime-Token' => 'your-api-token',
])->get('https://api.clickairtime.com/adp/balances');
$data = $response->json()['data'];
foreach ($data as $account) {
echo "{$account['serviceName']} ({$account['serviceCountry']}): {$account['balance']}\n";
}HttpResponse<String> response = Unirest
.get("https://api.clickairtime.com/adp/balances")
.header("X-Click-Airtime-Email", "your@email.com")
.header("X-Click-Airtime-Token", "your-api-token")
.asString();
JSONObject result = new JSONObject(response.getBody());
JSONArray data = result.getJSONArray("data");
for (int i = 0; i < data.length(); i++) {
JSONObject account = data.getJSONObject(i);
System.out.println(
account.getString("serviceName") + " (" +
account.getString("serviceCountry") + "): " +
account.getDouble("balance")
);
}Response (200)
{
"message": "Success",
"statusCode": 200,
"data": [
{
"accountId": "1dedb34-434ff-555x-ed5434fa",
"serviceName": "Airtel_Malawi",
"serviceCountry": "Malawi",
"balance": 10000
},
{
"accountId": "2d7db34-124ee-555x-9d54347a",
"serviceName": "TNM_Malawi",
"serviceCountry": "Malawi",
"balance": 200000
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
accountId | string | Unique identifier for the service account (UUID) |
serviceName | string | Name of the mobile network operator |
serviceCountry | string | Country where the network operates |
balance | number | Current available balance |
GET /adp/balances/:account_id
Fetch the balance associated with a specific account.
Request
GET https://api.clickairtime.com/adp/balances/:account_id
X-Click-Airtime-Email: your@email.com
X-Click-Airtime-Token: your-api-token
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | The account UUID to retrieve (from the /adp/balances response) |
Code Examples
curl -X GET https://api.clickairtime.com/adp/balances/1dedba3e-344f-4474-bac8-edb750a6fc77 \
-H "X-Click-Airtime-Email: your@email.com" \
-H "X-Click-Airtime-Token: your-api-token"const accountId = '1dedba3e-344f-4474-bac8-edb750a6fc77';
const response = await fetch(
`https://api.clickairtime.com/adp/balances/${accountId}`,
{
headers: {
'X-Click-Airtime-Email': 'your@email.com',
'X-Click-Airtime-Token': 'your-api-token',
},
}
);
const { data } = await response.json();
console.log(`${data.serviceName} (${data.serviceCountry}): ${data.balance}`);import requests
account_id = '1dedba3e-344f-4474-bac8-edb750a6fc77'
response = requests.get(
f'https://api.clickairtime.com/adp/balances/{account_id}',
headers={
'X-Click-Airtime-Email': 'your@email.com',
'X-Click-Airtime-Token': 'your-api-token',
}
)
data = response.json()['data']
print(f"{data['serviceName']} ({data['serviceCountry']}): {data['balance']}")$accountId = '1dedba3e-344f-4474-bac8-edb750a6fc77';
$response = Http::withHeaders([
'X-Click-Airtime-Email' => 'your@email.com',
'X-Click-Airtime-Token' => 'your-api-token',
])->get("https://api.clickairtime.com/adp/balances/{$accountId}");
$data = $response->json()['data'];
echo "{$data['serviceName']} ({$data['serviceCountry']}): {$data['balance']}";String accountId = "1dedba3e-344f-4474-bac8-edb750a6fc77";
HttpResponse<String> response = Unirest
.get("https://api.clickairtime.com/adp/balances/" + accountId)
.header("X-Click-Airtime-Email", "your@email.com")
.header("X-Click-Airtime-Token", "your-api-token")
.asString();
JSONObject result = new JSONObject(response.getBody());
JSONObject data = result.getJSONObject("data");
System.out.println(
data.getString("serviceName") + " (" +
data.getString("serviceCountry") + "): " +
data.getDouble("balance")
);Response (200)
{
"message": "Success",
"statusCode": 200,
"data": {
"accountId": "1dedba3e-344f-4474-bac8-edb750a6fc77",
"serviceName": "Airtel_Malawi",
"serviceCountry": "Malawi",
"balance": 10000
}
}
Error Responses
| HTTP Status | Description |
|---|---|
| 401 | Invalid or missing authentication credentials |
| 404 | Account ID not found or not accessible |
