Methods for viewing balances

On this page:

GET[host]/back-api/backoffice/user/{userId}/balance/

Get user balances

POST[host]/back-api/backoffice/balances

Get balances by assets and users


Get user balances

Use this method to view the current balance in each user asset.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

The user identifier, in the GUID string format.

GET[host]/back-api/backoffice/user/{userId}/balance/

GET /back-api/backoffice/user/68e057fe-0aec-03db-20f8-5f811abf7da6/balance HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

asset string

The asset identifier.

balance number

The amount of funds available to the user in the indicated asset.

RESPONSE EXAMPLE
[
  {
    "asset": "btc",
    "balance": 10
  },
  {
    "asset": "eth",
    "balance": 300
  }
]

Get balances by assets and users

Use this method to request the current balance in various assets available to specified users.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

asset array

An array of string values, identifying the assets to include in the list.

userIds array

An array of string values, identifying the users to include in the list.

POST[host]/back-api/backoffice/balances

POST /back-api/backoffice/balances HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "asset": "usdt",
  "userIds": [
    "d3e84bed-94bb-59c1-bbf1-fcfea251e84b",
    "89411b17-28af-be5a-853d-1e903e2ddf76",
    "5122444f-2658-fb8f-8863-16fdf0a2028b"
  ]
}

Response

userName string

The username.

userId string

The user identifier, in the GUID string format.

If a user with the specified ID is missing in the database, the following error is returned: error : "User with id:{userId} not found"

userEmail string

The user email.

userRoles array

An array of string values, identifying the user roles.

balances array

The details about user balance in each asset:

asset string

The asset identifier.

amount string

The total amount in the indicated user asset, including both the locked funds that are reserved for execution of open orders, and the remaining funds presently available to the user.

locked string

The amount of locked funds that are currently reserved for covering open orders. The users cannot draw on these funds while their orders are pending.

fundsInRootAsset string

The total amount in the indicated user asset, in conversion to the exchange root asset (as the rootAsset field indicates).

This value is listed only for assets with a defined quote (or counter-) asset.

totalFundsInRootAsset string

The total amount in all assets available to a user, in conversion to the exchange root asset (as the rootAsset field indicates).

This value is displayed only when the fundsInRootAsset value is listed for each asset and no filters by user assets were applied in the request.

rootAsset string

The root asset set for the exchange.

RESPONSE EXAMPLE
{
  "filters": {
    "userIds": [
      "d3e84bed-94bb-59c1-bbf1-fcfea251e84b",
      "89411b17-28af-be5a-853d-1e903e2ddf76",
      "5122444f-2658-fb8f-8863-16fdf0a2028b"
    ]
  },
  "paging": {
    "page": 1,
    "per_page": 3,
    "total": 1
  },
  "data": [
    {
      "userName": "d3e84bed-94bb-59c1-bbf1-fcfea251e84b",
      "userId": "d3e84bed-94bb-59c1-bbf1-fcfea251e84b",
      "userEmail": "volgen@mailinator.com",
      "userRoles": [
        "Bot"
      ],
      "balances": [
        {
          "asset": "btc",
          "amount": "100000",
          "locked": "0",
          "fundsInRootAsset": "200000"
        },
        {
          "asset": "xmr",
          "amount": "10000000",
          "locked": "0"
        }
      ],
      "totalFundsInRootAsset": "80020",
      "rootAsset": "usd"
    },
    {
      "userId": "5122444f-2658-fb8f-8863-16fdf0a2028b",
      "error": "User with id:5122444f-2658-fb8f-8863-16fdf0a2028b not found."
    }
  ]
}