Check Balance
The Check Balance operation allows you to retrieve the current balance information for one or more organizations, for each available channel (e.g. Email, SMS).
Parameters
This operation allows you to retrieve the current balance for multiple organizations simultaneously by providing the organizationIds field, an array of organization identifiers. Maximum of 50 organizations.
Example:
{
"organizationIds": ["06137abe-9556-4f9e-8a45-1880ba36a761"]
}
Response
The response contains a balances array, where each item includes the following fields:
organizationId– Organization identifierchannels– Available balance for each channel (e.g. Email, SMS). For SMS, the response specifies the number of available SMS messages for each destination country covered by the organization's contracted traffic.error– Indicates an error that occurred while retrieving the organization's balance. See more information here.
Example:
{
"balances": [
{
"organizationId": "06137abe-9556-4f9e-8a45-1880ba36a76c",
"channels": {
"email": {
"values": [
{
"balance": 950
}
]
},
"sms": {
"values": [
{
"countryId": "MZ",
"balance": 1000
},
{
"countryId": "PT",
"balance": 24742
},
{
"countryId": "RoW",
"balance": 99913
}
]
}
},
"error": null
}
],
"error": {
"code": null,
"param": null,
"description": null
}
}
Errors
In error scenarios, the error property within each item of the balances array (in the response) will be populated with an object containing information about the error that occurred:
"error":
{
"code": "ORGANIZATION_BALANCE_CONFIG_NOT_FOUND",
"param": "06137abe-9556-4f9e-8a45-1880ba36a761",
"description": "ORGANIZATION_BALANCE_CONFIG_NOT_FOUND"
}
The code property specifies the type of error that occurred. The complete list of error codes is available here.