Skip to content

Check an account balance

GEThttps://gptunnel.ru/v1/balance

Returns the balance and credit limit of the selected account in rubles.

Call GET /v1/balance without parameters to find out which account the key belongs to.

  • If orgId contains an organization ID, the key belongs to that organization and the response shows its balance. Add ?useWalletBalance=true to get the key owner’s personal balance.
  • If orgId is null, the key belongs to a personal account and always returns that account’s balance.

Query parameters

ParameterTypeDescription
useWalletBalanceboolGet a personal account balance

Request headers

ParameterTypeDescription
Authorization*stringAPI key

An HTTP 200 response contains all five fields.

Response fields

ParameterTypeDescription
orgId*string | nullID of the organization whose balance was returned. null for a personal balance, including when useWalletBalance=true
userId*stringID of the API key owner, including when the response shows an organization balance
object*stringObject type. Always balance.
balance*numberBalance in rubles rounded to the nearest kopeck. It can be negative and excludes bonuses and the credit limit.
creditLimit*numberCredit limit in rubles. Always 0 for a personal account.

Balance of the organization

{
"orgId": "ddc0652cde46d307200011c4",
"userId": "0123456789abcdef01234567",
"object": "balance",
"balance": -51.54,
"creditLimit": 15000
}

Personal balance of key holder

{
"orgId": null,
"userId": "0123456789abcdef01234567",
"object": "balance",
"balance": 120.5,
"creditLimit": 0
}