Account¶
Getting account data¶
To get an account data it is required to call GET /billing-api/companies/current/account, sending authorization data in the header.
Request example¶
curl -X GET "https://api.devino.online/billing-api/companies/current/account" \
-H "Authorization: Key QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
Response parameters¶
| Parameter | Data type | Description |
|---|---|---|
| account | Account | Account data. |
| validPacketChannels | string | Available channels. Possible values: |
Account¶
| Parameter | Data type | Description |
|---|---|---|
| companyId | integer | Company ID. |
| accountType | string | Account types. Possible values: |
| addPercent | integer | Additional percentage of the currency account. |
| balance | number | Account balance. |
| credit | number | Overdraft amount. |
| reserve | number | The total amount of the reserve. |
| reserveSms | number | Reserved sum for SMS services subscription. |
| reserveViber | number | Reserved sum for Viber services subscription. |
| currencyId | integer | Account currency ID. |
| isBlocked | boolean | Is company account blocked. Possible values: |
| recalcBillRate | boolean | Currency conversion requirement. Possible values: |
| disableThreshold | number | The balance threshold for the company's financial blocking. |
| notifyThreshold | number | The balance threshold for user notification. |
Response example¶
{
"result": {
"account": {
"accountType": "POSTPAID",
"addPercent": 0,
"balance": 1000.8,
"companyId": 111,
"credit": 0,
"currencyId": 1,
"disableThreshold": 0,
"isBlocked": false,
"notifyThreshold": 0,
"recalcBillRate": true,
"reserve": 0,
"reserveSms": 0,
"reserveViber": 0
},
"validPacketChannels": [
"EMAIL"
]
}
}
Tariff lines¶
To receive the tariff lines it is required to call GET /billing-api/companies/current/plan-records/current, sending request parameters and the authorization data in the header.
Request parameters¶
| Parameter | Data type | Description |
|---|---|---|
| channel | string | Message channel. Possible values: |
| countryId | integer | Country ID. |
| currencyId | integer | Account currency ID. |
| mogId | integer | Mobile operator group ID. |
| onlyNullSourceAddress | boolean | Filtering tariff items by the Possible values: |
Request example¶
curl -X GET "https://api.devino.online/billing-api/companies/current/plan-records/current?channel=EMAIL¤cyId=1&onlyNullSourceAddress=true" \
-H "Authorization: Key QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
Response parameters¶
| Parameter | Data type | Description |
|---|---|---|
| planRecord | object | Tariff line data. |
| quantity | integer | The current value of the counter for this tariff item. |
PlanRecord¶
| Parameter | Data type | Description |
|---|---|---|
| planRecordId | integer | Tariff item ID. |
| channel | string | Message channel. Possible values: |
| traffic | string | Traffic type. Possible values: For All |
| startDate | datetime | Starting date of the tariff position. |
| endDate | datetime | End date of the tariff position. |
| deliveryRule | string | Calculation rule. Possible values: |
| sourceAddress | string | Sender's address. |
| sourceAddressType | string | Sender address type. Possible values: |
| countryId | integer | Country ID. |
| countryName | string | Name of the country. |
| currencyId | integer | Account currency ID. |
| mogId | integer | Mobile operator group ID. |
| mogNameRus | string | Russian name for mobile operator group. |
| mogNameInt | string | International name for mobile operator group. |
| steps | array[Step] | Step parameters - price calculation depending on the number of sent messages. |
Step¶
| Parameter | Data type | Description |
|---|---|---|
| startStep | integer | The number of messages required to start the calculation. |
| endStep | integer | The number of messages required to complete the calculation. |
| price | number | Calculation price. |
Response example¶
{
"result": [
{
"planRecord": {
"planRecordId": 59260,
"channel": "SMS",
"traffic": "SERVICE",
"sourceAddressType": "IS",
"countryId": 240,
"countryName": "Russia",
"mogId": 1,
"mogNameInt": "MOTIV",
"mogNameRus": "Ekaterinburg-2000",
"startDate": "2020-12-01",
"deliveryRule": "SENT",
"steps": [
{
"startStep": 1,
"endStep": 5000,
"price": 1.9400
},
{
"startStep": 5001,
"endStep": 10000,
"price": 1.9100
},
{
"startStep": 10001,
"price": 1.3700
}
]
},
"quantity": 10538
}
]
}