Skip to content

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: EMAIL, FLASHCALL, HLR, PUSH, PUSH_WALLET, SMS, VIBER, VK, VOICE, WHATSAPP.

Account

Parameter Data type Description
companyId integer Company ID.
accountType string

Account types.

Possible values:
PREPAID - prepaid.
POSTPAID - postpaid.

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:
false - not blocked.
true - blocked.

recalcBillRate boolean

Currency conversion requirement.

Possible values:
false - conversion is not required.
true - conversion is required.

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: EMAIL, FLASHCALL, HLR, PUSH, PUSH_WALLET, SMS, VIBER, VK, VOICE, WHATSAPP.

countryId integer Country ID.
currencyId integer Account currency ID.
mogId integer Mobile operator group ID.
onlyNullSourceAddress boolean

Filtering tariff items by the sourceAddress field.

Possible values:
true - display tariff items only with "sourceAddress": null.
false - display all tariff items.

.

Request example

curl -X GET "https://api.devino.online/billing-api/companiecurrent/plan-records/current?channel=EMAIL&currencyId=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: EMAIL, FLASHCALL, HLR, PUSH, PUSH_WALLET, SMS, VIBER, VK, VOICE, WHATSAPP.

traffic string

Traffic type.

Possible values:
ADVERTISING - advertising traffic.
AUTHORIZATION - authorization traffic.
INCOMING - incoming traffic.
SERVICE - service traffic.
TRANSACTIONAL - transactional traffic.

For WHATSAPP channel:
REFERRAL_CONVERSATION - uncharged session if the user uses the buttons in messages from a business account.
SESSION - session started by a user.
SESSION_BUSINESS_INITIATED - session started by the business account.
UNIQUE_PHONE_NUMBERS - unique subscribers.

startDate datetime Starting date of the tariff position.
endDate datetime End date of the tariff position.
deliveryRule string

Calculation rule.

Possible values:
DELIVERED - for delivered messages.
SENT - for sent messages.

sourceAddress string Sender's address.
sourceAddressType string

Sender address type.

Possible values:
MS - multi-signature.
IS - individual signature.
ILS - international signature.
ONEWAY - one-way sending.
TWOWAY - session sending.
FN - federal number.
SN - short number.
SNP - short number with prefix.

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
    }
  ]
}