API

Platform API

Overview

All endpoints are relative to the host name. Host name along with your admin credentials are configured when setting up the exchange.

All methods are private. All requests except for Authorization must contain HTTP header: Authorization: Bearer <Access Token>.

Required fields are marked with *.

Authentication

Sign in

We support SSO authentication according to the standard.

First, a sign-in request must be sent to obtain cookies.

Request

Body:

email* string

Your Admin Panel login

password* string

Your Admin Panel password

POST[host]/identity/sign-in

POST /identity/sign-in HTTP/1.1
Host: host.name

{
  email: "admin@b2trader.com", 
  password: "Password"
}

Response

secondFactorRequired boolean

If true, before the next step, an additional POST-request must be sent containing 2FA code. Ref. to Sign in 2FA

message string

Alert message. Applicable only if secondFactorRequired is true

provider string

Method of sending a one-time 2FA code. Applicable only if secondFactorRequired is true

RESPONSE EXAMPLE
{
  "secondFactorRequired": true,
  "message": "For your security, we have emailed you a one-time authentication code. Please enter this code below to proceed.",
  "provider": "Email"
}

In case of successful authorization, cookies will be provided which are valid only for IdentityServer.

Next, a request must be sent to obtain the xmlHttpRequest.responseURL code.

Request

Query parameters:

Parameters are described in the specification. PKCE is used.

client_id* string

spa for FrontOffice only, spa_admin for FrontOffice and BackOffice. Available scopes for spa: openid offline_access FrontOffice. Available scopes for spa_admin: openid offline_access FrontOffice BackOffice

redirect_uri* string

The absolute path to the sign-in-done at the IdentityServer address, for example, https://host.name/sign-in-done. Relative path cannot be used

GET[host]/identity/connect/authorize

GET /identity/connect/authorize
  ?client_id=spa_admin
  &response_type=code
  &scope=openid%20profile%20FrontOffice%20BackOffice%20offline_access
  &redirect_uri=https://staging-4.b2trader.tech/sign-in-done
  &state=f27332fa-4e7a-4a82-a586-00e58ec63333
  &nonce=da4a8d26-9518-44c3-9e63-3a199dca8f14
  &code_challenge=suB-wE8Qkr-AvzFA3bvyX597BYq_GX-S5-N-5B5UMOU
  &code_challenge_method=S256 HTTP/1.1
Host: host.name

Response

In response, a redirect is sent. Extract the code from the URL. The code is one-time and cannot be reused.

In case of incorrect input data, identity/unauthorized will be returned with HTTP code 401.

RESPONSE EXAMPLE
Location: https://staging-4.b2trader.tech/sign-in-done
  ?code=ebd6574c9a734ec47b375dbfff951964a8935e0e9690a00be80b54a3d7ff48b2
  &scope=openid%20profile%20FrontOffice%20BackOffice%20offline_access
  &state=f27332fa-4e7a-4a82-a586-00e58ec63333
  &session_state=QjgS-hVe-y9rdqjIKxHyf4Jp9iT8uFxIijYsnHuRIoU.1a16e4bc02f924a173a684122e41c5ce

Finally, a request must be sent to obtain access token and refresh token.

Request

Header parameters:

  • Content-Type: application/x-www-form-urlencoded

  • Authorization: Basic base64(ClientId:ClientSecret)

Query parameters:

Parameters are described in the OAuth Specification. Additionally, code_verifier must be sent.

POST[host]/identity/connect/token

POST /identity/connect/token HTTP/1.1
Host: staging-4.b2trader.tech
Content-Type: application/x-www-form-urlencoded
Authorization: Basic c3BhX2FkbWluOnNwYV9hZG1pbl9zZWNyZXQ=

grant_type=authorization_code
    &code=49b3960d01d195a4330649fb711d0e41863573ccad4324714549d70623867d6d
    &code_verifier=a2cd48e5-8a13-4529-...-ad4e-a59b7edb87d8
    &redirect_uri=https%3A%2F%2Fhost.nameh%2Fsign-in-done

Response

access_token string

Access token. It has an expiry time of 30s. After expiration it must be refreshed

expires_in number

Expiration time of access token in μs

token_type string

Always "Bearer"

refresh_token string

A long-living token which is used for obtaining new access tokens

scope string

Scope of spa

RESPONSE EXAMPLE
{
  "access_token": "eyJhbGci...0MkP_NUQ",
  "expires_in": 3600,
  "token_type": "Bearer",
  "refresh_token": "4f6c4...676u67u6",
  "scope": "FrontOffice offline_access openid"
}

Sign in 2FA

If secondFactorRequired is true, an additional POST-request to the same endpoint must be sent containing a one-time 2FA code.

Request

Body:

provider* string

Method of sending a one-time 2FA code

VerificationCode* string

A one-time 2FA code

POST[host]/identity/sign-in

POST /identity/sign-in HTTP/1.1
Host: host.name

{
  "provider": "Email",
  "VerificationCode": "123456"
}

Response

VerificationCode will be sent to the email specified in the request.


Sign in [Machine-to-Machine]

Note

This authentication method is for internal use only, between trusted servers.

2FA is not applicable for this authentication method.

Request

Header parameters:

Note that this endpoint does not support JSON in the request.

  • Content-Type: application/x-www-form-urlencoded

  • Authorization: Basic base64(ClientId:ClientSecret)

Query parameters:

Available parameters — according to the OAuth Specification.

ClientId

Possible values:

  • lk

  • tests

ClientSecret

Clarify the value for your environment

scope

Possible values:

  • openid offline_access FrontOffice

  • openid offline_access BackOffice

POST[host]/identity/connect/token

POST /identity/connect/token HTTP/1.1
Host: host.name
Content-Type: application/x-www-form-urlencoded

grant_type=password
  &username=johndoe
  &password=A3ddj3w
  &scope=openid%20FrontOffice%20offline_access

Response

access_token string

Access token. It has an expiry time of 30s. After expiration it must be refreshed

expires_in number

Expiration time of access token in μs

token_type string

Always "Bearer"

refresh_token string

A long-living token which is used for obtaining new access tokens

scope string

Scope of spa

RESPONSE EXAMPLE
{
  "access_token": "eyJhbGci...0MkP_NUQ",
  "expires_in": 3600,
  "token_type": "Bearer",
  "refresh_token": "4f6c4...676u67u6",
  "scope": "FrontOffice offline_access openid"
}

Refresh Token

Request

Header parameters:

  • Content-Type: application/x-www-form-urlencoded

Query parameters:

Obtaining new tokens — according to the specification. Refresh token is one-time and cannot be reused.

POST[host]/identity/connect/token

POST /identity/connect/token HTTP/1.1
Host: host.name
Content-Type: application/x-www-form-urlencoded

client_id=spa_admin
  &client_secret=spa_admin_secret
  &grant_type=refresh_token
  &refresh_token=ad46d62576fa4510318d1e5e759f0ff18c4925...
  &scope=openid%20offline_access%20BackOffice%20FrontOffice

Response

access_token string

Access token. It has an expiry time of 30s. After expiration it must be refreshed

expires_in number

Expiration time of access token in μs

token_type string

Always "Bearer"

refresh_token string

A long-living token which is used for obtaining new access tokens

RESPONSE EXAMPLE
{
  "access_token": "akvmn34egjidg0jifgjdg0djg34g",
  "token_type": "Bearer",
  "refresh_token": "dfk3glhlkskmnksdgnfkog",
  "expires_in": 3600
}

Sign out

After signing out, the access token continues to be valid until it expires (default is 30 seconds). It needs to be removed from localstorage on the client side.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

refresh_token string

If no refresh token is provided, all issued refresh tokens for the current user + clientId combination will be revoked. In this case, the request body must be an empty json object ({ })

POST[host]/identity/sign-out

POST /identity/sign-out HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "refresh_token": "refresh_token"
}

Response

In case of success, HTTP code 200 will be returned.


User Methods

Get Users

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

Search

Either username or email

Type

User type. Available values:

  • All

  • New

  • Verified

  • Unverified

  • Blocked

  • Admins

  • NoRoles

Status

User status. Ref. to User Statuses for details

DepositDateFrom

Use this parameter to get a list of users who made a deposit after the specified date. To specify the period, use DepositDateTo value additionally

DepositDateTo

Use this parameter to get a list of users who made a deposit before the specified date. To specify the period, use DepositDateFrom value additionally

DepositAmountFrom

Use this parameter to specify the minimal deposit amount

DepositAmountTo

Use this parameter to specify the maximal deposit amount

TradingVolumeFrom

Use this parameter to specify the minimal trading volume

TradingVolumeTo

Use this parameter to specify the maximal trading volume

ActivePeriodFrom

Use this parameter to get a list of users who were active after the specified date. To specify the period, use ActivePeriodTo value additionally

ActivePeriodTo

Use this parameter to get a list of users who were active before the specified date. To specify the period, use ActivePeriodFrom value additionally

GET[host]/back-api/backoffice/users

GET /back-api/backoffice/users?Type=Active&Roles=Admin HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

isActive boolean

If true, user can log in and interact with the exchange or the Admin Panel of the exchange

isEmailConfirmed boolean

If true, the user email was confirmed

isPhoneConfirmed boolean

If true, the user phone number was confirmed

registrationDate string

Date and time of user registration

canWithdraw boolean

If true, the user can withdraw funds

canDeposit boolean

If true, the user can deposit funds

status string

User status. Ref. to User Statuses for details

twoFactorEnabled boolean

If true, 2FA is enabled for this user

hasTradingApiKey boolean

If true, the user has active API keys in Trader’s Room and can trade via API

id string

User identifier

email string

User email

roles array

Array of user roles

nickname string

User nickname in the system

country object

Country of registration

id string

Country identifier

name string

Country name

code string

Country code

createdAt string

Date and time of user profile creation

firstName string

User first name

lastName string

User last name

countryId string

Country identifier

location string

Current user location based on IP

RESPONSE EXAMPLE
{
  "filters": {
    "type": 0,
    "roles": ["Admin"]
  },
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 1
  },
  "data": [
    {
      "isActive": true,
      "isEmailConfirmed": true,
      "isPhoneConfirmed": true,
      "registrationDate": "2019-10-14T09:32:25.686736",
      "canWithdraw": false,
      "canDeposit": false,
      "status": "Active",
      "twoFactorEnabled": false,
      "hasTradingApiKey": false, 
      "id": "8f3b7743-64ff-8c79-9d94-4c23d01e78df",
      "email": "admin@mailinator.com",
      "roles": [
        "Admin"
      ],
      "nickname": "8f3b7743-64ff-8c79-9d94-4c23d01e78df",
      "country": {
        "id": "USA",
        "name": "United States",
        "code": "US"
      },
      "lastSignInDate": "2020-02-19T14:00:22.545778",
      "createdAt": "2019-10-14T09:32:25.686736",
      "firstName": "Test",
      "lastName": "Test",
      "countryId": "USA",
      "location": "{\"country\":\"Russia\",\"code\":\"RU\"}"
    }
  ]
}

Create User

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

nickname* string

User nickname

email* string

Email which user will use to log in

password* string

Password which user will use to log in

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

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

{
  "nickname": "admin",
  "email": "admin@b2trader.com",
  "password": "C0m9l&xP@ssw0rd"
}

Response

id string

User identifier in the system, GUID

email string

User email. Same as in the request

roles array

Array of user roles. Initially empty

nickname string

User nickname. Same as in the request

createdAt string

Date and time of user profile creation

RESPONSE EXAMPLE
{
  "id": "c8f521f5-9f34-44bc-9377-ec0c4786c333",
  "email": "admin@b2trader.com",
  "roles": [],
  "nickname": "admin",
  "createdAt": "2019-03-27T13:51:13.4039729Z"
}

Get User Profile

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID. If not provided, then the profile of the authorized user is returned

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

GET /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

isActive boolean

If true, user can log in and interact with the exchange or the Admin Panel of the exchange

isEmailConfirmed boolean

If true, the user email was confirmed

isPhoneConfirmed boolean

If true, the user phone number was confirmed

registrationDate string

Date and time of user registration

canWithdraw boolean

If true, the user can withdraw funds

canDeposit boolean

If true, the user can deposit funds

status string

User status. Ref. to User Statuses for details

twoFactorEnabled boolean

If true, 2FA is enabled for this user

hasTradingApiKey boolean

If true, the user has active API keys in Trader’s Room and can trade via API

id string

User identifier

email string

User email

roles array

Array of user roles

nickname string

User nickname in the system

lastSignInDate string

Date and time of last login to the system

createdAt string

Date and time of user profile creation

RESPONSE EXAMPLE
{
  "data": {
    "isActive": true,
    "isEmailConfirmed": true,
    "isPhoneConfirmed": false,
    "registrationDate": "2021-04-21T15:33:45.247172Z",
    "canWithdraw": false,
    "canDeposit": false,
    "status": "Active",
    "twoFactorEnabled": false,
    "hasTradingApiKey": false,
    "id": "bbedc77f-d20b-11a2-3849-2bd518e6350d",
    "email": "test@mailinator.com",
    "roles": [
      "Support"
    ],
    "nickname": "Test",
    "lastSignInDate": "2021-04-21T15:33:46.2358Z",
    "createdAt": "2021-04-21T15:33:45.284624Z"
  }
}

Change User Info

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

Body:

userName string

User name

firstName string

User first name

lastName string

User last name

middleName string

User middle name

countryId string

User country

