Credits Balance
GET
/api/v3/credits/balance Base URL https://api.easify.liveBearer token and Accept header required Authentication →
This endpoint returns the account's current credits balance.
The balance is read live on every request, so it reflects credits used a moment ago.
There is a rate limit of 60 requests per minute per API token. This limit is shared by all API endpoints except those with their own separate limit (/api/v3/sms/send, /api/v3/sms/status, etc.), so requests to other endpoints also count toward it. If you exceed this limit, you will receive a 429 Too Many Requests status, along with a message indicating when you can try again.
This endpoint takes no parameters.
Response Fields
| credits number | Credits available to the token's user. When the account has a credit limit enabled for sub-users, this is the sub-user's own allocation; otherwise it is the account's balance. |
| total_credits number |
The account's total balance. Equal to credits when the credit limit is not enabled.
|
| is_credit_limit_enabled boolean | Whether the account allocates credits to sub-users individually. |
| expiry_date string |
The date the credits expire, as MM-DD-YYYY.
|
Example Response
Success Response:
{
"status": true,
"message": "Credits fetched successfully",
"data": {
"credits": 37058,
"total_credits": 37058,
"is_credit_limit_enabled": false,
"expiry_date": "10-31-2027"
}
}
Responses
| Case | Status Code | Response |
|---|---|---|
| If the user does not provide a token in the header or provides an invalid token | 401 |
{
"status":false,
"message":"Unauthenticated",
"errors": []
}
|
| If the user exceeds the allowed rate limit for requests | 429 |
{
"status":false,
"message":"Too many requests. Try again in 59 seconds",
"errors":[]
}
|
| If the user's subscription has ended | 402 |
{
"status":false,"message":"You need to recharge your account to proceed","errors":[]
}
|
| When the user account is inactive | 403 |
{
"status": false,
"message": "Your account is currently inactive.",
"errors": []
}
|
| If the request comes from an IP address or domain that is not on the account's API whitelist | 400 |
{
"status": false,
"message": "Access denied! Your IP or domain is not whitelisted.[ HostName : ] - [ Ip Address : << YOUR_SERVER_IP >>]",
"errors": []
}
|
Code Examples
Get credits balance
php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.easify.live/api/v3/credits/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <> ',
'Accept: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;