profile

Get the balance of the profile

GEThttps://onlinesim.io/api/getBalance.php

Returns the balance of the profile, the frozen funds and — on request — the partner earnings.

Use it to top up in time (for example before WARNING_LOW_BALANCE errors of getNum).

Security

Parameters

query2
NameTypeDescription
incomestring

Add income and income_usd to the answer. Any non-empty value except 0 turns it on (false too); absent, empty or 0 — off.

Example:1
langstring

Language of the texts in the answer (country and service names, status texts): fr, de, ru, en or zh. Every method accepts it; methods without such texts answer the same in any language. Field names, error codes and other fixed values stay in English. Without the parameter: ru for getTariffs, getNumbersStats and getFreeList; otherwise the language of the profile for requests with a key, English for requests without one. An unsupported value falls back to the default language

Enum:frderuenzh

Responses

200Balance or a common error
Content-Typeapplication/json
Schema
schemaoneOfBalance (with partner earnings when income is set) or a common error
One Of
[0]object
[1]allOf
[2]object

Examples

Balance

Balance and frozen funds

{
  "response": "1",
  "balance": "106.32",
  "zbalance": 0.36
}
With income

With income=1: partner earnings added

{
  "response": "1",
  "balance": "106.32",
  "zbalance": 0.36,
  "income": 12.5,
  "income_usd": "13.200"
}
429HTTP 429: more than 400 requests per minute from one profile (from one IP for requests without a key), or more than 200 requests per minute from one profile to getNum, getPrice, getState and setOperationOk together
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Rate limit

Request rate limit exceeded

{
  "response": "TRY_AGAIN_LATER"
}
456HTTP 456: the API key is invalid or the OAuth token has expired. Public methods answer the same way when an invalid key is sent
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Invalid key

Invalid API key or expired token

{
  "response": "ERROR_WRONG_KEY"
}

Code Samples

Generating examples...