comment string

Operation comment

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

PATCH /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "firstNmae": "John",
  "lastName": "Doe"
}

Response

isActive boolean

If true, user can log in and interact with the exchange or the Admin Panel of the exchange

isEmailConfirmed boolean

If true, the user email was confirmed

isPhoneConfirmed boolean

If true, the user phone number was confirmed

registrationDate string

Date and time of user registration

canWithdraw boolean

If true, the user can withdraw funds

canDeposit boolean

If true, the user can deposit funds

status string

User status. Ref. to User Statuses for details

twoFactorEnabled boolean

If true, 2FA is enabled for this user

id string

User identifier

email string

User email

nickname string

User nickname in the system

createdAt string

Date and time of user profile creation

RESPONSE EXAMPLE
{
  "isActive": true,
  "isEmailConfirmed": true,
  "isPhoneConfirmed": false,
  "registrationDate": "2020-03-19T14:49:13.36193",
  "canWithdraw": false,
  "canDeposit": false,
  "status": "Active",
  "twoFactorEnabled": false,
  "id": "a661b905-6856-475f-809c-8492729c9d6e",
  "email": "nickname@email.com",
  "nickname": "nickname",
  "createdAt": "2020-03-19T14:49:13.510214"
}

Change User Email

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

Body:

email* string

New email value

PUT[host]/back-api/backoffice/user/{userId}/email

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

{
  "email": "new@email.mail"
}

Response

In case of success, HTTP code 200 will be returned.


Change User Password

Important

The Admin user role is required to perform this action.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

Body:

password* string

New password

POST[host]/back-api/backoffice/user/{userId}/password

POST /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d/password HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "password": "NewPassword!"
}

Response

In case of success, HTTP code 200 will be returned.


Change User Role

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId*

User identifier, GUID

roleName*

New role name. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

POST[host]/back-api/backoffice/user/{userId}/role/{roleName}

POST /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d/role/Trader HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Delete User Role

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId*

User identifier, GUID

roleName*

New role name. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

DELETE[host]/back-api/backoffice/user/{userId}/role/{roleName}

DELETE /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d/role/Trader HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Enable 2FA

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

PUT[host]/back-api/backoffice/user/{userId}/enable2fa/

PUT /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d/enable2fa HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Disable 2FA

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

PUT[host]/back-api/backoffice/user/{userId}/disable2fa/

PUT /back-api/backoffice/user/bbedc77f-d20b-11a2-3849-2bd518e6350d/disable2fa HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Get User Details

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

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

GET /back-api/backoffice/user-card/6d759436-8a00-a1df-a1e8-16624e9be7e2/details HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

userId string

User identifier, GUID

nickname string

User nickname

email string

User email

registration-date string

Date and time of user registration

RESPONSE EXAMPLE
{
  "user_id": "0c0319d1-8f3c-1875-a112-42ce529a781a",
  "nickname": "0c0319d1-8f3c-1875-a112-42ce529a781a",
  "email": "copycat@mailinator.com",
  "registration-date": "2019-10-14T13:10:26.511307"
}

Get User Transactions

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

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

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

Response

id number

Operation identifier

creationDate string

Date and time of operation

instrument string

Instrument identifier: {baseAsset}_{quoteAsset}

side number

Order side: 0 — buy, 1 — sell

category string

Always Order

price number

Order price

amount :type:` number`

Operation amount

fee number

Amount of fee paid

percent number

Always 0 (reserved field)

total number

Total amount of quoted currency to sell/buy (quote amount)

RESPONSE EXAMPLE
{
  "filters": {},
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 4944
  },
  "data": [
    {
      "id": -144115188075841741,
      "creationDate": "2019-10-14T13:28:01.740126Z",
      "instrument": "xrp_usdt",
      "side": 0,
      "category": "Order",
      "price": 0.28834,
      "amount": 24956.0,
      "fee": 0.0,
      "percent": 0.0,
      "total": 7195.813040
    }
  ]
}

Get User Withdrawals

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

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

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

Response

id number

Operation identifier

accountId number

Account identifier

assetId string

Asset identifier

transferId string

Transfer identifier

version number

For internal use only

type number

0 — deposit, 1 — withdrawal

amount number

Operation amount

comment string

Operation comment

createdAt string

Date and time of operation creation

updatedAt string

Date and time of operation update

status number

Possible values:

  • 0AwaitingConfirmation. Withdrawal transfer request is created. Waiting for confirmation

  • 2Completed. All activities are completed. This is a final state

  • 3Failed. Transfer failed. This is a final state

  • 5Canceled. Transfer is canceled. This is a final state

fee number

Amount of fee paid

data string

Internal technical details which are not supposed to be used by external parties

errorMessage string

In case of an error, contains description

RESPONSE EXAMPLE
{
  "filters": {},
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 1
  },
  "data": [
    {
      "id": 32,
      "accountId": 2,
      "assetId": "eth",
      "transferId": "2",
      "version": 148155,
      "type": 1,
      "amount": 10.1,
      "comment": "Money withdrawal",
      "createdAt": "2019-10-16T14:10:28.078428",
      "updatedAt": "2019-10-16T14:10:28.078428",
      "status": 2,
      "fee": 0.0,
      "data": "{}",
      "errorMessage": ""
    }
  ]
}

Get User Deposits

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

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

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

Response

id number

Operation identifier

accountId number

Account identifier

assetId string

Asset identifier

transferId string

Transfer identifier

version number

For internal use only

type number

0 — deposit, 1 — withdrawal

amount number

Operation amount

comment string

Operation comment

createdAt string

Date and time of operation creation

updatedAt string

Date and time of operation update

status number

Possible values:

  • 1Pending. Deposit transfer request is created. Waiting for completion

  • 2Completed. All activities are completed. This is a final state

  • 3Failed. Transfer failed. This is a final state

  • 5Canceled. Transfer is canceled. This is a final state

fee number

Amount of fee paid

data string

Internal technical details which are not supposed to be used by external parties

errorMessage string

In case of an error, contains description

RESPONSE EXAMPLE
{
  "filters": {},
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 1
  },
  "data": [
    {
      "id": 31,
      "accountId": 2,
      "assetId": "eth",
      "transferId": "1",
      "version": 148154,
      "type": 0,
      "amount": 10.1,
      "comment": "Money deposit",
      "createdAt": "2019-10-16T14:10:17.633274",
      "updatedAt": "2019-10-16T14:10:17.633274",
      "status": 2,
      "fee": 0.0,
      "data": "{}",
      "errorMessage": ""
    }
  ]
}

Get User Logins

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

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

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

Response

id number

Login identifier

userId string

User identifier

loginDate string

Date and time of login with timezone specified

ip string

IP address

with2FA boolean

If true, 2FA code was used to log in

location object

Login location details

RESPONSE EXAMPLE
{
  "filters": {},
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 11
  },
  "data": [
    {
      "id": 2,
      "userId": "0c0319d1-8f3c-1875-a112-42ce529a781a",
      "loginDate": "2019-10-14T13:11:00.578425Z",
      "ip": "172.19.0.12",
      "with2FA": false,
      "location": {"country":"Uganda","code":"UU"}
    }
  ]
}

Cancel Order

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

Identifier of the user whose order needs to be canceled

orderId

Identifier of the order to be canceled

DELETE[host]/frontoffice/api/{userId}/orders/{orderId}

DELETE /frontoffice/api/68e057fe-0aec-03db-20f8-5f811abf7da6/orders/-72057594037927934 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

orderId number

System order identifier

total number

Total amount of quoted currency sold (quote amount)

orderType string

Order type: limit or market

commission number

Commission in quoted currency

createdAt string

Date and time of order creation

unitsFilled number

Base amount

isPending boolean

If true, the order is active (not rejected, cancelled, or completed)

status string

Order status: Working, Rejected, Cancelled, Completed

type string

Order side: buy or sell

amount number

Order amount, must be greater than 0

remaining number

Remaining amount

price number

Obsolete. It is equal to executionPrice for Market and Stop orders, and requestedPrice for Stop orders

stopPrice number

Stop price of the order. Applicable for stop orders

isLimit boolean

If true, the order is limit. If false, the order is market

instrument boolean

Order instrument identifier: {baseAsset}_{quoteAsset}

side string

Order side: 0 — buy, 1 — sell

RESPONSE EXAMPLE
{
  "order": {
    "orderId": "-72057594037927934",
    "total": 0.0,
    "orderType": 0,
    "commission": 0.0,
    "createdAt": "2020-08-27T12:19:52.6348203Z",
    "unitsFilled": 0.0,
    "isPending": false,
    "status": "cancelled",
    "type": "sell",
    "amount": 1.0,
    "remaining": 1.0,
    "price": 1.0,
    "stopPrice": 0.0,
    "isLimit": true,
    "instrument": "btc_usdt",
    "side": 1
  }
}

Deposits & Withdrawals Methods

Create Deposit

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

userId string

User identifier

assetID string

Currency identifier

amount number

Deposit amount

comment string

Comment to the deposit

callbackUrl string

URL for callbacks

POST[host]/back-api/backoffice/transfers/deposit

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

{
  "userId": "942fe02b-e9b9-6e9e-7c82-85d74f3234d4",
  "assetId": "btc",
  "amount": 1,
  "comment": "1",
  "callbackUrl": "https://webhook.site/4175dbdf-8633-420c-842c-5d31381280ae"
}

Response

id number

Deposit ID

asset string

Currency name

type string

Type of the operation

status string

Status of the deposit:

  • Pending — the deposit is being executed

  • Completed — the deposit is completed

  • Failed — the deposit was not executed

amount string

Depositing amount

fee string

Fee amount

createdAt string

Date and time of the deposit creation with μs precision

updatedAt string

Date and time of the deposit update with μs precision

RESPONSE EXAMPLE
{
  "id": 1,
  "asset": "btc",
  "type": "Deposit",
  "status": "Pending",
  "amount": "1",
  "fee": "0",
  "createdAt": "2021-04-09T10:50:40.1164856Z",
  "updatedAt": "2021-04-09T10:50:40.1164856Z"
}

Callback

Amount number

Depositing amount

Status string

Status of the deposit:

  • Pending — the deposit is being executed

  • Completed — the deposit is completed

  • Failed — the deposit was not executed

Asset string

Currency name

Type string

Type of the operation

Id number

Identifier. Identifier is identical to the ID in REST Response

CreatedAt string

Date and time of deposit creation with μs precision

Fee number

Fee amount

ErrorDetails null

Error description. Null if there is no error

CALLBACK EXAMPLE
[
  {
    "Amount": 1.0,
    "Status": "Completed",
    "Asset": "btc",
    "Type": "Deposit",
    "Id": 1,
    "CreatedAt": "2021-04-09T10:50:40.1164856Z",
    "Fee": 0.0,
    "ErrorDetails": null
  }
]

Create Withdrawal

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

userId string

User identifier

assetId string

Identifier of the currency

amount number

Amount of the withdrawal operation

comment string

Comment to the withdrawal operation

callbackUrl string

URL address for callbacks

POST[host]/back-api/backoffice/transfers/withdraw

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

{
  "userId": "942fe02b-e9b9-6e9e-7c82-85d74f3234d4",
  "assetId": "btc",
  "amount": 1,
  "comment": "1",
  "callbackUrl": "https://webhook.site/4175dbdf-8633-420c-842c-5d31381280ae"
}

Response

id number

ID of the withdrawal operation

asset string

Currency name

type string

Type of the operation

status string

Status of the operation. Possible values:

  • AwaitingConfirmation — the operation is waiting for confirmation

  • Completed — the operation is completed

  • Failed — the operation failed

  • Canceled — the operation was cancelled

amount string

Withdrawal amount

fee string

Fee amount

createdAt string

Date and time of the withdrawal creation with μs precision

updatedAt string

Date and time of the withdrawal update with μs precision

RESPONSE EXAMPLE
{
  "id": 2,
  "asset": "btc",
  "type": "Withdrawal",
  "status": "AwaitingConfirmation",
  "amount": "1",
  "fee": "0",
  "createdAt": "2021-04-09T10:55:49.6880533Z",
  "updatedAt": "2021-04-09T10:55:49.6880533Z"
}

Callback

Amount number

Withdrawal amount

Status string

Status of the withdrawal. Possible values:

  • AwaitingConfirmation — the operation is waiting for confirmation

  • Completed — the operation is completed

  • Failed — the operation failed

  • Canceled — the operation was cancelled

Asset string

Currency name

Type string

Type of the operation

TransferId number

Identifier of the transfer

CreatedAt string

Date and time of the withdrawal creation with μs precision

Fee number

Fee amount

ErrorDetails null

Description of errors. Null if there are no errors

CALLBACK EXAMPLE
[
  {
    "Amount": 1.0,
    "Status": "AwaitingConfirmation",
    "Asset": "btc",
    "Type": "Withdrawal",
    "TransferId": 1,
    "CreatedAt": "2021-04-09T11:43:58.2434222",
    "Fee": 0.0,
    "ErrorDetails": null
  }
]

Confirm Withdrawal

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

userId string

User identifier

transferId string

Transfer identifier

callbackUrl string

URL address for callbacks

POST[host]/back-api/backoffice/transfers/withdraw-confirm

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

{
  "userId": "ab9ac3d2-879d-02de-a53e-720d78414f0a",
  "transferId": "1",
  "callbackUrl": "https://webhook.site/4175dbdf-8633-420c-842c-5d31381280ae"
}

