Get rates of an account
getAccountRates returns the rates an account is charged: the rates of the tariff in its service plan. Use it to show a price list on your website or in the user’s app.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | yes | ID of the account |
prefix |
string | no | Return only the rates matching this prefix |
offset |
int | no | Number of rates to skip |
limit |
int | no | Maximum number of rates to return |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
currency |
string | Currency of the rates, ISO 4217 |
rates |
array | One struct per rate, see below |
Each struct in rates:
| Name | Type | Description |
|---|---|---|
prefix |
string | Destination prefix |
country |
string | Country of the destination |
description |
string | Description of the destination |
rate |
double | Price per minute |
local_rate |
double | Price per minute of a local call, when the tariff has local calling enabled |
Example
Section titled “Example”call("getAccountRates", {"i_account": 3092, "prefix": "4420", "limit": 50}){ "result": "OK", "currency": "USD", "rates": [ {"prefix": "4420", "country": "United Kingdom", "description": "UK - London", "rate": 0.012, "local_rate": 0.012}, {"prefix": "44207", "country": "United Kingdom", "description": "UK - London Central", "rate": 0.011, "local_rate": 0.011}, ],}Related
Section titled “Related”- Rates and Tariffs: where the rates come from
- Service plans: which tariff an account uses
- Get account information:
i_billing_planof the account - Get account minute plans