Callback

Amount number

The amount of funds for the operation

Status string

Status of the operation. Possible values:

  • AwaitingConfirmation — the operation is waiting for confirmation

  • Completed — the operation is completed

  • Failed — the operation failed

  • Canceled — the operation was cancelled

Asset string

Name of the currency

Type string

Type of the operation

TransferId number

Transfer identifier

CreatedAt string

Date and time of the withdrawal creation with μs precision

Fee number

Fee amount

ErrorDetails null

Description of errors. Null if there are no errors

CALLBACK EXAMPLE
[
  {
    "Amount": 0.0,
    "Status": "Completed",
    "Asset": "btc",
    "Type": "Withdrawal",
    "TransferId": 1,
    "CreatedAt": "2021-04-09T11:58:07.433122",
    "Fee": 0.0,
    "ErrorDetails": null
  }
]

Cancel Withdrawal

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

userId string

User identifier

transferId string

Transfer identifier

callbackUrl string

URL address for callbacks

POST[host]/back-api/backoffice/transfers/withdraw-cancel

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

{
  "userId": "ab9ac3d2-879d-02de-a53e-720d78414f0a",
  "transferId": "1",
  "callbackUrl": "https://webhook.site/4175dbdf-8633-420c-842c-5d31381280ae"
}

Callback

Amount number

The amount of funds for the operation

Status string

Status of the operation (Canceled in case of success, otherwise Failed)

Asset string

Name of the currency

Type string

Type of the operation

TransferId number

Transfer identifier

CreatedAt string

Date and time of the withdrawal creation with μs precision

Fee number

Fee amount

ErrorDetails null

Description of errors. Null if there are no errors

CALLBACK EXAMPLE
[
  {
    "Amount": 0.0,
    "Status": "Canceled",
    "Asset": "btc",
    "Type": "Withdrawal",
    "TransferId": 1,
    "CreatedAt": "2021-04-09T11:58:07.433122",
    "Fee": 0.0,
    "ErrorDetails": null
  }
]

Get Transfers

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

userId

User identifier, GUID

startDate

Date and time of the transfer

limit

Number of requests. Defaults to 100

GET[host]/back-api/backoffice/transfers/account/

GET /back-api/backoffice/transfers/account/
    ?userId=68e057fe-0aec-03db-20f8-5f811abf7da6
    &startDate=2019-04-04T15%3A27%3A41 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

id number

User identifier

asset string

Currency name

type string

Type of the operation

status string

Operation status. Possible values:

  • 0AwaitingConfirmation. Withdrawal transfer request is created. Waiting for confirmation

  • 2Completed. All activities are completed. This is a final state

  • 3Failed. Transfer failed. This is a final state

  • 5Canceled. Transfer is canceled. This is a final state

amount string

Amount of funds for the operation

fee string

Fee amount

createdAt string

Date and time of the operation creation with μs precision

updatedAt string

Date and time of the operation update with μs precision

If the user with the specified ID is not found, returns an error, indicating that a user is not found.

RESPONSE EXAMPLE
[
  {
    "id": 2,
    "asset": "eth",
    "type": "Withdrawal",
    "status": "Completed",
    "amount": "2.1231",
    "fee": "0",
    "createdAt": "2019-05-29T11:47:25.341822",
    "updatedAt": "2019-05-29T11:47:25.341822"
  },
  {
    "id": 1,
    "asset": "eth",
    "type": "Deposit",
    "status": "Completed",
    "amount": "2.1231",
    "fee": "0",
    "createdAt": "2019-05-29T11:36:52.648028",
    "updatedAt": "2019-05-29T11:36:52.648028"
  }
]

Get Executed Transfers

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive transfers

to

Final date, to which you want to receive transfer, should be greater than from

user

Filter by UserName or Email

userId

Filter by UserId

pageSize

Should be less than 1000

status

Status of the operation. Possible values:

  • AwaitingConfirmation — the operation is waiting for confirmation

  • Completed — the operation is completed

  • Failed — the operation failed

type

Type of the operation: deposit or withdrawal

cursor

Page number

GET[host]/back-api/api/v2/transfers

GET /back-api/api/v2/transfers?from=2019-03-05T00:00:00.000Z&user=copycat@mailinator.com&limit=2 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

userId string

User identifier

userName string

Name of the user in the system

email string

User’s email address

userRole string

User role in the system

comment string

Comment to the transfer

id number

Identifier of the operation

asset string

Currency name

transferId string

Transfer identifier

type string

Type of the operation

status string

Status of the operation. Possible values:

  • 0AwaitingConfirmation. Withdrawal transfer request is created. Waiting for confirmation

  • 2Completed. All activities are completed. This is a final state

  • 3Failed. Transfer failed. This is a final state

  • 5Canceled. Transfer is canceled. This is a final state

amount string

Amount of funds for the operation

fee string

Fee amount

errorDetails string

Description of errors

createdAt string

Date and time of the transfer creation with μs precision

updatedAt string

Date and time of the transfer update with μs precision

amountInRootAsset string

Transfer amount in root currency

feeInRootAsset string

Fee amount in root currency

rootAsset string

Name of the root currency

RESPONSE EXAMPLE
{
  "paging": {
    "next": "1",
    "prev": "-1"
  },
  "data": [
    {
      "userId": "3ae2608c-499d-a883-95e8-c46fd5d19076",
      "userName": "3ae2608c-499d-a883-95e8-c46fd5d19076",
      "email": "alice@mailinator.com",
      "userRole": "",
      "comment": "deposit 10.1 for copycat from Dad",
      "id": 10123,
      "asset": "usd",
      "transferId": "10051",
      "type": "Deposit",
      "status": "Completed",
      "amount": "10000",
      "fee": "0",
      "errorDetails": "",
      "createdAt": "2020-05-06T07:30:29.569238",
      "updatedAt": "2020-05-06T07:30:29.569238",
      "amountInRootAsset": "10000",
      "feeInRootAsset": "0",
      "rootAsset": "usd"
    }
  ]
}

Balance Methods

Get User Balance

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

userId

User identifier, GUID

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

Name of the currency

balance number

Amount of available funds

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

Get Balances

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

asset string

Filtering by currency. The field is optional

userIds array

Filtering by user ID. The field is optional

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

GET /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

User name

userId string

User identifier

userEmail string

User email address

userRoles array

User roles

balances array

Information about user’s balance

asset string

Name of the currency

amount string

Total amount of active and locked funds

locked string

Amount of funds, which are locked and cannot be used

fundsInRootAsset string

Amount of funds in the root currency. The field returns if the quote for the currency is specifies

totalFundsInRootAsset string

Total amount of funds in the root currency. The field returns if there is the fundsInRootAsset field for every currency and there are no filters by asset

rootAsset string

Name of the root currency

If the user for one of the UserIDs filters is not found, the following structure returns: error : "User with id:{userId} not found"

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

Roles Methods

Get User Roles

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/roles/

GET /back-api/backoffice/roles HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

name string

Name of the role

normalizedName string

Normalized name of the role

commissionType string

Type of the commission applied to the role

RESPONSE EXAMPLE
{
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 4944
  },
  "data": [
    {
      "name": "Vip",
      "normalizedName": "VIP",
      "commissionType": "Vip"
    },
    {
      "name": "User",
      "normalizedName": "USER",
      "commissionType": "NoCommission"
    }
  ]
}

Orders Methods

Get Orders History

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive orders

to

Final date to which you want to receive orders, should be greater than and not exceed from by 7 days; null value equals to current date

user

Filter by UserName or Email

user_id

Filter by UserId

OrderId

Filter by OrderId

Status

Current order status. Ref. to Order Statuses for details

Market

Filter by Market

type

Type of the order: limit or market

Sort

Sorting by date: +CREATEDAT — ascending, -CREATEDAT — descending

cursor

Page number

Side

Order side: 0 — buy, 1 — sell

GET[host]/back-api/api/v2/orders/

GET /back-api/api/v2/orders
    ?From=2017-01-16T14%3A33%3A59
    &User=bot%mail.com
    &Status=Completed
    &Market=btc_usdt
    &Type=Limit
    &Type=Market
    &Sort=-CREATEDAT
    &Cursor=0
    &Side=0 HTTP 1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

averageFillPrice string

Average fill price of the order

commissionCurrency string

Currency of paid commission

createdAt string

Date and time of order creation

effectiveLimitPrice string

Price of a limit order

email string

User email

filledAmount string

The filled amount of the order

market string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Order type: limit or market

remainingAmount string

The remaining amount in case of partially filled order

requestedAmount string

Total amount of the order

requestedLimitPrice string

Requested limit price

side string

Order side: buy or sell

timeInForce string

Time in Force option: FOK or GTC

totalCommission string

Total commission of the order

updatedAt string

Date and time of the last update

userId string

User identifier, GUID

userName string

Name of the user

userRole string

Role of the user

userRoles string

All roles applied to the user

IsApiKey boolean

Defines if the order was created with the use of API

RESPONSE EXAMPLE
{
  "paging": {
    "next": "0",
    "prev": "-1"
  },
  "sort": [
    "-CREATEDAT"
  ],
  "data": [
    {
      "averageFillPrice": "0.00013785",
      "commissionCurrency": "usd",
      "createdAt": "2019-06-18T10:25:29.694882Z",
      "effectiveLimitPrice": "",
      "email": "bot@mail.com",
      "filledAmount": "1",
      "market": "btc_usdt",
      "orderId": "-72057594037927934",
      "orderStatus": "Completed",
      "orderType": "Limit",
      "remainingAmount": "0",
      "requestedAmount": "1",
      "requestedLimitPrice": "1",
      "side": "Buy",
      "timeInForce": "GTC",
      "totalCommission": "0.001",
      "updatedAt": "2019-06-18T10:25:29.694886Z",
      "userId": "9d2ec919-5fd6-4ba2-860a-8235d877b0bc",
      "userName": "6ab6e8ba-fb15-3852-bbfa-53e1755f2c38",
      "userRole": "Trader",
      "userRoles": [ "Trader" ],
      "IsApiKey": true
    }
  ]
}

Get Order Info by ID

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

orderId*

Order identifier

GET[host]/back-api/api/v2/orders

GET /back-api/api/v2/orders?OrderId=-72057594037927934 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

averageFillPrice string

Average fill price of the order

commissionCurrency string

Currency of paid commission

createdAt string

Date and time of order creation

effectiveLimitPrice string

Price of a limit order

email string

User email

filledAmount string

The filled amount of the order

market string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Order type: limit or market

remainingAmount string

The remaining amount in case of partially filled order

requestedAmount string

Total amount of the order

requestedLimitPrice string

Requested limit price

side string

Order side: buy or sell

timeInForce string

Time in Force option: FOK or GTC

totalCommission string

Total commission of the order

updatedAt string

Date and time of the last update

userId string

User identifier, GUID

userName string

Name of the user

userRole string

Role of the user

userRoles string

All roles applied to the user

IsApiKey boolean

Defines if the order was created with the use of API

RESPONSE EXAMPLE
{
  "paging": {
    "next": "0",
    "prev": "-1"
  },
  "data": [
    {
      "averageFillPrice": "0.00013785",
      "commissionCurrency": "usd",
      "createdAt": "2019-06-18T10:25:29.694882Z",
      "effectiveLimitPrice": "",
      "email": "bot@mail.com",
      "filledAmount": "1",
      "market": "btc_usdt",
      "orderId": "-72057594037927934",
      "orderStatus": "Completed",
      "orderType": "Limit",
      "remainingAmount": "0",
      "requestedAmount": "1",
      "requestedLimitPrice": "1",
      "side": "Buy",
      "timeInForce": "GTC",
      "totalCommission": "0.001",
      "updatedAt": "2019-06-18T10:25:29.694886Z",
      "userId": "9d2ec919-5fd6-4ba2-860a-8235d877b0bc",
      "userName": "6ab6e8ba-fb15-3852-bbfa-53e1755f2c38",
      "userRole": "Trader",
      "userRoles": [ "Trader" ],
      "IsApiKey": true
    }
  ]
}

Get Order and Trades Info by ID

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

orderId*

Order identifier

GET[host]/back-api/api/v2/orders/{orderId}

GET /back-api/api/v2/orders/-72057594037927934 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

averageFillPrice string

Average fill price of the order

commissionCurrency string

Currency of paid commission

createdAt string

Date and time of order creation

effectiveLimitPrice string

Price of a limit order

email string

User email

filledAmount string

The filled amount of the order

market string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Order type: limit or market

remainingAmount string

The remaining amount in case of partially filled order

requestedAmount string

Total amount of the order

requestedLimitPrice string

Requested limit price

side string

Order side: buy or sell

timeInForce string

Time in Force option: FOK or GTC

totalCommission string

Total commission of the order

updatedAt string

Date and time of the last update

userId string

User identifier, GUID

userName string

Name of the user

userRole string

Role of the user

userRoles string

All roles applied to the user

IsApiKey boolean

Defines if the order was created with the use of API

accountVersion string

User account version

createdAt number

Date and time of trade creation

execType string

Type of trade execution: OrderStatusUpdate or Trade

tradeId string

Trade identifier

remainingAmount number

Remaining amount of the trade

filledAmount number

Filled amount of the trade

filledQuoteAmount number

Filled quote amount of the trade

filledBaseAmount number

Filled base amount of the trade

tradePrice number

Price within the trade

tradeAmount number

Total trade amount

rejectDetails string

Comments on trade rejection

commission number

Commission amount

commissionCurrency string

Currency of paid commission

RESPONSE EXAMPLE
{
  "order": {
    "averageFillPrice": "0.00013785",
    "commissionCurrency": "usd",
    "createdAt": "2019-06-18T10:25:29.694882Z",
    "effectiveLimitPrice": "",
    "email": "bot@mail.com",
    "filledAmount": "1",
    "market": "btc_usdt",
    "orderId": "-72057594037927934",
    "orderStatus": "Completed",
    "orderType": "Limit",
    "remainingAmount": "0",
    "requestedAmount": "1",
    "requestedLimitPrice": "1",
    "side": "Buy",
    "timeInForce": "GTC",
    "totalCommission": "0.001",
    "updatedAt": "2019-06-18T10:25:29.694886Z",
    "userId": "9d2ec919-5fd6-4ba2-860a-8235d877b0bc",
    "userName": "6ab6e8ba-fb15-3852-bbfa-53e1755f2c38",
    "userRole": "Trader",
    "userRoles": [ "Trader" ],
    "IsApiKey": true
  },
	"executions": [
    {
      "accountVersion": 6,
      "createdAt": "2019-11-19T13:19:41.886245Z",
      "execType": "OrderStatusUpdate",
      "tradeId": "0",
      "orderStatus": "Completed",
      "remainingAmount": "0",
      "filledAmount": "0",
      "filledQuoteAmount": "72541.80",
      "filledBaseAmount": "10",
      "tradePrice": "7254.18",
      "tradeAmount": "0",
      "rejectDetails": "",
      "commission": "72.54180",
      "commissionCurrency": "eur"
    }
  ]
}

Trades Methods

Get Trades History

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive trades

to

Final date to which you want to receive trades, should be greater than from; null value equals to current date

user

Filter by UserName or Email

market

Currency pair

orderside

Order side: 0 — buy, 1 — sell

ordertype

Type of the order: limit or market

orderstatus

Current order status. Ref. to Order Statuses for details

asset

Name of the asset. Get trades which have commission in specified asset

cursor

Page number

allUsersAndPages

Flag to get the data for all users by the period on one page. Possible values: true or false

GET[host]/back-api/api/v2/trades

GET /back-api/api/v2/trades?from=2019-11-13 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

acceptedAt string

Date and time of trade acceptance

baseAmount string

Base amount of the trade

commission string

Amount of commission

commissionCurrency string

Currency of commission

commissionInRootAssetNow string

Commission in the root asset at the current moment

commissionInRootAsset string

Commission in the root asset

completedAt string

Date and time of trade completion

email string

User email

executedAt string

Date and time of trade execution

executionId number

Execution identifier

executionPrice string

Price at the moment of trade execution

makerOrTaker string

Type of fee paid: maker or taker

marketId string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Type of the order: limit or market

quoteAmount string

Filled quote amount of the trade

remainingAmount string

The remaining amount in case of partially filled order

rootAsset string

Root asset

side string

Order side: buy or sell

totalBaseAmount string

Total base amount

totalCommission string

Total commission

totalQuoteAmount string

Total quote amount of the trade

tradeId string

Trade identifier

userId string

User identifier

userRole string

User role in the system

userRoles array

All roles applied to the user

RESPONSE EXAMPLE
{
  "paging": {
    "next": "0",
    "prev": "-1"
  },
  "data": [
    {
      "acceptedAt": "2020-07-13T08:30:36.650621",
      "baseAmount": "1",
      "commission": "0.001",
      "commissionCurrency": "btc",
      "commissionInRootAssetNow": "23.55271216",
      "commissionInRootAsset": "23.55271216",
      "completedAt": "2020-07-13T08:30:36.650621",
      "email": "alice@mailinator.com",
      "executedAt": "2020-07-13T08:30:36.650621",
      "executionId": "-72057594037927934",
      "executionPrice": "1000",
      "id": "-72057594037927934",
      "makerOrTaker": "taker",
      "marketId": "btc_usdt",
      "orderId": "-72057594037927934",
      "orderStatus": "Completed",
      "orderType": "Limit",
      "quoteAmount": "1000",
      "remainingAmount": "0",
      "rootAsset": "usd",
      "side": "Buy",
      "totalBaseAmount": "1",
      "totalCommission": "0.001",
      "totalQuoteAmount": "1000",
      "tradeId": "0",
      "userId": "fc0af546-5284-7b38-35b3-2361b32344e3",
      "userRole": "Trader",
      "userRoles": [ "Trader" ]
    }
  ]
}

Get User Last Trades

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

user *

Username or email

Query parameters:

count *

Trades displayed per page

market

Currency pair

page

Page number

GET[host]/back-api/api/v2/clientTradesHistory/{user}

GET /back-api/api/v2/clientTradesHistory/user@mail.com?count=20&page=1 HTTP/1.1
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

acceptedAt string

Date and time of trade acceptance

baseAmount string

Base amount of the trade

commission string

Amount of commission

commissionCurrency string

Currency of commission

commissionInRootAssetNow string

Commission in the root asset at the current moment

commissionInRootAsset string

Commission in the root asset

completedAt string

Date and time of trade completion

email string

User email

executedAt string

Date and time of trade execution

executionId number

Execution identifier

executionPrice string

Price at the moment of trade execution

makerOrTaker string

Type of fee paid: maker or taker

marketId string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Order type: limit or market

quoteAmount string

Filled quote amount of the trade

remainingAmount string

The remaining amount in case of partially filled order

rootAsset string

Root asset

side string

Order side: buy or sell

totalBaseAmount string

Total base amount

totalCommission string

Total commission

totalQuoteAmount string

Total quote amount of the trade

tradeId string

Trade identifier

userId string

User identifier, GUID

userRole string

User role in the system

userRoles array

All roles applied to the user

RESPONSE EXAMPLE
[
  {
    "acceptedAt": "2020-07-13T08:30:36.650621",
    "baseAmount": "1",
    "commission": "0.001",
    "commissionCurrency": "btc",
    "commissionInRootAssetNow": "23.55271216",
    "commissionInRootAsset": "23.55271216",
    "completedAt": "2020-07-13T08:30:36.650621",
    "email": "alice@mailinator.com",
    "executedAt": "2020-07-13T08:30:36.650621",
    "executionId": "-72057594037927934",
    "executionPrice": "1000",
    "id": "-72057594037927934",
    "makerOrTaker": "taker",
    "marketId": "btc_usdt",
    "orderId": "-72057594037927934",
    "orderStatus": "Completed",
    "orderType": "Limit",
    "quoteAmount": "1000",
    "remainingAmount": "0",
    "rootAsset": "usd",
    "side": "Buy",
    "totalBaseAmount": "1",
    "totalCommission": "0.001",
    "totalQuoteAmount": "1000",
    "tradeId": "0",
    "userId": "fc0af546-5284-7b38-35b3-2361b32344e3",
    "userRole": "Trader",
    "userRoles": [ "Trader" ]
  }
]

Get Trades by ID

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

ids *

Trade identifiers. Maximum count 100

POST[host]/back-api/api/v2/trades/info

GET /back-api/api/v2/trades/info HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "ids": [
    -72057594037927929, -72057594037927928
  ]
}

Response

acceptedAt string

Date and time of trade acceptance

baseAmount string

Base amount of the trade

commission string

Amount of commission

commissionCurrency string

Currency of commission

commissionInRootAssetNow string

Commission in the root asset at the current moment

commissionInRootAsset string

Commission in the root asset

completedAt string

Date and time of trade completion

email string

User email

executedAt string

Date and time of trade execution

executionId number

Execution identifier

executionPrice string

Price at the moment of trade execution

makerOrTaker string

Type of fee paid: maker or taker

marketId string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Order type: limit or market

quoteAmount string

Filled quote amount of the trade

remainingAmount string

The remaining amount in case of partially filled order

rootAsset string

Root asset

side string

Order side: buy or sell

totalBaseAmount string

Total base amount

totalCommission string

Total commission

totalQuoteAmount string

Total quote amount of the trade

tradeId string

Trade identifier

userId string

User identifier, GUID

userRole string

User role in the system

userRoles array

All roles applied to the user

IsApiKey boolean

Defines if the trade was executed with the use of API

RESPONSE EXAMPLE
{
  "acceptedAt": "2020-07-13T08:30:36.650621",
  "baseAmount": "1",
  "commission": "0.001",
  "commissionCurrency": "btc",
  "commissionInRootAssetNow": "23.55271216",
  "commissionInRootAsset": "23.55271216",
  "completedAt": "2020-07-13T08:30:36.650621",
  "email": "alice@mailinator.com",
  "executedAt": "2020-07-13T08:30:36.650621",
  "executionId": "-72057594037927934",
  "executionPrice": "1000",
  "id": "-72057594037927934",
  "makerOrTaker": "taker",
  "marketId": "btc_usdt",
  "orderId": "-72057594037927934",
  "orderStatus": "Completed",
  "orderType": "Limit",
  "quoteAmount": "1000",
  "remainingAmount": "0",
  "rootAsset": "usd",
  "side": "Buy",
  "totalBaseAmount": "1",
  "totalCommission": "0.001",
  "totalQuoteAmount": "1000",
  "tradeId": "0",
  "userId": "fc0af546-5284-7b38-35b3-2361b32344e3",
  "userRole": "Trader",
  "userRoles": [ "Trader" ],
  "IsApiKey": true
}

Get Trades with User Info

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from *

Starting date, from which you want to receive trades

to *

Final date to which you want to receive trade, should be greater than from but no more than 10 minutes

market

Currency pair

minAmount

Minimum trade amount

maxAmount

Maximum trade amount

GET[host]/back-api/api/v2/account_trades/

GET /back-api/api/v2/account_trades
?from=2019-11-26T10%3A38%3A00
&to=2019-11-26T10%3A39%3A00
&market=btc_usdt
&minAmount=1000
&maxAmount=2000 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

acceptedAt string

Date and time of trade acceptance

baseAmount string

Base amount of the trade

commission string

Amount of commission

commissionCurrency string

Currency of commission

commissionInRootAssetNow string

Commission in the root asset at the current moment

commissionInRootAsset string

Commission in the root asset

completedAt string

Date and time of trade completion

email string

User email

executedAt string

Date and time of trade execution

executionId number

Execution identifier

executionPrice string

Price at the moment of trade execution

makerOrTaker string

Type of fee paid: maker or taker

marketId string

Currency pair

orderId string

Order identifier

orderStatus string

Current order status. Ref. to Order Statuses for details

orderType string

Order type: limit or market

quoteAmount string

Filled quote amount of the trade

remainingAmount string

The remaining amount in case of partially filled order

rootAsset string

Root asset

side string

Order side: buy or sell

totalBaseAmount string

Total base amount

totalCommission string

Total commission

totalQuoteAmount string

Total quote amount of the trade

tradeId string

Trade identifier

userId string

User identifier

userRole string

User role in the system

userRoles array

All roles applied to the user

RESPONSE EXAMPLE
[
  {
    "acceptedAt": "2020-07-13T08:30:36.650621",
    "baseAmount": "1",
    "commission": "0.001",
    "commissionCurrency": "btc",
    "commissionInRootAssetNow": "23.55271216",
    "commissionInRootAsset": "23.55271216",
    "completedAt": "2020-07-13T08:30:36.650621",
    "email": "alice@mailinator.com",
    "executedAt": "2020-07-13T08:30:36.650621",
    "executionId": "-72057594037927934",
    "executionPrice": "1000",
    "id": "-72057594037927934",
    "makerOrTaker": "taker",
    "marketId": "btc_usdt",
    "orderId": "-72057594037927934",
    "orderStatus": "Completed",
    "orderType": "Limit",
    "quoteAmount": "1000",
    "remainingAmount": "0",
    "rootAsset": "usd",
    "side": "Buy",
    "totalBaseAmount": "1",
    "totalCommission": "0.001",
    "totalQuoteAmount": "1000",
    "tradeId": "0",
    "userId": "fc0af546-5284-7b38-35b3-2361b32344e3",
    "userRole": "Trader",
    "userRoles": [ "Trader" ]
  }
]

Get Last Trades of all Users

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

cursor

Page number

GET[host]/back-api/api/v2/last_trades

GET /back-api/api/v2/last_trades HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

email string

User email

executedAt string

Date and time of trade execution

executionId number

Execution identifier

RESPONSE EXAMPLE
{
  "paging": {
    "next": "0",
    "prev": "-1"
  },
  "data": [
    {
      "email": "alice@mail.com",
      "executedAt": "2017-01-16T14:34:02.001",
      "executionId": 12
    },
    {
      "email": "bob@mail.com",
      "executedAt": "2017-01-16T14:34:02.001",
      "executionId": 23
    }
  ]
}

Revert Trade

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

userId * string

User identifier, GUID

executionId * number

Execution identifier

orderId * number

Order identifier

POST[host]/back-api/backoffice/trades/revert

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

{
  "userId": "bbedc77f-d20b-11a2-3849-2bd518e6350d",
  "executions": [
    {
      "executionId": 93678594037913956,
      "orderId": -72057594037927934
    }
  ]
}

Response

updatedExecutionsCount number

Number of cancelled user trades

RESPONSE EXAMPLE
{
  "updatedExecutionsCount": 1
}

Assets Methods

Get Assets List

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/api/assets-info

GET /back-api/backoffice/api/assets-info HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

id string

Market identifier

can_deposit boolean

If true, the user can deposit funds

can_withdraw boolean

If true, the user can withdraw funds

asset_name string

Full name of the asset

withdrawal_fee string

Funds withdrawal fee

scale number

Decimal places of the displayed value

RESPONSE EXAMPLE
{
  "data": [
    {
      "id": "btc",
      "can_deposit": true,
      "can_withdrawal": true,
      "asset_name": "Bitcoin",
      "withdrawal_fee": 0.002,
      "scale": 8
    },
    {
      "id": "rub",
      "can_deposit": true,
      "can_withdrawal": true,
      "asset_name": "Russian ruble.",
      "withdrawal_fee": 0.02,
      "scale": 8
    }
  ]
}

Add New Asset

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

id * string

Asset identifier

asset_name * string

Full name of the asset

can_deposit boolean

If true, the user can deposit funds

can_withdraw boolean

If true, the user can withdraw funds

withdrawal_fee * number

Funds withdrawal fee

scale * number

Decimal places of the displayed value

image_url string

URL to image of an asset icon

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

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

{
  "id": "btc",
  "asset_name": "bitcoin",
  "withdrawal_fee": 0.001,
  "scale": "8"
}

Response

In case of success, HTTP code 200 will be returned.


Update Asset

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

asset_id *

Asset identifier

Body parameters:

asset_name * string

Full name of the asset. Must not equal to null, and must not exceed 50 symbols

can_deposit boolean

If true, the user can deposit funds

can_withdraw boolean

If true, the user can withdraw funds

withdrawal_fee number

Funds withdrawal fee

scale number

Decimal places of the displayed value

PUT[host]/back-api/backoffice/asset/{asset_id}

PUT /back-api/backoffice/asset/btc HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "asset_name": "bitcoin",
  "withdrawal_fee": 0.001,
  "scale: int": "8"
}

Response

In case of success, HTTP code 200 will be returned.


Markets Methods

Add New Market

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

market_id *

Market identifier

Body parameters:

id string

Market identifier

base_asset string

Base asset of the market

quote_asset string

Quote asset of the market

amount_scale number

Decimal places of the displayed amount

min_amount number

Minimum possible amount of the order

price_deviation number

Price deviation of the market

price_scale number

Decimal places of the displayed price

max_price number

Maximum price for an order

min_price number

Minimum price for an order

base_fee number

Fee for the base currency of the market

quote_fee number

Fee for the quote currency of the market

maker_fee number

Maker fee

maker_fee_limit number

Maker fee limit

taker_fee number

Taker fee

taker_fee_limit number

Taker fee limit

status string

Market status. Available values:

  • Open

  • Paused

  • Halted

side string

Market side. Available values:

  • BuySell

  • Buy

  • Sell

POST[host]/back-api/backoffice/market/{market_id}

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

{
  "id": "btc_usdt",
  "base_asset": "btc",
  "quote_asset": "usdt",
  "amount_scale": 8,
  "min_amount": 1.0,
  "price_deviation": 0.1,
  "price_scale": 8,
  "max_price": 0,
  "min_price": 0,
  "base_fee": 0,
  "quote_fee": 0,
  "maker_fee":  0.002,
  "maker_fee_limit": 0,
  "taker_fee":  0.002,
  "taker_fee_limit": 0,
  "status": "Open",
  "side": "BuySell"
}

Response

In case of success, HTTP code 200 will be returned.


Update Market

Important

The Admin user role is required to perform this action. A user with the Support role can update only the Hidden field value.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

market_id *

Market identifier

Body parameters:

base_fee number

Fee for the base currency of the market

quote_fee number

Fee for the quote currency of the market

maker_fee number

Maker fee

taker_fee number

Taker fee

hidden boolean

If True the market is hidden for the user

price_scale number

Decimal places of the displayed price

amount_scale number

Decimal places of the displayed amount

status string

Market status. Available values:

  • Open

  • Paused

  • Halted

side string

Market side. Available values:

  • BuySell

  • Buy

  • Sell

min_amount number

Minimum possible amount of the order

price_deviation number

Price deviation of the market

PUT[host]/back-api/backoffice/market/{market_id}

PUT /back-api/backoffice/market/btc_usdt HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "base_fee": 0.0025,
  "quote_fee": 0.0025,
  "maker_fee": 0.0025,
  "taker_fee": 0.0028,
  "hidden": false,
  "price_scale": 8,
  "amount_scale": 8,
  "status": "Halted",
  "side": "BuySell",
  "min_amount": 1.0,
  "price_deviation": 0.1
}

Response

In case of success, HTTP code 200 will be returned.

A user with the Support role can update only the Hidden field value. If new values ​​are passed for other fields, the Forbidden status will be returned, along with the name of the first field that is not allowed to be changed. In this case, the new value of the Hidden field will not be saved.

Tiers Methods

Get Tiers Aggregated Info

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/tiers

GET /back-api/backoffice/tiers HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

rootAsset string

Root asset of the exchange

groups array

Commission groups, contains arrays of tiers and markets to which these tiers are applicable:

tiers array

Array of tiers in the group. Each element contains the following fields:

id number

Tier identifier

description string

Tier description

volume number

Volume required to achieve the tier

makerFee number

Maker fee

takerFee number

Taker fee

tierGroupId number

Tier group identifier

market array

Array of markets to which the tiers are applicable. Each element contains the following fields:

marketId string

Market identifier

tierGroupId number

Commission group identifier

id

Commission group identifier

description string

Commission group description

RESPONSE EXAMPLE
{
  "rootAsset": "usd",
  "groups": [
    {
      "tiers": [
        {
          "id": 1,
          "description": "Vip 0",
          "volume": 0.0,
          "makerFee": 0.0012,
          "takerFee": 0.0015,
          "tierGroupId": 1
        },
        {
          "id": 2,
          "description": "Vip 0",
          "volume": 1.0,
          "makerFee": 0.0012,
          "takerFee": 0.0015,
          "tierGroupId": 1
        }
      ],
      "markets": [
        {
          "marketId": "btc_usd",
          "tierGroupId": 1
        },
        {
          "marketId": "btc_usdt",
          "tierGroupId": 1
        }
      ],
      "id": 1,
      "description": "group1 description"
    }
  ]
}

Get Tiers List

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/tiers/tier

GET /back-api/backoffice/tiers/tier HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

id number

Tier identifier

description string

Tier description

volume number

Volume required to achieve the tier

makerFee number

Maker fee

takerFee number

Taker fee

tier_group_id number

Tier group identifier

RESPONSE EXAMPLE
[
  {
    "id": 2,
    "description": "first tier",
    "volume": 0.000001,
    "maker_fee": 0.2,
    "taker_fee": 0.2,
    "tier_group_id": 1
  }
]

Create Tier

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

description string

Tier description

volume number

Trade volume required to achieve the tier

makerFee number

Maker fee

takerFee number

Taker fee

tier_group_id string

Tier group identifier

POST[host]/back-api/backoffice/tiers/tier

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

{
  "description": "fourth tier",
  "volume": 100000000,
  "maker_fee": 0.006,
  "taker_fee": 0.006,
  "tier_group_id": 1
}

Response

id number

Tier identifier

description string

Tier description

volume number

Volume required to achieve the tier

makerFee number

Maker fee

takerFee number

Taker fee

tier_group_id number

Tier group identifier

RESPONSE EXAMPLE
[
  {
  "id": 3,
  "description": "fourth tier",
  "volume": 100000000,
  "maker_fee": 0.006,
  "taker_fee": 0.006,
  "tier_group_id": 1
  }
]

Update Tier

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

tier_id*

Tier identifier

Body parameters:

description string

Tier description

volume number

Volume required to achieve the tier

makerFee number

Maker fee

takerFee number

Taker fee

PUT[host]/back-api/backoffice/tiers/tier/{tier_id}

PUT /back-api/backoffice/tiers/tier/3 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "description": "fourth tier",
  "volume": 100000000,
  "maker_fee": 0.005,
  "taker_fee": 0.006
}

Response

id number

Tier identifier

description string

Tier description

volume number

Volume required to achieve the tier

makerFee number

Maker fee

takerFee number

Taker fee

tier_group_id number

Tier group identifier

RESPONSE EXAMPLE
{
  "id": 3,
  "description": "fourth tier",
  "volume": 100000000,
  "maker_fee": 0.005,
  "taker_fee": 0.006,
  "tier_group_id": 1
}

Delete Tier

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

tier_id*

Tier identifier

DELETE[host]/back-api/backoffice/tiers/tier/{tier_id}

DELETE /back-api/backoffice/tiers/tier/3 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Get Tier Groups List

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/tiers/group

GET /back-api/backoffice/tiers/group HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

id number

Tier group identifier

description string

Tier group description

RESPONSE EXAMPLE
[
  {
    "id": 1,
    "description": "group for crypto-crypto instruments"
  }
]

Create Tier Group

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

description string

Tier group description

POST[host]/back-api/backoffice/tiers/group

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

{
  "description": "group for crypto-crypto instruments"
}

Response

id number

Tier group identifier

description string

Tier group description

RESPONSE EXAMPLE
{
  "id": 1,
  "description": "group for crypto-crypto instruments"
}

Update Tier Group

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

group_id

Tier group identifier

Body parameters:

description string

Tier group description

PUT[host]/back-api/backoffice/tiers/group/{group_id}

PUT /back-api/backoffice/tiers/group/1 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "description": "group for crypto-fiat instruments"
}

Response

id number

Tier group identifier

description string

Tier group description

RESPONSE EXAMPLE
{
  "id": 1,
  "description": "group for crypto-fiat instruments"
}

Delete Tier Group

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

group_id*

Tier group identifier

DELETE[host]/back-api/backoffice/tiers/group/{group_id}

DELETE /back-api/backoffice/tiers/group/1 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Get Tier Markets

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/tiers/market

GET /back-api/backoffice/tiers/market HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

marketId string

Tier market identifier

tierGroupId number

Tier group identifier

RESPONSE EXAMPLE
[
  {
    "marketId": "btc_eur",
    "tierGroupId": 1
  }
]

Add Market to Tier Group

Note

A market can be included only in one tier group. In case of adding the market to several groups, an error will be returned.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

tierGroupId number

Tier group identifier

marketId string

Market identifier

POST[host]/back-api/backoffice/tiers/market

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

{
  "tierGroupId": 1,
  "marketId": "btc_usd"
}

Response

tierGroupId number

Tier group identifier

marketId string

Market identifier

RESPONSE EXAMPLE
{
  "tierGroupId": 1,
  "marketId": "btc_usd"
}

Delete Market from Tier Group

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

market_id*

Tier market identifier

DELETE[host]/back-api/backoffice/tiers/market/{market_id}

DELETE /back-api/backoffice/tiers/market/btc_usd HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

In case of success, HTTP code 200 will be returned.


Role Commission Methods

Get Role Commissions

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/back-api/backoffice/roles/commission

GET /back-api/backoffice/roles/commission HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

id number

Role commission identifier

roleName string

User role. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

tierGroupId number

Tier group identifier

makerFee number

Maker fee, paid if the order adds liquidity

takerFee number

Taker fee, paid if the order removes liquidity

RESPONSE EXAMPLE
[
  {
    "id": 1,
    "roleName": "Trader",
    "tierGroupId": 1,
    "makerFee": 0.1,
    "takerFee": 0.2
  }
]

Create Role Commission

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

roleName string

User role. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

tierGroupId number

Tier group identifier

makerFee number

Maker fee, paid if the order adds liquidity

takerFee number

Taker fee, paid if the order removes liquidity

POST[host]/back-api/backoffice/roles/commission

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

{
  "roleName": "Trader",
  "tierGroupId": 1,
  "makerFee": 0.2,
  "takerFee": 0.3
}

Response

The following responses are possible:

  • In case of success, HTTP code 200 will be returned

  • In case if roleName or tierGroupId are not found, HTTP code 404 will be returned


Update Role Commission

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

role_commission_id

Role commission identifier

Body parameters:

id number

Role commission identifier

roleName string

User role. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

tierGroupId number

Tier group identifier

makerFee number

Maker fee, paid if the order adds liquidity

takerFee number

Taker fee, paid if the order removes liquidity

PUT[host]/back-api/backoffice/roles/commission/{role_commission_id}

PUT /back-api/backoffice/roles/commission/1 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "id": 1,
  "roleName": "Trader",
  "tierGroupId": 1,
  "makerFee": 0.2,
  "takerFee": 0.3
}

Response

The following responses are possible:

  • In case of success, HTTP code 200 will be returned

  • In case if id, roleName or tierGroupId are not found, HTTP code 404 will be returned


Delete Role Commission

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

role_commission_id

Role commission identifier

DELETE[host]/back-api/backoffice/roles/commission/{role_commission_id}

DELETE /back-api/backoffice/roles/commission/1 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

The following responses are possible:

  • In case of success, HTTP code 200 will be returned

  • In case if role_commission_id is not found, HTTP code 404 will be returned


PnL Methods

Get Assets PnL

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Min is used

to

Final date, to which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Max is used

user

Optional filter by username or email

GET[host]/back-api/backoffice/pnl/assets

GET /back-api/backoffice/pnl/assets
    ?from=2020-09-01
    &to=2020-10-01
    &user=user@mailexample.com HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

assetPnl array

The array of asset objects. Each object contains the following fields:

asset string

Asset name

balance string

User asset balance

balanceInRootAsset string

User asset balance in the root currency of the exchange. Latest rate is used for calculation

tradedVolume string

Traded volume on the asset

tradedVolumeInRootAsset string

Traded volume on the asset in the root currency of the exchange. Latest rate is used for calculation

commission string

Total commission paid on the asset

commissionInRootAsset string

Total commission paid on the asset in the root currency of the exchange. Latest rate is used for calculation

pnl string

Equals to realizedPnl

pnlInRootAsset string

Equals to realizedPnl

realizedPnl string

User realized PnL in the root currency of the exchange. Operations rate is used for calculation

unrealizedPnl string

User unrealized PnL in the root currency of the exchange. Average date rate is used for calculation

rootAsset string

Root asset of the exchange

RESPONSE EXAMPLE
{
  "assetsPnl": [
    {
      "asset": "btc",
      "balance": "2002247250025.19922623",
      "balanceInRootAsset": "98264122737056631.94463428",
      "tradedVolume": "747821.84629745",
      "tradedVolumeInRootAsset": "36700790918.35441147",
      "commission": "392787.83797129",
      "commissionInRootAsset": "19276816247.11842812",
      "pnl": "24562.80353902",
      "realizedPnl": "1205466678.35036720",
      "unrealizedPnl": "20000959450732697.26175941",
      "pnlInRootAsset": "1205466678.35036720"
      }
    ],
  "rootAsset": "usd"
}

Get Users PnL

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body parameters:

from string

Starting date, from which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Min is used

to string

Final date, to which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Max is used

page number

Page number (for partial results display)

perPage number

Number of records per page

roles array

Array of user roles. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

user string

Filter by username or email

GET[host]/back-api/backoffice/pnl/users

GET /back-api/backoffice/pnl/users
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

{
  "from":"2020-09-21T17:13:52.5444915Z",
  "to":null,
  "page":1,
  "perPage":10,
  "roles":["Trader"],
  "user":"usernameExample"
}

Response

usersPnl array

Array of users. Each element contains the following fields:

user string

User email address

userId string

User identifier

userRoles array

Array of user roles

activityStatus number

User status. Possible values:

  • 0 — Active

  • 1 — Frozen

  • 2 — Terminated

balanceInRootAsset string

User total balance in the root currency of the exchange. Latest rate is used for calculation

tradedVolumeInRootAsset string

User total traded volume in the root currency of the exchange. Latest rate is used for calculation

commissionInRootAsset string

User total commission paid in the root currency of the exchange. Latest rate is used for calculation

pnlInRootAsset string

Equals to realizedPnl

realizedPnl string

User realized PnL. Operations rate is used for calculation

unrealizedPnl string

User unrealized PnL. Average date rate is used for calculation

rootAsset string

Root asset of the exchange

RESPONSE EXAMPLE
{    
  "paging": {
    "page": 1,
    "per_page": 10,
    "total": 1
  },
    "usersPnl": [
      {
        "user": "user1@mailexample.com",
        "userId": "e596e2c4-e376-3599-0d44-8dd5678a25bc",
        "userRoles": ["Trader"],
        "activityStatus": 0,
        "balanceInRootAsset": "0.00000001",
        "tradedVolumeInRootAsset": "0.0000044",
        "commissionInRootAsset": "0.00000001",
        "realizedPnl": "0.00000001",
        "unrealizedPnl": "0.00000001",
        "pnlInRootAsset": "0.00000001"
      },
      {
        "user": "user2@mailexample.com",
        "userId": "c9a2a84a-e392-1612-8cba-fbba12346029",
        "userRoles": ["Trader"],
        "activityStatus": 0,
        "balanceInRootAsset": "0.00000001",
        "tradedVolumeInRootAsset": "0.0000084",
        "commissionInRootAsset": "0.0000001",
        "realizedPnl": "0.00000001",
        "unrealizedPnl": "0.00000001",
        "pnlInRootAsset": "0.0000001"
      }
    ],
  "rootAsset": "usd"
}

Get Total Aggregated PnL

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Min is used

to

Final date, to which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Max is used

GET[host]/back-api/backoffice/pnl/total

GET /back-api/backoffice/pnl/total
    ?from=2020-09-01
    &to=2020-10-01 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

rootAsset string

Root asset of the exchange

pnl string

Equals to totalRealizedPnl

pnlInRootAsset string

Equals to totalRealizedPnl

totalRealizedPnl string

Total aggregated realized PnL in the root currency of the exchange. Operations rate is used for calculation

totalUnrealizedPnl string

Total aggregated unrealized PnL in the root currency of the exchange. Average date rate is used for calculation

tradedVolume string

Equals to tradedVolumeInRootAsset

tradedVolumeInRootAsset string

Total aggregated traded volume in the root currency of the exchange. Latest rate is used for calculation

commission string

Equals to commissionInRootAsset

commissionInRootAsset string

Total aggregated paid commission in the root currency of the exchange. Latest rate is used for calculation

assets array

Array of assets. Each element may contain (depending on if the RateToRootAsset is set) the following fields:

assetId string

Asset identifier

rateToRootAsset string

The rate of asset to root asset calculation

totalPnl string

Equals to totalRealizedPnl

totalPnlInRootAsset string

Equals to totalRealizedPnl

totalRealizedPnl string

Asset aggregated realized PnL in the root currency of the exchange. Operations rate is used for calculation

totalUnrealizedPnl string

Asset aggregated unrealized PnL in the root currency of the exchange. Average date rate is used for calculation

totalVolume string

Total traded volume on the asset

totalVolumeInRootAsset string

Total traded volume on the asset in the root currency of the exchange

totalCommission string

Total paid commission on the asset

totalCommissionInRootAsset string

Total paid commission on the asset in the root currency of the exchange

RESPONSE EXAMPLE
{
  "rootAsset": "usd",
  "pnl": "0.00000001",
  "pnlInRootAsset": "0.00000001",
  "totalRealizedPnl": "0.00000001",
  "totalUnrealizedPnl": "0.00000001",
  "tradedVolume": "0.00000001",
  "tradedVolumeInRootAsset": "0.00000001",
  "commission": "0.00000001",
  "commissionInRootAsset": "0.00000001",
  "assets": [
    {
      "assetId": "btc",
      "rateToRootAsset": "3.00000001",
      "totalPnl": "0.00000001",
      "totalPnlInRootAsset": "0.00000001",
      "totalRealizedPnl": "0.00000001",
      "totalUnrealizedPnl": "0.00000001",
      "totalVolume": "0.00000001",
      "totalVolumeInRootAsset": "0.00000001",
      "totalCommission": "0.00000001",
      "totalCommissionInRootAsset": "0.00000001"
    },
    {
      "assetId": "usd",
      "rateToRootAsset": "1.00000001",
      "totalPnl": "0.00000001",
      "totalPnlInRootAsset": "0.00000001",
      "totalRealizedPnl": "0.00000001",
      "totalUnrealizedPnl": "0.00000001",
      "totalVolume": "0.00000001",
      "totalVolumeInRootAsset": "0.00000001",
      "totalCommission": "0.00000001",
      "totalCommissionInRootAsset": "0.00000001"
    }
  ]
}

Get User Actual PnL

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive data: YYYY-MM-DDThh:mm:ss. If not specified, DateTime.Min is used

user

Optional filter by username or email

asset

Optional filter by asset

GET[host]/back-api/backoffice/pnl/actual

GET /back-api/backoffice/pnl/actual
    ?from=2020-09-01
    &user=user@mailexample.com
    &asset=btc HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

usersPnl object

Array of users. Each element contains the following fields:

user string

User email address

userId string

User identifier

userRoles array

Array of user roles

activityStatus number

User status. Possible values:

  • 0 — Active

  • 1 — Frozen

  • 2 — Terminated

balanceInRootAsset string

User total balance in the root currency of the exchange. Latest rate is used for calculation

tradedVolumeInRootAsset string

User total traded volume in the root currency of the exchange. Latest rate is used for calculation

commissionInRootAsset string

User total commission paid in the root currency of the exchange. Latest rate is used for calculation

pnlInRootAsset string

Equals to realizedPnl

realizedPnl string

User realized PnL. Operations rate is used for calculation

unrealizedPnl string

User unrealized PnL. Average date rate is used for calculation

rootAsset string

Root asset of the exchange

RESPONSE EXAMPLE
{
  "usersPnl": [
    {
      "user": "user1@mailexample.com",
      "userId": "e596e2c4-e376-3599-0d44-8dd3792a25bc",
      "userRoles": ["Trader"],
      "activityStatus": 0,
      "balanceInRootAsset": "1.00000001",
      "tradedVolumeInRootAsset": "0.0000044",
      "commissionInRootAsset": "1.00000000",
      "realizedPnl": "0.00000001",
      "unrealizedPnl": "0.00000001",
      "pnlInRootAsset": "0.00000001"
    }
  ],
  "rootAsset": "usd"
}

Audit Methods

Get Audit Log

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from

Starting date, from which you want to receive logs

to

Final date, to which you want to receive logs, should be greater than from

user

Username or email

type

Operation type

role

User role. Available values:

  • Vip

  • Hedging

  • User

  • Demo

  • Trader

  • Market-Maker

  • NoCommission

  • Support

  • Admin

  • Bot

cursor

Page number

GET[host]/back-api/backoffice/audit

GET /back-api/backoffice/audit
    ?from=2020-09-01
    &to=2020-10-01
    &user=user@mailexample.com
    &type=users
    &role=Admin HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

id string

Audit record identifier

timestamp string

Timestamp

email string

User email

roles array

Array of user roles assigned to the user

operationType string

Operation type

operationInformation string

Operation description

context string

Operation description context

registered string

Date and time of user registration

lastLogin string

Date and time of user last login

RESPONSE EXAMPLE
"paging": {,
  "next": 2,
  "prev": 0
  },
  "data": [
    {
      "id": 1,
      "timestamp": "2020-09-02T10:11:49.282907",
      "email": "admin@mailexample.com",
      "roles": ["Admin"],
      "operationType": "Users",
      "operationInformation": "Role ‘User' was added for user 'user@mailexample.com’.",
      "context": "BackOffice",
      "registered": "2020-09-02T10:09:34.198912",
      "lastLogin": "2020-09-02T10:10:45.975433"
    }
  ]

Antifraud Methods

Get User Trades

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

period*

Trading period. Possible values:

  • minute

  • minute3

  • minute5

  • day (should be used only for a single user)

user

Optional filter by username or email

cursor

Page number

GET[host]/back-api/antifraud/trades/{period}

GET /back-api/antifraud/trades/minute HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

userId string

User identifier

tradesCount number

Number of trades for the specified period

RESPONSE EXAMPLE
{
  "paging": {
    "next": "0",
    "prev": "-1"
  },
  "data": [
    {
      "userId": "a9fa79b8-386b-4985-1234-b0c2c5bd2e0e",
      "tradesCount": 3
    },
    {
      "userId": "dddfcbfa-2533-ad89-5678-f198a8873db3",
      "tradesCount": 8
    }
  ]
}

Get Arbitrage Polygon

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

period*

Trading period. Possible values:

  • minute

  • minute3

  • minute5

  • day (should be used only for a single user)

user

Optional filter by username or email

cursor

Page number

GET[host]/back-api/antifraud/arbitrages{period}

GET /back-api/antifraud/arbitrages/minute HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g

Response

email string

User identifier

arbitrage object

The list of arbitrages. Each arbitrage is displayed as a succession of user operations on markets

Operations on markets object

The succession of user operations on markets. Each object contains the following data:

amount number

Amount of asset in the order

lastOrderDate string

Date and time of the last order

instrument string

Currency pair

orderSide string

Order side: buy or sell

RESPONSE EXAMPLE
{
  "paging": {
    "next": "1",
    "prev": "-1"
  },
  "data": [
    {
      "email": "user@mailexample.com",
      "arbitrage": {
        "Buy bch_usd->Sell bch_btc->Sell btc_usd": [
          {
            "amount": 1,
            "lastOrderDate": "2021-02-11T12:56:20.876671Z",
            "instrument": "bch_usd",
            "orderSide": "Buy"
          },
          {
            "amount": 1,
            "lastOrderDate": "2021-02-11T12:56:01.425742Z",
            "instrument": "bch_btc",
            "orderSide": "Sell"
          },
          {
            "amount": 1,
            "lastOrderDate": "2021-02-11T12:56:15.115638Z",
            "instrument": "btc_usd",
            "orderSide": "Sell"
          }
        ]
      }
    }
}

Trading API

Overview

Platform provides both HTTP and WebSocket APIs for interacting with the exchange. Both allow read access to public market data and private read access to your account. Private write access to your account is available via the private API.

The public HTTP endpoint is accessed via GET requests while the private endpoint is accessed via HMAC-SHA512 signed POST requests using API keys. Both types of HTTP endpoints return results in JSON format. All endpoints are relative to the host name. Host name along with your admin credentials are configured when setting up the exchange.

The WebSocket API allows pushing notifications about the public order books and your private account. Similar to the HTTP API, it requires HMAC-SHA512 signed requests using API keys for requests related to your private account.

Required fields are marked with *.

Private API

All REST requests must contain two HTTP headers:

  • "Key": public key

  • "Sign": hash of payload

API keys are UUID string (UTF-8), for example: “ca3a03e1-fc5c-4954-99dc-876db3997d8f”. API keys are obtained through Trader’s Room: Profile > API Keys Management. The payload is a JSON body. For hashing the HMAC-SHA512 algorithm is used.

Some requests must include the following fields:

  • ts — a string representation of the current time in UTC Date and time, for example: “2019-12-20T08:20:51”

  • nonce — any 64-bit integer value. Must be unique every 22 second time interval in the frame of the used public key (for example, if nonce=12345 was used now, then the next time it can be used only in 22 seconds)

API Rate Limits

  • /frontoffice/* — 1 request per second

  • /marketdata/* — 2 requests per second


Public REST Methods

Supported Instruments

Returns information on all currency pairs supported by the exchange.

Request

No parameters.

GET[host]/frontoffice/api/info

GET /frontoffice/api/info HTTP/1.1
Host: host.name

Response

baseAsset string

Base asset

quoteAsset string

Quote asset

hidden number

Instrument availability: 0 — available, 1 — hidden (trading is not recommended, because this instrument may be preparing to disconnect)

status string

Instrument status: open, paused (cannot be traded), halted (cannot be traded, orders are cancelled)

makerFee number

Maker fee, paid if the order adds liquidity

makerFeeLimit number

Minimum maker fee value

takerFee number

Taker fee, paid if the order removes liquidity

takerFeeLimit number

Minimum taker fee value

priceScale number

Price step

amountScale number

Volume step

createdAt string

Date and time of instrument creation: YYYY-MM-DDThh:mm:ss

updatedAt string

Date and time of instrument last update: YYYY-MM-DDThh:mm:ss

RESPONSE EXAMPLE
{
  "serverTime": 636880696809972288,
  "pairs": {
    "btc_usdt": {
      "baseAsset": "btc",
      "quoteAsset": "usdt",
      "status": "Open",
      "hidden": 0,
      "makerFee": 0,
      "makerFeeLimit": 0,
      "takerFee": 0.001,
      "takerFeeLimit": 0,
      "priceScale": 6,
      "amountScale": 6,
      "createdAt": "2019-11-14T16:18:49.253354",
      "updatedAt": "2019-11-14T16:18:49.253354"
    },
    "gnt_usdt": {
      "baseAsset": "gnt",
      "quoteAsset": "usdt",
      "status": "Open",
      "hidden": 0,
      "makerFee": 0,
      "makerFeeLimit": 0,
      "takerFee": 0.001,
      "takerFeeLimit": 0,
      "priceScale": 5,
      "amountScale": 5,
      "createdAt": "2019-11-14T16:18:49.253354",
      "updatedAt": "2019-11-14T16:18:49.253354"
    }
  }
}

Order Book Snapshot

Returns order book for a specified currency pair.

Request

Path parameters:

instrument* string

Instrument identifier: {baseAsset}_{quoteAsset}

GET[host]/marketdata/instruments/{instrument}/depth

GET /marketdata/instruments/eth_btc/depth HTTP/1.1
Host: host.name

Response

instrument string

Instrument identifier, same as in the request

bids array

Each element represents one particular order and contains number fields amount and price

asks array

Each element represents one particular order and contains number fields amount and price

version number

Current snapshot version

askTotalAmount number

Sum of all ask orders

bidTotalAmount number

Sum of all bid orders

snapshot boolean

This is a self-contained snapshot (always true for this request)

RESPONSE EXAMPLE
{
  "instrument": "eth_btc",
  "bids": [
    {
      "amount": 0.3092258,
      "price": 0.01734264
    },
    {
      "amount": 51.61494099,
      "price": 0.01734363
    }
  ],
  "asks": [
    {
      "amount": 133.52370356,
      "price": 0.01739337
    },
    {
      "amount": 9.16854518,
      "price": 0.01739838
    }
  ],
  "version": 1891724,
  "askTotalAmount": 1849.11363582,
  "bidTotalAmount": 809.23878372,
  "snapshot": true
}

Instrument Candles

Returns a candlesticks graph for a specified currency pair.

Request

Path parameters:

instrument* string

Instrument identifier: {baseAsset}_{quoteAsset}

Query parameters:

startDate* string

Date and time of period start: YYYY-MM-DDThh:mm:ss

endDate* string

Date and time of period end: YYYY-MM-DDThh:mm:ss

type* string
Timeframe, the following values are avaliable:
  • 1m — 1 Minute

  • 5m — 5 Minutes

  • 15m — 15 Minutes

  • 30m — 30 Minutes

  • 1h — 1 Hour

  • 12h — 12 Hours

  • 1d — 1 Day

  • 1w — 1 Week

  • 1M — 1 Month

count number

Number of candles to return, defaults to 1000 (maximum value)

GET[host]/marketdata/instruments/{instrument}/depth

GET /marketdata/instruments/btc_usdt/history?startDate=2019-03-13T09:00:00&endDate=2019-03-13T11:00:00&type=1h&count=2 HTTP/1.1
Host: host.name

Response

instrument string

Same as in the request

start string

Same as in the request

end string

Same as in the request

low number

Lowest price

high number

Highest price

volume number

Total volume

quoteVolume number

Total quote asset volume

open number

Open price

close number

Close price

RESPONSE EXAMPLE
{
  "success": true,
  "instrument": "btc_usdt",
  "data": [
    {
      "instrument": "btc_usdt",
      "start": "2019-03-13T09:00:00Z",
      "end": "2019-03-13T10:00:00Z",
      "low": 3842.855,
      "high": 3855.445,
      "volume": 4,
      "quoteVolume": 0,
      "open": 3855.105,
      "close": 3842.855
    },
    {
      "instrument": "btc_usdt",
      "start": "2019-03-13T10:00:00Z",
      "end": "2019-03-13T11:00:00Z",
      "low": 3834.355,
      "high": 3848.855,
      "volume": 26,
      "quoteVolume": 0,
      "open": 3842.865,
      "close": 3835.655
    }
  ],
  "startDateTime": "2019-03-13T09:00:00Z",
  "endDateTime": "2019-03-13T11:00:00Z"
}

Asset Info

Returns assets information.

Request

No parameters.

GET[host2]/asset

GET /asset HTTP/1.1
Host: host.name

Response

name string

Asset name

can_withdraw string

If true, the asset can be withdrawn

can_deposit string

If true, the asset can be deposited

min_withdraw string

Minimum withdrawal/deposit amount

max_withdraw string

Minimum withdrawal/deposit amount

RESPONSE EXAMPLE
{
  "BTC": {
    "name": "btc",
    "can_withdraw": true,
    "can_deposit": true,
    "min_withdraw": "0.00000001",
    "max_withdraw": "100000000"
  },
  "USDT": {
    "name": "usdt",
    "can_withdraw": true,
    "can_deposit": true,
    "min_withdraw": "0.00000001",
    "max_withdraw": "100000000"
  }
}

Summary

Returns summary information.

Request

No parameters.

GET[host2]/summary

GET /summary HTTP/1.1
Host: host.name

Response

id string

Market identifier

last string

Price of the last trade in the last 24 hours. If the deal was more than 24 hours ago: 0

lowestAsk string

Current lowest ask price

highestBid string

Current highest bid price

percentChange string

Price change in the last 24 hours

baseVolume string

All traded volume in the last 24 hours in base currency

quoteVolume string

All traded volume in the last 24 hours in quote currency

isFrozen string

Market status: 0 — working, 1 — temporarily suspended

high24hr string

Maximum trade price in the last 24 hours

low24hr string

Minimum trade price in the last 24 hours

RESPONSE EXAMPLE
{
  "BTC_USDT": {
    "id": "btc_usdt",
    "last": "10978.93578",
    "lowestAsk": "10979.0",
    "highestBid": "10978.71",
    "percentChange": "0.0813730364297798727996051454",
    "baseVolume": "6.47119743",
    "quoteVolume": "70829.9781692126756",
    "isFrozen": "0",
    "high24hr": "10985.0049",
    "low24hr": "10857.95376"
  },
  "BTC_USD": {
    "id": "btc_usd",
    "last": "0",
    "lowestAsk": "0",
    "highestBid": "0",
    "percentChange": "0",
    "baseVolume": "0",
    "quoteVolume": "0",
    "isFrozen": "0",
    "high24hr": "0",
    "low24hr": "0"
  }
}

Ticker Info

Returns ticker information.

Request

No parameters.

GET[host2]/ticker

GET /ticker HTTP/1.1
Host: host.name

Response

base_name string

Base asset name

quote_name string

Quote asset name

last_price string

Price of the last trade in the last 24 hours. If the deal was more than 24 hours ago: 0

base_volume string

All traded volume in the last 24 hours in base currency

quote_volume string

All traded volume in the last 24 hours in quote currency

isFrozen string

Market status: 0 — working, 1 — temporarily suspended

RESPONSE EXAMPLE
{
  "dash_btc": {
    "base_name": "dash",
    "quote_name": "btc",
    "last_price": "0",
    "base_volume": "0",
    "quote_volume": "0",
    "isFrozen": "1"
  },
  "eth_usdt": {
    "base_name": "eth",
    "quote_name": "usdt",
    "last_price": "423.9936",
    "base_volume": "2942.97774",
    "quote_volume": "1273092.080666887",
    "isFrozen": "0"
  }
}

Trades Info

Returns all trades for a specified instrument in the last 24 hours.

Request

Path parameters:

instrument* string

Instrument identifier: {baseAsset}_{quoteAsset}

GET[host2]/trades/{instrument}

GET /trades/btc_usd HTTP/1.1
Host: host.name

Response

tradeID string

Trade identifier

price string

Trade price

base_volume string

Amount in base currency

quote_volume string

Amount in quote currency

trade_timestamp string

Datetime of the trade in the UNIX timestamp format

type string

Trade side: "buy" or "sell"

RESPONSE EXAMPLE
[
  {
    "tradeID": "1247307",
    "price": "10093.92246491",
    "base_volume": "0.0259",
    "quote_volume": "261.432591841169",
    "trade_timestamp": "1599577070",
    "type": "buy"
  },
  {
    "tradeID": "1247309",
    "price": "10091.69185435",
    "base_volume": "0.0754",
    "quote_volume": "760.913565817990",
    "trade_timestamp": "1599577128",
    "type": "sell"
  }
]

Private REST Methods

Place an Order

Places a new order.

Request

Request must contain ts and nonce values.

Body parameters:

instrument* string

Order instrument identifier: {baseAsset}_{quoteAsset}

type* string

Order side: "buy" or "sell"

amount* number

Order amount, must be greater than 0

price number

Order price. Required for limit orders, optional for market orders. If isLimit is true, must be greater than 0, in other cases can be equal to 0

isLimit boolean

If true, the order is limit. If false, the order is market. Ref. to Flags Combinations for details

isStop boolean Currently not supported

If true, the order is stop market or stop limit (depending on isLimit value). Ref. to Flags Combinations for details

isFok boolean

If true, the order must be executed immediately or be cancelled if not filled. Ref. to Flags Combinations for details

activationPrice number Currently not supported

Required and applicable only if isStop is true

clientOrderId number

Client provided order identifier: any UUID, except for 00000000-0000-0000-0000-000000000000. Must be unique within the open orders of this client, which means it is impossible to place an order with clientOrderId if there is already an open order with the same clientOrderId

POST[host]/frontoffice/api/order

POST /frontoffice/api/order HTTP/1.1
Host: host.name
Key: 7fa6ceec-d8fc...
Sign: 7ae49b5b-99db...

{
  "ts": "2019-12-12T01:01:01",
  "nonce": 4,
  "order": {
    "instrument": "btc_usdt",
    "type": "sell",
    "amount": 1,
    "price": 1,
    "isLimit": true,
    "isStop": false,
    "isFok": false,
    "activationPrice": 0,
    "clientOrderId": "6fdf688e-00b0-4c68-82dd-3aee5c727ed1"
  }
}
const crypto = require('crypto');
const https = require('https');
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Host = "host.name"; // Change to your host name
const Port = 8443;
const Method = '/trading/frontoffice/api/order'
const Payload = new Date().toISOString();
const body = {
  ts: Payload,
  nonce:1,
  order: {
    instrument: 'eth_usd',
    type: 'buy',
    amount: 1,
    price: 1,
    isLimit: true
  }
};
const data = JSON.stringify(body);
const Sign = crypto
  .createHmac('sha512', Secret)
  .update(data)
  .digest('hex')
  .toUpperCase();
const options = {
  hostname: Host,
  path: Method,
  port: Port,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Key,
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
    Sign
  }
};
const req = https.request(options, res => {
  console.log(`statusCode: ${res.statusCode}`);
  res.on('data', d => {
    process.stdout.write(d);
  });
});
req.on('error', e => {
  console.error(e);
});
req.write(data);
req.end();

Response

Returns Order Object.


Cancel an Order

Cancels the order.

Request

Request must contain ts and nonce values.

Path parameters:

id* string

Order identifier: either orderId — same as in the response message generated with Place an Order request, or clientOrderId — same as in the Place an Order request

DELETE[host]/frontoffice/api/orders/{id}

DELETE /frontoffice/api/orders/-72057594037927933&ts=2019-12-12T01:01:01&nonce=4 HTTP/1.1
Host: host.name
Key: 7fa6ceec-d8fc...
Sign: 7ae49b5b-99db...
const crypto = require('crypto');
const https = require('https');
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Host = "host.name"; // Change to your host name
const Port = 8443;
const Payload = new Date().toISOString();
const OrderId = '-72057594037927933';
const Method = `/trading/frontoffice/api/orders?OrderId=${OrderId}&ts=${Payload}&nonce=2`
async function deleteOrder() {
  const Sign = crypto
    .createHmac('sha512', Secret)
    .update(`?OrderId=${OrderId}&ts=${Payload}&nonce=2`)
    .digest('hex')
    .toUpperCase();
  const options = {
    hostname: Host,
    path: Method,
    port: Port,
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
      'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
      Key,
      Sign
    }
  };
  const req = https.request(options, res => {
    console.log(`statusCode: ${res.statusCode}`);
    console.log(`statusMessage: ${res.statusMessage}`);
    res.on('data', d => {
      process.stdout.write(d);
    });
  });
  req.on('error', e => {
    console.error(e);
  });
  req.end();
}
deleteOrder().catch(err => {
  console.log(err);
});

Response

Returns Order Object.


Orders History

Returns the orders history.

Request

Request must contain ts and nonce values.

Query parameters:

market string

Market orders filter: currency pair (for example: btc_usdt)

side string

Order side: either buy or sell

status string

Order status: Working, Rejected, Cancelled, Completed

startDate string

Date and time of period start: YYYY-MM-DDThh:mm:ss.s

endDate string

Date and time of period end: YYYY-MM-DDThh:mm:ss.s

GET[host]/frontoffice/api/order_history

GET /frontoffice/api/order_history?market=btc_usdt&ts=2019-12-12T01:01:01&nonce=4 HTTP/1.1
Host: host.name
Key: 7fa6ceec-d8fc...
Sign: 7ae49b5b-99db...
const crypto = require('crypto');
const https = require('https');
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Host = "host.name"; // Change to your host name
const Payload = new Date().toISOString();
const Method = `/trading/frontoffice/api/order_history?ts=${Payload}&market=btc_usd&nonce=4`;
async function GetOrders() {

    const Sign = crypto
        .createHmac('sha512', Secret)
        .update(`?ts=${Payload}&market=btc_usd&nonce=4`)
        .digest('hex')
        .toUpperCase();
    const options = {
        hostname: Host,
        port: Port,
        path: Method,
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
            Key,
            Sign
        }
    };
    const req = https.request(options, res => {
        console.log(`statusCode: ${res.statusCode}`);
        console.log(`statusMessage: ${res.statusMessage}`);
        res.on('data', d => {
            process.stdout.write(d);
        });
    });
    req.on('error', e => {
        console.error(e);
    });
    req.end();
}

GetOrders().catch(err => {
    console.log(err);
});

Response

Returns an array of Order Objects.


Trades History

Returns the trades history.

Request

Request must contain ts and nonce values.

Query parameters:

orderId number

Order identifier, by which it is possible to get information about all related trades

market string

Market orders filter: currency pair (for example: btc_usdt)

side string

Order side: buy or sell

startDate string

Date and time of period start: YYYY-MM-DDThh:mm:ss.s

endDate string

Date and time of period end: YYYY-MM-DDThh:mm:ss.s

GET[host]/frontoffice/api/trade_history

GET /frontoffice/api/trade_history?market=btc_usdt&ts=2019-12-12T01:01:01&nonce=4 HTTP/1.1
Host: host.name
Key: 7fa6ceec-d8fc...
Sign: 7ae49b5b-99db...
const crypto = require('crypto');
const https = require('https');
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Host = "host.name"; // Change to your host name
const Payload = new Date().toISOString();
const Method = `/trading/frontoffice/api/order_history?ts=${Payload}&market=btc_usd&nonce=4`;
async function GetOrders() {

    const Sign = crypto
        .createHmac('sha512', Secret)
        .update(`?ts=${Payload}&market=btc_usd&nonce=4`)
        .digest('hex')
        .toUpperCase();
    const options = {
        hostname: Host,
        port: Port,
        path: Method,
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
            Key,
            Sign
        }
    };
    const req = https.request(options, res => {
        console.log(`statusCode: ${res.statusCode}`);
        console.log(`statusMessage: ${res.statusMessage}`);
        res.on('data', d => {
            process.stdout.write(d);
        });
    });
    req.on('error', e => {
        console.error(e);
    });
    req.end();
}

GetOrders().catch(err => {
    console.log(err);
});

Response

tradeSeq number

Sequence number of the trade

tradeTime string

Date and time of the trade

amount number

Trade amount

executionPrice number

Trade execution price

instrument string

Trade instrument

side number

Trade side: 0 — buy, 1 — sell

commission number

Trade commission

orderId number

Order identifier of the trade

RESPONSE EXAMPLE
{
  "filters": {
    "market": "btc_usdt"
  },
  "paging": {
    "page": 1,
    "per_page": 15,
    "total": 0
  },
  "data": [
    {
      "tradeSeq": 0,
      "tradeTime": "2019-12-20T06:17:03.093597",
      "amount": 0.00000001,
      "executionPrice": 0.00000001,
      "instrument": "btc_usdt",
      "side": 0,
      "commission": 0.00000000,
      "orderId": -72057593704402280
    },
    {
      "tradeSeq": 3927,
      "tradeTime": "2019-12-20T06:17:03.093597",
      "amount": 0.00000001,
      "executionPrice": 0.00000001,
      "instrument": "btc_usdt",
      "side": 1,
      "commission": 0.00000000,
      "orderId": -72057593704402281
    }
  ]
}

User Balance

Returns information on full and locked balances for each asset.

Request

Request must contain ts and nonce values.

No parameters.

GET[host]/frontoffice/api/balances

GET /frontoffice/api/balances HTTP/1.1
Host: host.name
Key: 7fa6ceec-d8fc...
Sign: 7ae49b5b-99db...
const crypto = require('crypto');
const https = require('https');
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Host = "host.name"; // Change to your host name
const Port = 8443;
const Payload = new Date().toISOString();
const Method = `/frontoffice/api/balances?ts=${Payload}&nonce=6`;
async function GetBalances() {
  const Sign = crypto
    .createHmac('sha512', Secret)
    .update(`?ts=${Payload}&nonce=6`)
    .digest('hex')
    .toUpperCase();
  const options = {
    hostname: Host,
    port: Port,
    path: Method,
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
      Key,
      Sign
    }
  };
  const req = https.request(options, res => {
    console.log(`statusCode: ${res.statusCode}`);
    console.log(`statusMessage: ${res.statusMessage}`);
    res.on('data', d => {
      process.stdout.write(d);
    });
  });
  req.on('error', e => {
    console.error(e);
  });
  req.end();
}
GetBalances().catch(err => {
  console.log(err);
});

Response

asset string

Asset name

balance number

Full balance

locked number

Locked amount

RESPONSE EXAMPLE
[
  {
    "asset": "btc",
    "balance": 10.0,
    "locked": 0.0
  },
  {
    "asset": "usdt",
    "balance": 80000.0,
    "locked": 7.0
  }
]

Order Info

Returns order information by order id or client order id.

Request

Request must contain ts and nonce values.

Query parameters:

orderId* string

Order identifier: either orderId — same as in the response message generated with Place an Order request, or clientOrderId — same as in the Place an Order request

GET[host]/frontoffice/api/orders

GET /frontoffice/api/orders?orderId=-72057594037927933
    &ts=2019-12-12T01:01:01
    &nonce=4 HTTP/1.1
Host: host.name

Response

Returns Order Object.


My Orders Info

Returns information about the open orders of the current user.

Request

Request must contain ts and nonce values.

No parameters.

GET[host]/frontoffice/api/orders/my

GET /frontoffice/api/orders/my?ts=2019-12-12T01:01:01&nonce=4 HTTP/1.1
Host: host.name
Key: 7fa6ceec-d8fc...
Sign: 7ae49b5b-99db...

Response

Returns an array of Order Objects.


Public WebSocket Methods

Real-Time Order Book Data

Open connection with public hub: [host]/marketdata/info

Order book channel name is “Book”.

Attention

Upon subscription, a complete snapshot of a book will be sent (snapshot: true), after that all subsequent responses will contain only updates, not the whole book (snapshot: false).

REQUEST EXAMPLE
const { HubConnectionBuilder } = require("@microsoft/signalr"); // Package version must be >= 5.0.0

const url = "https://host.name/trading/marketdata/info"; // Change [host.name] to your host name
const instrument = "btc_usd";
const channel = 'Book';

let connection = new HubConnectionBuilder()
    .withUrl(url)
    .build();

connection.start().then(function () {
connection.stream(channel, instrument)
    .subscribe({
        next: (item) => {
		console.log(JSON.stringify(item));
        },
        error: (err) => {
            console.log(err);
        },
}); 
});

Real-Time Exchange Status

Open connection with public hub: [host]/status-api/status

One of the following exchange statuses is returned:

  • online

  • maintenance

  • down

RESPONSE EXAMPLE
    {
        "exchangeStatus":"maintenance",
    }

Private WebSocket Methods

Orders Data

Open connection with private hub: [host]/ws/account

Open orders channel name is “OpenOrders”.

Upon subscription, the following response will be sent (for details ref. to Place an Order response description).

REQUEST EXAMPLE
const { HubConnectionBuilder } = require("@microsoft/signalr"); // Package version must be >= 5.0.0
const crypto = require("crypto");
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Payload = new Date().toISOString();
	const Sign = crypto
	.createHmac('sha512', Secret)
	.update(Payload)
	.digest('hex')
	.toUpperCase();
const headers = {
    Key,
    Payload,
    Sign
};

const url = "https://host.name/trading/frontoffice/ws/account"; // Change [host.name] to your host name
const channel = "OpenOrders";
let connection = new HubConnectionBuilder()
    .withUrl(url, {headers: headers})
    .build();

connection.start().then(function () {
connection.stream(channel)
    .subscribe({
        next: (item) => {
		console.log(JSON.stringify(item));
        },
        error: (err) => {
            console.log(err);
        },
}); 
});

Real-Time Balances

Open connection with private hub: [host]/ws/account

Balance updates channel name is “FullBalance”.

Upon subscription, a JSON-structure with the following fields will be sent:

asset string

Asset name

amount number

Asset amount

balance number

Full balance

locked number

Locked amount

REQUEST EXAMPLE
const { HubConnectionBuilder } = require("@microsoft/signalr"); // Package version must be >= 5.0.0
const crypto = require("crypto");
const Key = "7fa6ceec-d8fc..."; // Change to your PublicKey
const Secret = "7ae49b5b-99db..."; // Change to your Secret
const Payload = new Date().toISOString();
	const Sign = crypto
	.createHmac('sha512', Secret)
	.update(Payload)
	.digest('hex')
	.toUpperCase();
const headers = {
    Key,
    Payload,
    Sign
};

const url = "https://host.name/trading/frontoffice/ws/account"; // Change [host.name] to your host name
const channel = "FullBalance";
let connection = new HubConnectionBuilder()
    .withUrl(url, {headers: headers})
    .build();

connection.start().then(function () {
connection.stream(channel, {})
    .subscribe({
        next: (item) => {
		console.log(JSON.stringify(item));
        },
        error: (err) => {
            console.log(err);
        },
}); 
});

Models

Order Object

updatedAt string

Date and time of the last update of the order

averageFillPrice number

Average order fill price

timeInForce string

Time in Force option of the order

clientOrderId number

Client order identifier

orderId number

System order identifier

total number

Total amount of quoted currency sold (quote amount)

orderType number

Order side: 0 — sell, 1 — buy

commission number

Commission in quoted currency

createdAt string

Date and time of order creation

unitsFilled number

Base amount

isPending boolean

If true, the order is active (not rejected, cancelled, or completed)

status string

Order status: Working, Rejected, Cancelled, Completed

type string

Order side: buy or sell

amount number

Order amount, must be greater than 0

remaining number

Remaining amount

price number

Obsolete. It is equal to executionPrice for Market and Stop orders, and requestedPrice for Stop orders

executionPrice number

Execution price of the order

requestedPrice number

Requested price of the order

isLimit boolean

If true, the order is limit. If false, the order is market.

isStop boolean

Currently not supported. If true, the order is stop market or stop limit (depending on isLimit value). Ref. to Flags Combinations for details

isFok boolean

If true, the order must be executed immediately or be cancelled if not filled. Ref. to Flags Combinations for details

instrument string

Order instrument identifier: {baseAsset}_{quoteAsset}

side string

Order side: 0 — buy, 1 — sell

ORDER OBJECT
{
  "order": {
    "updatedAt": "2020-06-19T11:21:30.532789",
    "averageFillPrice": "1000",
    "timeInForce": "GTC",
    "clientOrderId": "",
    "orderId": "-72057594037927934",
    "total": 100.0,
    "orderType": 0,
    "commission": 0.0001,
    "createdAt": "2020-06-19T11:21:30.532784Z",
    "unitsFilled": 0.1,
    "isPending": false,
    "status": "completed",
    "type": "buy",
    "amount": 0.1,
    "remaining": 0.0,
    "price": 1000.0,
    "executionPrice": 1000.0,
    "requestedPrice": 1000.0,
    "stopPrice": 0.0,
    "isLimit": true,
    "instrument": "btc_usdt",
    "side": 0
  }
}

Flags Combinations

Order

Description

Flags

Limit

Limit order

isLimit is true, isStop is false, isFok is false

Market (Market IOK)

Market order (Immediate-or-Cancel market order) — order must be executed immediately and cancel any unfilled portion

isLimit is false, isStop is false, isFok is false

Market FOK

Fill-or-Kill market order — order must be executed immediately or cancelled if not filled

isLimit is false, isStop is false, isFok is true