Platform API¶
Overview¶
This document describes the requests and responses comprising the API used for managing the exchange configuration and retrieving its data.
In the examples that follow:
All endpoints are relative and resolved based on a specified host name.
Both the host name and your admin credentials are configured when setting up the exchange.
All methods are private.
All requests except for
Authorization
must contain the HTTP header:Authorization: Bearer <Access Token>
.The required fields are marked with *.
Methods for managing user access¶
Authentication occurs according to the SSO scheme (single sign-on) based on the OAuth 2.0 standard.
Sign in as an admin¶
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@mail.com",
password: "P@ssw0rd"
}
Response
- secondFactorRequired boolean
If
true
, an additional POST-request containing a 2FA code must be sent before proceeding with authorization.- message string
The notification message. Applicable only if
secondFactorRequired
istrue
.- provider string
The method of sending a one-time 2FA code. Applicable only if
secondFactorRequired
istrue
.
{
"secondFactorRequired": true,
"message": "For your security, we have emailed you a one-time authentication code. Please enter this code below to proceed.",
"provider": "Email"
}
Note
If authorization is successful, cookies are provided, which are valid only for a corresponding IdentityServer
.
Next, a request must be sent to obtain the xmlHttpRequest.responseURL
code.
Request
Query parameters:
The parameters are described in the OAuth 2.0 specification. The PKCE extension (Proof Key for Code Exchange) is used to further ensure session security.
- client_id *
The client identifier:
spa
— for Front Office only; the following scopes are available forspa
clients:openid offline_access FrontOffice
spa_admin
— for Front Office and Back Office; the following scopes are available forspa_admin
clients:openid offline_access FrontOffice BackOffice
- redirect_uri *
The absolute path to a
sign-in-done
page at theIdentityServer
address, which is used after successfully signing in (for example, https://host.name/sign-in-done). Relative paths are not supported.
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.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 URL is sent containing the required code, which is one-time and cannot be reused.
In case of incorrect input data, identity/unauthorized
is returned with HTTP code 401
.
Location: https://staging.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
To complete authorization, send another request to obtain the access and refresh tokens.
Request
Header parameters:
Content-Type: application/x-www-form-urlencoded
Authorization: Basic base64(ClientId:ClientSecret)
Query parameters:
The parameters are described in the OAuth documentation. An additional round trip to the server is required for code_verifier.
POST[host]/identity/connect/token
POST /identity/connect/token HTTP/1.1
Host: staging.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
The access token that expires in 30 seconds after which it must be refreshed.
- expires_in number
The access token expiration time, in μs.
- token_type string
Always
Bearer
.- refresh_token string
The long-living token which is used for obtaining new access tokens.
- scope string
The scope for a
spa
client.
{
"access_token": "eyJhbGci...0MkP_NUQ",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "4f6c4...676u67u6",
"scope": "FrontOffice offline_access openid"
}
Sign in using 2FA¶
If secondFactorRequired
is true
, an additional POST-request containing a one-time 2FA code must be sent to the same endpoint.
Request
Body:
- provider * string
The method of sending a one-time 2FA code.
- VerificationCode * string
The one-time 2FA code.
POST[host]/identity/sign-in
POST /identity/sign-in HTTP/1.1
Host: host.name
{
"provider": "Email",
"VerificationCode": "123456"
}
Response
In response, VerificationCode
is sent to the email specified in the request.
{
"secondFactorRequired": false,
"account": {
"nickname": "admin",
"email": "admin@mail.com",
"id": "8ac0a52e-f516-5bb2-009c-0ec8a23a9f49"
}
}
Sign in [Machine-to-Machine]¶
Important
This authentication method is for internal use only: it must only be used between trusted servers.
Two-factor authentication is not applicable for this authentication method.
Request
Header parameters:
Note
This endpoint does not support JSON in the request.
Content-Type: application/x-www-form-urlencoded
Authorization: Basic base64(ClientId:ClientSecret)
Query parameters:
The parameters are described in the OAuth specification.
- ClientId
The client identifier. The following values are supported:
lk
tests
- ClientSecret
The client secret. Please contact your exchange service provider to clarify this value for your environment.
- scope
The 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
The access token that expires in 30 seconds after which it must be refreshed.
- expires_in number
The access token expiration time, in μs.
- token_type string
Always
Bearer
.- refresh_token string
The long-living token which is used for obtaining new access tokens.
- scope string
The scope for a
spa
client.
{
"access_token": "eyJhbGci...0MkP_NUQ",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "4f6c4...676u67u6",
"scope": "FrontOffice offline_access openid"
}
Obtain the refresh token¶
Request
Header parameters:
Content-Type: application/x-www-form-urlencoded
Query parameters:
New tokens are obtained according to the OAuth 2.0 documentation. The 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
The access token that expires in 30 seconds after which it must be refreshed.
- expires_in number
The access token expiration time, in μs.
- token_type string
Always
Bearer
.- refresh_token string
The long-living token which is used for obtaining new access tokens.
{
"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 (the default lifetime is 30 seconds). The token should be removed from the client-side local storage.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- refresh_token string
If no refresh token is provided, all refresh tokens previously issued for the current user are revoked along with corresponding client identifiers (
clientId
). 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
is returned.
Methods for managing exchange users¶
Get a user list¶
Use this method to obtain a list of exchange users based on various criteria.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- Search
The username or email (to return entries matching this string).
- Type
The user category:
All
New
Verified
Unverified
Blocked
Admins
NoRoles
To obtain a list of users to which no roles are assigned, set this parameter to
NoRoles
. You can also set theRoles
parameter to include users with specific roles.- Roles array
The user roles. To obtain a list of users to which no roles have been assigned, set the
Type
parameter toNoRoles
.- Status string
The user profile status:
Active
Frozen
Terminated
- DepositDateFrom string
The date after which a deposit was made by a user:
YYYY-MM-DDThh:mm:ss
.Set the
DepositDateTo
parameter to specify the time range.- DepositDateTo string
The date before which a deposit was made by a user:
YYYY-MM-DDThh:mm:ss
.Set the
DepositDateFrom
parameter to specify the time range.- DepositAmountFrom number
The minimum amount deposited by a user.
Set the
DepositAmountTo
parameter to specify the amount range.- DepositAmountTo number
The maximum amount deposited by a user.
Set the
DepositAmountFrom
parameter to specify the amount range.- TradingVolumeFrom number
The minimum volume traded by a user.
Set the
TradingVolumeTo
parameter to specify the volume range.- TradingVolumeTo number
The maximum volume traded by a user.
Set the
TradingVolumeFrom
parameter to specify the volume range.- ActivePeriodFrom string
The date starting from which a user has been active on the exchange:
YYYY-MM-DDThh:mm:ss
.Set the
`ActivePeriodTo
parameter to specify the time range.- ActivePeriodTo string
The date ending at which a user has been active on the exchange:
YYYY-MM-DDThh:mm:ss
.Set the
ActivePeriodFrom
parameter to specify the time range.
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
, the user profile is assigned theActive
status, meaning that the user can log in to the exchange and interact with it.- isEmailConfirmed boolean
If
true
, the user email was confirmed.- isPhoneConfirmed boolean
If
true
, the user phone number was confirmed.- registrationDate string
The 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
The current user profile status.
- twoFactorEnabled boolean
If
true
, two-factor authentication is enabled for this user.- hasTradingApiKey boolean
If
true
, the user has API keys issued in the B2Core UI and is allowed to trade via API.- id string
The user identifier, in the GUID string format.
- email string
The user email.
- roles array
The roles assigned to a user.
- nickname string
The username which identifies a user on the exchange.
- country object
The country of registration:
- id string
The country identifier.
- name string
The country name.
- code string
The country code.
- lastSignInDate string
The date and time when a user has last been logged in to the system.
- createdAt string
The date and time when a user profile was created.
- firstName string
The user first name.
- lastName string
The user last name.
- countryId string
The country identifier.
- location string
The current user location based on the IP address:
- country string
The country name.
- code string
The country code.
{
"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\"}"
}
]
}
Register on the exchange¶
Use this method to create a new user profile on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- nickname * string
The username.
- email * string
The email that a user needs to specify to log in.
- password * string
The password that a user needs to specify 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@mail.com",
"password": "C0m9l&xP@ssw0rd"
}
Response
- id string
The user identifier, in the GUID string format.
- email string
The user email (as specified in the request).
- roles array
The roles assigned to a user. This value is empty for newly created user profiles.
- nickname string
The username (as specified in the request).
- createdAt string
The date and time when a user profile was created.
{
"id": "c8f521f5-9f34-44bc-9377-ec0c4786c333",
"email": "admin@mail.com",
"roles": [],
"nickname": "admin",
"createdAt": "2019-03-27T13:51:13.4039729Z"
}
Get user profile details¶
Use this method to obtain information about a specified user profile.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
When this parameter is not specified, the profile of the currently 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
, a user profile is assigned theActive
status, meaning that the user can log in to the exchange and interact with it.- isEmailConfirmed boolean
If
true
, the user email was confirmed.- isPhoneConfirmed boolean
If
true
, the user phone number was confirmed.- registrationDate string
The 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
The current user profile status.
- twoFactorEnabled boolean
If
true
, two-factor authentication is enabled for this user.- hasTradingApiKey boolean
If
true
, the user has active API keys issued in the B2Core UI and is allowed to trade via API.- id string
The user identifier, in the GUID string format.
- email string
The user email.
- roles array
The roles assigned to a user.
- nickname string
The username which identifies a user on the exchange.
- lastSignInDate string
The date and time when a user has last been logged in to the system.
- createdAt string
The date and time when a user profile was created.
{
"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"
}
}
Update user details¶
Use this method to update basic information about a user, as previously defined in the request body.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
Body:
- userName string
The username.
- firstName string
The user first name.
- lastName string
The user last name.
- middleName string
The user middle name.
- countryId string
The user country.
- comment string
The commentary to the profile update.
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
, the user profile is assigned theActive
status, meaning that the user can log in to the exchange and interact with it.- isEmailConfirmed boolean
If
true
, the user email was confirmed.- isPhoneConfirmed boolean
If
true
, the user phone number was confirmed.- registrationDate string
The 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
The current user profile status.
- twoFactorEnabled boolean
If
true
, two-factor authentication is enabled for this user.- id string
The user identifier, in the GUID string format.
- email string
The user email.
- nickname string
The username which identifies a user on the exchange.
- createdAt string
The date and time when a user profile was created.
{
"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 a user email¶
Use this method to update a user email that a user needs to specify to log in to the system.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
Body:
- email * string
The new email address.
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
is returned.
Change a user password¶
Use this method to update a user password that the user needs to specify to log in to the system.
Important
This operation can be performed only by users assigned the Admin role.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
Body:
- password * string
The new user 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
is returned.
Get a list of roles assigned to a user¶
Use this method to find out which roles are currently assigned to a specified user.
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
The role name.
- normalizedName string
For internal use.
- commissionType string
The commission settings associated with this role.
{
"paging": {
"page": 1,
"per_page": 15,
"total": 4944
},
"data": [
{
"name": "Vip",
"normalizedName": "VIP",
"commissionType": "Vip"
},
{
"name": "User",
"normalizedName": "USER",
"commissionType": "NoCommission"
}
]
}
Assign a user role¶
Use this method to assign a new role to a user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId *
The user identifier, in the GUID string format.
- roleName *
The name of a newly assigned role:
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
is returned.
Revoke a user role¶
Use this method to revoke a role previously assigned to a user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId *
The user identifier, in the GUID string format.
- roleName *
The name of a role to be revoked:
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
is returned.
Enable two-factor authentication for a user¶
Use this method to enable two-factor authentication for a user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
is returned.
Disable two-factor authentication for a user¶
Use this method to disable two-factor authentication for a user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
is returned.
Get user information¶
Use this method to obtain basic information about a user, including the username and email.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
The user identifier, in the GUID string format.
- nickname string
The username.
- email string
The user email.
- registration-date string
The date and time of user registration.
{
"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 a history of user orders¶
Use this method to obtain a list of orders placed by a specified user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
The order identifier.
- creationDate string
The date and time when an order was placed.
- instrument string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- side number
The order side: buy (
0
) or sell (1
).- category string
Always
Order
.- price number
The order price.
- amount :type:` number`
The order amount, in the base asset.
- fee number
The fee charged for the order.
- percent number
For internal use: always
0
.- total number
The order amount, in the quote asset.
{
"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 a history of user withdrawals¶
Use this method to obtain a history of withdrawal transfers made by a user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
The transfer identifier.
- accountId number
The user account identifier.
- assetId string
The asset identifier.
- transferId string
The transfer identifier.
- version number
For internal use.
- type number
Always
1
, indicating a withdrawal transfer.- amount number
The amount withdrawn.
- comment string
The commentary to the transfer.
- createdAt string
The date and time when the transaction was made.
- updatedAt string
The date and time when the transaction status has last been updated.
- status number
The transaction status:
0
— awaiting confirmation (the withdrawal request is sent and awaits confirmation)2
— completed (transfer processing is complete, this is a final state)3
— failed (transfer processing failed, this is a final state)5
— cancelled (transfer is cancelled, this is a final state)
- fee number
The transfer processing fee.
- data string
For internal use.
- errorMessage string
In case of an error, the error description.
{
"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 a history of user deposits¶
Use this method to obtain a list of deposit transfers made by a user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
The transfer identifier.
- accountId number
The user account identifier.
- assetId string
The asset identifier.
- transferId string
The transfer identifier.
- version number
For internal use.
- type number
Always
0
, indicating a deposit transfer.- amount number
The amount deposited.
- comment string
The commentary to the transfer.
- createdAt string
The date and time when the transaction was made.
- updatedAt string
The date and time when the transaction status has last been updated.
- status number
The transaction status:
1
— pending (the deposit request is sent and awaits confirmation)2
— completed (transfer processing is complete, this is a final state)3
— failed (transfer processing failed, this is a final state)5
— cancelled (transfer is cancelled, this is a final state)
- fee number
The transfer processing fee.
- data string
For internal use.
- errorMessage string
In case of an error, the error description.
{
"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 a log of user sessions¶
Use this method to find out when and from which location a user has logged in.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
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
The session identifier.
- userId string
The user identifier.
- loginDate string
The date and time when a user was logged in, in conversion to your local time.
- ip string
The user IP address.
- with2FA boolean
If
true
, two-factor authentication was used to log in.- location object
The user location based on the IP address:
- country string
The country name.
- code string
The country code.
{
"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 an open order¶
Use this method to explicitly cancel an order.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- orderId
The order identifier, which can be either of the following:
the system order identifier (a number of the long type) assigned in response to an order placement request
the client order identifier (in the GUID string format) assigned by the party that placed the order
DELETE[host]/frontoffice/api/orders/{orderId}
DELETE /frontoffice/api/68e057fe-0aec-03db-20f8-5f811abf7da6/orders/-72057594037927934 HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
Response
- orderId number
The system order identifier.
- total number
The order amount, in the quote asset.
- orderType string
The order type:
limit
ormarket
.- commission number
The order processing fee, in the quote asset.
- createdAt string
The date and time when the order was placed, with μs precision.
- unitsFilled number
The amount in which the order is filled.
- isPending boolean
If
true
, the order is pending and still awaits execution (it was not rejected, cancelled or fully executed).- status string
The order status:
Working
— the order is placed and being processed while pendingRejected
— the order request was rejected by the exchange engineCancelled
— the order was cancelled by an exchange userCompleted
— the order was executed
- type string
The order side:
buy
orsell
.- amount number
The full (initial) order amount, as declared when the order was placed.
- remaining number
For partially filled orders, the amount which remains to be filled.
- executionPrice number
The price at which the order was executed.
- requestedPrice number
Only for limit orders: the declared order price, as requested when the order was placed.
- stopPrice number
The order stop price.
- isLimit boolean
Indicates whether this is a limit order (
true
) or market order (false
).- instrument boolean
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- side number
The order side: buy (
0
) or sell (1
).- clientOrderId string
The client order identifier, in the GUID string format.
- rejectDetails string
Only for orders that have been rejected: the details about order rejection.
{
"order": {
"orderId": "-72057577040997636",
"total": 0.0,
"orderType": 0,
"commission": 0.0,
"createdAt": "2022-02-04T07:57:13.3414876Z",
"unitsFilled": 0.0,
"isPending": false,
"status": "cancelled",
"type": "sell",
"amount": 0.03,
"remaining": 0.03,
"executionPrice": 0.0,
"requestedPrice": 123456.0,
"stopPrice": 0.0,
"isLimit": true,
"instrument": "btc_usdt",
"side": 1,
"clientOrderId": "cc8fe6e8-309b-418d-953d-3ac42c5b6870",
"rejectDetails": ""
}
}
Methods for managing transfers¶
Deposit funds to a user¶
Use this method to deposit funds in any asset to a specified user account.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- userId string
The user identifier, in the GUID string format.
- assetID string
The asset identifier.
- amount number
The amount to be deposited.
- comment string
The comments to the transfer.
- callbackUrl string
The 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
The transfer identifier.
- asset string
The asset name.
- type string
The transfer type: always
Deposit
.- status string
The transaction status:
Pending
— the deposit request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final state
- amount string
The amount to be deposited.
- fee string
The transaction processing fee.
- createdAt string
The date and time when the deposit request was created, with μs precision.
- updatedAt string
The date and time when the deposit status has last been updated, with μs precision.
{
"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
The amount deposited.
- Status string
The transaction status:
Pending
— the transfer request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final state
- Asset string
The asset name.
- Type string
The transfer type: always
Deposit
.- Id number
The transfer identifier, as provided in a response.
- CreatedAt string
The date and time when the deposit request was created, with μs precision.
- Fee number
The transaction processing fee.
- ErrorDetails null
In case of an error, the error description.
[
{
"Amount": 1.0,
"Status": "Completed",
"Asset": "btc",
"Type": "Deposit",
"Id": 1,
"CreatedAt": "2021-04-09T10:50:40.1164856Z",
"Fee": 0.0,
"ErrorDetails": null
}
]
Withdraw user funds¶
Use this method to request withdrawal of user funds.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- userId string
The user identifier, in the GUID string format.
- assetId string
The asset identifier.
- amount number
The amount to be withdrawn.
- comment string
The comments to the transfer.
- callbackUrl string
The 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
The transfer identifier.
- asset string
The asset identifier.
- type string
The transaction type: always
Witdrawal
.- status string
The transaction status:
AwaitingConfirmation
— the withdrawal request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final stateCanceled
— transfer is cancelled, this is a final state
- amount string
The amount to be withdrawn.
- fee string
The transaction processing fee.
- createdAt string
The date and time when the withdrawal request was created, with μs precision.
- updatedAt string
The date and time when the withdrawal status has last been updated, with μs precision.
{
"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
The amount withdrawn.
- Status string
The transaction status:
AwaitingConfirmation
— the withdrawal request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final stateCanceled
— transfer is cancelled, this is a final state
- Asset string
The asset identifier.
- Type string
The transaction type: always
Withdrawal
.- TransferId number
The transfer identifier.
- CreatedAt string
The date and time when the withdrawal request was created, with μs precision.
- Fee number
The transaction processing fee.
- ErrorDetails null
In case of an error, the error description.
[
{
"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¶
Use this method to confirm withdrawal of user funds.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- userId string
The user identifier, in the GUID string format.
- transferId string
The transfer identifier.
- callbackUrl string
The 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 withdrawn.
- Status string
The transaction status:
AwaitingConfirmation
— the withdrawal request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final stateCanceled
— transfer is cancelled, this is a final state
- Asset string
The asset identifier.
- Type string
The transaction type: always
Withdrawal
.- TransferId number
The transfer identifier.
- CreatedAt string
The date and time when the withdrawal request was created, with μs precision.
- Fee number
The transaction processing fee.
- ErrorDetails null
In case of an error, the error description.
[
{
"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¶
Use this method to cancel a pending request to withdraw user funds.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- userId string
The user identifier, in the GUID string format.
- transferId string
The transfer identifier.
- callbackUrl string
The 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 to be withdrawn.
- Status string
The request status:
Canceled
— transfer cancellation succeededFailed
— transfer cancellation failed
- Asset string
The asset identifier.
- Type string
The transaction type: always
Withdrawal
.- TransferId number
The transfer identifier.
- CreatedAt string
The date and time when the withdrawal request was created, with μs precision.
- Fee number
The transaction processing fee.
- ErrorDetails null
In case of an error, the error description.
[
{
"Amount": 0.0,
"Status": "Canceled",
"Asset": "btc",
"Type": "Withdrawal",
"TransferId": 1,
"CreatedAt": "2021-04-09T11:58:07.433122",
"Fee": 0.0,
"ErrorDetails": null
}
]
Get a history of user transfers¶
Use this method to obtain the history of deposits and/or withdrawals on a user trading account.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- userId *
The user identifier, in the GUID string format.
- startDate
The earliest date and time when transfers must have been made to be included:
YYYY-MM-DDThh:mm:ss
.- limit
The maximum number of transfers to return per each paging response:
100
by default;1
to view only the latest transfer.
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
The user identifier, in the GUID string format.
If a user with the specified ID is missing, a
Not Found
error is returned.- asset string
The asset identifier.
- type string
The transaction type:
Deposit
orWithdrawal
.- status string
The transaction status:
AwaitingConfirmation
— the transfer request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final stateCanceled
— transfer is cancelled, this is a final state
- amount string
The amount of funds deposited or withdrawn.
- fee string
The transaction processing fee.
- createdAt string
The date and time when the transfer request was created, with μs precision.
- updatedAt string
The date and time when the transfer status has last been updated, with μs precision.
[
{
"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 a history of completed transfers¶
Use this method to obtain a list of successful transfer operations (including both the deposit and withdrawal transfers) that have already taken effect.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time when the transfers must have been made to be included:
YYYY-MM-DDThh:mm:ss
.- to
The latest date and time when the transfers must have been made to be included:
YYYY-MM-DDThh:mm:ss
.- user
The username or email (to return entries matching this string).
- userId
The user identifier.
- pageSize
The maximum number of transfer operations to include in each paging response, in the 1—999 range.
Define the
cursor
parameter to specify a page number.- status
The transfer status:
AwaitingConfirmation
— the transfer request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final state
- type
The transaction type:
Deposit
orWithdrawal
.- cursor
A zero-based integer value, specifying the page number for a paging response.
For a total number of pages, consult the
pageSize
value sent in a previous response.
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
The user identifier, in the GUID string format.
- userName string
The username.
- email string
The user email.
- userRole string
Obsolete: see the
userRoles
field instead.- userRoles array
An array of string values, identifying the user roles.
- comment string
The comments to the transfer.
- id number
The transaction identifier.
- asset string
The asset identifier.
- transferId string
The transfer identifier.
- type string
The transfer type:
Deposit
orWithdraw
.- status string
The transaction status:
AwaitingConfirmation
— the transfer request is sent and awaits confirmationCompleted
— transfer processing is complete, this is a final stateFailed
— transfer processing failed, this is a final stateCanceled
— transfer is cancelled, this is a final state
- amount string
The amount of funds transferred.
- fee string
The transaction processing fee.
- errorDetails string
In case of an error, the error description.
- createdAt string
The date and time when the transfer request was created, with μs precision.
- updatedAt string
The date and time when the transfer status has last been updated, with μs precision.
- amountInRootAsset string
The transfer amount, in the platform root asset.
- feeInRootAsset string
The transaction processing fee, in the platform root asset.
- rootAsset string
The root asset set for the exchange.
{
"paging": {
"next": "1",
"prev": "-1"
},
"data": [
{
"userId": "3ae2608c-499d-a883-95e8-c46fd5d19076",
"userName": "3ae2608c-499d-a883-95e8-c46fd5d19076",
"email": "alice@mailinator.com",
"userRole": "",
"userRoles": [],
"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"
}
]
}
Methods for viewing user balance¶
Get user balance¶
Use this method to view the current balance in each user asset.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- userId
The user identifier, in the GUID string format.
GET[host]/back-api/backoffice/user/{userId}/balance/
GET /back-api/backoffice/user/68e057fe-0aec-03db-20f8-5f811abf7da6/balance HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
Response
- asset string
The asset identifier.
- balance number
The amount of funds available to the user in the indicated
asset
.
[
{
"asset": "btc",
"balance": 10
},
{
"asset": "eth",
"balance": 300
}
]
Get balance by assets and users¶
Use this method to request the current balance in various assets available to specified users.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- asset array
An array of string values, identifying the assets to include in the list.
- userIds array
An array of string values, identifying the users to include in the list.
POST[host]/back-api/backoffice/balances
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
The username.
- userId string
The user identifier, in the GUID string format.
If a user with the specified ID is missing in the database, the following error is returned:
error : "User with id:{userId} not found"
- userEmail string
The user email.
- userRoles array
An array of string values, identifying the user roles.
- balances array
The details about user balance in each asset:
- asset string
The asset identifier.
- amount string
The total amount in the indicated user asset, including both the locked funds that are reserved for execution of open orders, and the remaining funds presently available to the user.
- locked string
The amount of locked funds that are currently reserved for covering open orders. The users cannot draw on these funds while their orders are pending.
- fundsInRootAsset string
The total amount in the indicated user asset, in conversion to the exchange root asset (as the rootAsset field indicates).
This value is listed only for assets with a defined quote (or counter-) asset.
- totalFundsInRootAsset string
The total amount in all assets available to a user, in conversion to the exchange root asset (as the rootAsset field indicates).
This value is displayed only when the fundsInRootAsset value is listed for each asset and no filters by user assets were applied in the request.
- rootAsset string
The root asset set for the exchange.
{
"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."
}
]
}
Methods for managing orders¶
Get order history¶
Use this method to view orders meeting various criteria.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time when the orders must have been placed to be included:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all orders are returned that were placed before the latest specified date.- to
The latest date and time when the orders must have been placed to be included:
YYYY-MM-DDThh:mm:ss
.This value cannot exceed the earliest specified date by more than seven days.
When unspecified (
null
), all orders are returned that were placed after the earliest specified date.- user
The username or email (to return entries matching this string).
- user_id
The user identifier.
- OrderId
The order identifier.
- Status
The current order status.
- Market
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- type
The order type:
Limit
orMarket
.- Sort
Sorting by date:
+CREATEDAT
— ascending-CREATEDAT
— descending
- cursor
The page number, in the range indicated in a previous paging response.
- Side
The order side: buy (
0
) or sell (1
).
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
The average price at which the order or its portion is filled by this time.
- commissionCurrency string
The commission currency.
- createdAt string
The date and time when the order was placed, with μs precision.
- effectiveLimitPrice string
For limit orders, the actual price at which the order was filled.
- email string
The user email.
- filledAmount string
The amount in which the order is filled by this time.
- market string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderId string
The order identifier.
- orderStatus string
The current order status.
- orderType string
The order type:
Limit
orMarket
.- remainingAmount string
For partially filled orders, the amount which remains to be filled.
- requestedAmount string
The full order amount, as requested when the order was placed.
- requestedLimitPrice string
For limit orders, the limit price specified when the order was placed.
- side string
The order side:
buy
orsell
.- timeInForce string
The time-in-force indicator:
FOK
— for fill-or-kill ordersGTC
— for good-till-cancelled orders
- totalCommission string
The total commission charged for order processing.
- updatedAt string
The date and time when the order status has last been updated.
- userId string
The user identifier, in the GUID string format.
- userName string
The username.
- userRoles array
An array of string values, identifying the user roles.
- IsApiKey boolean
If
true
, the order was placed using the API.
{
"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 details¶
Use this method to obtain detailed information about orders.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- orderId *
The 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
The average price at which the order or its portion is filled by this time.
- commissionCurrency string
The commission currency.
- createdAt string
The date and time when the order was placed, with μs precision.
- effectiveLimitPrice string
For limit orders, the actual price at which the order was filled.
- email string
The user email.
- filledAmount string
For partially filled orders, the amount filled by this time.
- market string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderId string
The order identifier.
- orderStatus string
The current order status.
- orderType string
The order type:
limit
ormarket
.- remainingAmount string
For partially filled orders, the amount which remains to be filled.
- requestedAmount string
The full order amount, as requested when the order was placed.
- requestedLimitPrice string
For limit orders, the limit price specified when the order was placed.
- side string
The order side:
buy
orsell
.- timeInForce string
The time-in-force indicator:
FOK
— for fill-or-kill ordersGTC
— for good-till-cancelled orders
- totalCommission string
The total commission charged for transaction processing.
- updatedAt string
The date and time when the order status has last been updated.
- userId string
The user identifier, in the GUID string format.
- userName string
The username.
- userRoles array
An array of string values, identifying the user roles.
- IsApiKey boolean
If
true
, the order was placed using the API.
{
"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 a history of order updates¶
A single order can be executed in portions, with each consecutive trade being made at the next best price for a certain amount of assets, until the order is executed in the full amount.
Use this method to request information about order updates, including the trades that were made while executing an order and other changes of the order status.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- orderId *
The 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
- accountVersion string
The user account version.
- createdAt number
The date and time when the trade request orginated, with μs precision.
- execType string
The reason why the event is reported:
OrderStatusUpdate
- indicates an update to the order status (not implying that a trade has been made)Trade
- indicates the actual trade being made
- tradeId string
The trade identifier.
- orderStatus string
The current order status.
- remainingAmount number
For partially filled orders, the amount which remains to be filled.
- filledAmount string
The amount in which the order was filled after the listed trade took place.
- filledQuoteAmount number
The amount of the reported trade, in the quote asset.
- filledBaseAmount number
The amount of the reported trade, in the base asset
- tradePrice number
The price at which the trade was made.
- tradeAmount number
The amount traded.
- rejectDetails string
For rejected trades, the reason for rejection.
- commission number
The transaction processing fee.
- commissionCurrency string
The commission currency.
{
"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"
}
]
}
Methods for managing trades¶
Get a history of trades¶
Use this method to obtain a list of pending or completed trades meeting various criteria.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time when the trades must have occurred to be included:
YYYY-MM-DDThh:mm:ss
.- to
The latest date and time when the trades must have occurred to be included:
YYYY-MM-DDThh:mm:ss
.- user
The username or email (to return entries matching this string).
- market
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderside
The order side: buy (
0
) or sell (1
).- ordertype
The order type:
limit
ormarket
.- orderstatus
The current order status, which can be one of the following:
Working
— to view trades that are currently awaiting executionCompleted
— to view trades that have already been executed
- asset
The asset in which commission was charged for the trade.
- cursor
The page number, in the range indicated in a previous paging response.
- allUsersAndPages
If
true
, trades by all users will be listed on each page.
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
Obsolete: see the executedAt field instead.
- baseAmount string
The amount traded (as part of the executed trade), in the base asset.
- commission string
The transaction processing fee.
- commissionCurrency string
The commission currency.
- commissionInRootAssetNow string
The transaction processing fee (at the current exchange rate), in conversion to the platform root asset.
- commissionInRootAsset string
The transaction processing fee (at the exchange rate as of the moment of trade execution), in conversion to the platform root asset.
- completedAt string
Obsolete: see the executedAt field instead.
- email string
The user email.
- executedAt string
The date and time when the trade was executed.
- executionId number
The trade execution identifier.
- executionPrice string
The price at which the trade was executed.
- makerOrTaker string
The type of fee charged for the trade:
maker
ortaker
.- marketId string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderId string
The order identifier.
- orderStatus string
The current order status.
- orderType string
The order type:
limit
ormarket
- quoteAmount string
The amount traded (as part of the executed trade), in the quote asset.
- remainingAmount string
For partially filled orders, the amount which remains to be filled.
- rootAsset string
The root asset set for the exchange.
- side string
The order side:
buy
orsell
.- totalBaseAmount string
The total order amount filled (as a result of trade execution), in the base asset.
- totalCommission string
The total commission charged for transaction processing.
- totalQuoteAmount string
The total order amount filled (as a result of trade execution), in the quote asset.
- tradeId string
The trade identifier.
- userId string
The user identifier, in the GUID string format.
- userRole array
Obsolete: see the
userRoles
field instead.- userRoles array
An array of string values, identifying the user roles.
{
"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 a user trade history¶
Use this method to obtain a list of trades made by a specified user.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- user *
The username or email (to return entries matching this string).
Query parameters:
- count *
The maximum number of trades to return per each paging response.
- market
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- page
A zero-based integer value, specifying the page number for a paging response.
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
Obsolete: see the executedAt field instead.
- baseAmount string
The amount traded (as part of the executed trade), in the base asset.
- commission string
The transaction processing fee.
- commissionCurrency string
The commission currency.
- commissionInRootAssetNow string
The transaction processing fee (at the current exchange rate), in conversion to the platform root asset.
- commissionInRootAsset string
The transaction processing fee (at the exchange rate as of the moment of trade execution), in conversion to the platform root asset.
- completedAt string
Obsolete: see the executedAt field instead.
- email string
The user email.
- executedAt string
The date and time when the trade was executed.
- executionId number
The trade execution identifier.
- executionPrice string
The price at which the trade was executed.
- makerOrTaker string
The type of fee charged for the trade:
maker
ortaker
.- marketId string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderId string
The order identifier.
- orderStatus string
The current order status.
- orderType string
The order type:
limit
ormarket
.- quoteAmount string
The amount traded (as part of the executed trade), in the quote asset.
- remainingAmount string
For partially filled orders, the amount which remains to be filled.
- rootAsset string
The root asset set for the exchange.
- side string
The order side:
buy
orsell
.- totalBaseAmount string
The total order amount filled (as a result of trade execution), in the base asset.
- totalCommission string
The total commission charged for transaction processing.
- totalQuoteAmount string
The total order amount filled (as a result of trade execution), in the quote asset.
- tradeId string
The trade identifier.
- userId string
The user identifier, in the GUID string format.
- userRole array
Obsolete: see the
userRoles
field instead.- userRoles array
An array of string values, identifying the user roles.
[
{
"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 detailed information about trades¶
Use this method to obtain detailed information about specified trades.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- ids * type:array
An array of number values, identifying the trades to include in the report.
The maximum number of trades to be included is 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
Obsolete: see the executedAt field instead.
- baseAmount string
The amount traded (as part of the executed trade), in the base asset.
- commission string
The transaction processing fee.
- commissionCurrency string
The commission currency.
- commissionInRootAssetNow string
The transaction processing fee (at the current exchange rate), in conversion to the platform root asset.
- commissionInRootAsset string
The transaction processing fee (at the exchange rate as of the moment of trade execution), in conversion to the platform root asset.
- completedAt string
Obsolete: see the executedAt field instead.
- email string
The user email.
- executedAt string
The date and time when the trade was executed.
- executionId number
The trade execution identifier.
- executionPrice string
The price at which the trade was executed.
- makerOrTaker string
The type of fee charged for the trade:
maker
ortaker
.- marketId string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderId string
The order identifier.
- orderStatus string
The current order status.
- orderType string
The order type:
limit
ormarket
.- quoteAmount string
The amount traded (as part of the executed trade), in the quote asset.
- remainingAmount string
For partially filled orders, the amount which remains to be filled.
- rootAsset string
The root asset set for the exchange.
- side string
The order side:
buy
orsell
.- totalBaseAmount string
The total order amount filled (as a result of trade execution), in the base asset.
- totalCommission string
The total commission charged for transaction processing.
- totalQuoteAmount string
The total order amount filled (as a result of trade execution), in the quote asset.
- tradeId string
The trade identifier.
- userId string
The user identifier, in the GUID string format.
- userRole array
Obsolete: see the
userRoles
field instead.- userRoles array
An array of string values, identifying the user roles.
- IsApiKey boolean
If
true
, the order was placed using the API.
{
"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 a list of trades¶
Use this method to view the detailed information about trades meeting various criteria.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from *
The earliest date and time when the trades must have occurred to be included:
YYYY-MM-DDThh:mm:ss
.- to *
The latest date and time when the trades must have occurred to be included:
YYYY-MM-DDThh:mm:ss
.- market
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- minAmount
The minimum traded amount.
- maxAmount
The maximum traded 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
Obsolete: see the executedAt field instead.
- baseAmount string
The amount traded (as part of the executed trade), in the base asset.
- commission string
The transaction processing fee.
- commissionCurrency string
The commission currency.
- commissionInRootAssetNow string
The transaction processing fee (at the current exchange rate), in conversion to the platform root asset.
- commissionInRootAsset string
The transaction processing fee (at the exchange rate as of the moment of trade execution), in conversion to the platform root asset.
- completedAt string
Obsolete: see the executedAt field instead.
- email string
The user email.
- executedAt string
The date and time when the trade was executed.
- executionId number
The trade execution identifier.
- executionPrice string
The price at which the trade was executed.
- makerOrTaker string
The type of fee charged for the trade:
maker
ortaker
.- marketId string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderId string
The order identifier.
- orderStatus string
The current order status.
- orderType string
The order type:
limit
ormarket
.- quoteAmount string
The amount traded (as part of the executed trade), in the quote asset.
- remainingAmount string
For partially filled orders, the amount which remains to be filled.
- rootAsset string
The root asset set for the exchange.
- side string
The order side:
buy
orsell
.- totalBaseAmount string
The total order amount filled (as a result of trade execution), in the base asset.
- totalCommission string
The total commission charged for transaction processing.
- totalQuoteAmount string
The total order amount filled (as a result of trade execution), in the quote asset.
- tradeId string
The trade identifier.
- userId string
The user identifier, in the GUID string format.
- userRole array
Obsolete: see the
userRoles
field instead.- userRoles array
An array of string values, identifying the user roles.
[
{
"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 the data on the last trades¶
Use this method to view the most recent trades made by all exchange users.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- cursor
The page number, in the range indicated in a previous paging response.
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
The user email.
- executedAt string
The date and time when the trade was executed.
- executionId number
The execution identifier.
{
"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 a trade¶
Use this method to revert a trade made by a specified user.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- userId * string
The user identifier, in the GUID string format.
- executionId * number
The trade execution identifier.
- orderId * number
The 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
The number of user trades which have been cancelled.
{
"updatedExecutionsCount": 1
}
Methods for managing assets¶
Get a list of traded assets¶
Use this method to obtain information about assets traded on the exchange.
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
The unique identifier of the asset. Typically, it is a shortened version of the asset name (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).- can_deposit boolean
If
true
, the users are allowed to deposit funds denominated in this asset.- can_withdraw boolean
If
true
, the users are allowed to withdraw funds denominated in the listed asset.- asset_name string
The complete asset name, such as the one defined by a token proprietor during ICO. The maximum length is 50 characters.
- withdrawal_fee string
The fee charged for withdrawing funds denominated in the listed asset.
- scale number
The number of decimal places displayed for asset amounts, which also determines the
amount_scale
andprice_scale
limits for related markets. This value must be within 2—18 range.
{
"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 a new asset¶
Use this method to introduce a new asset on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- id * string
The unique identifier of the asset. Typically, it is a shortened version of the asset name (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).- asset_name * string
The complete asset name, such as the one defined by a token proprietor during ICO. The maximum length is 50 characters.
- scale * number
The number of decimal places displayed for asset amounts, which also determines the
amount_scale
andprice_scale
limits for related markets. This value must be within 2—18 range.- can_deposit boolean
If
true
, the users are allowed to deposit funds denominated in this asset.- can_withdraw boolean
If
true
, the users are allowed to withdraw funds denominated in this asset.- withdrawal_fee * number
The fee charged for withdrawing funds denominated in this asset.
- image_url string
The URL specifying the path to an asset icon to be displayed in the exchange UI.
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
is returned.
Update an asset¶
Use this method to customize an existing asset.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- asset_id *
The unique identifier of the asset. Typically, it is a shortened version of the asset name (such as
btc
for bitcoin), which is then used to indicate markets by asset symbols (such asbtc_usd
).
Body:
- asset_name * string
The complete asset name, such as the one defined by a token proprietor during ICO. The maximum length is 50 characters.
- scale number
The number of decimal places displayed for asset amounts, which also determines the
amount_scale
andprice_scale
limits for related markets. This value must be within 2—18 range.- can_deposit boolean
If
true
, the users are allowed to deposit funds denominated in this asset.- can_withdraw boolean
If
true
, the users are allowed to withdraw funds denominated in this asset.- withdrawal_fee number
The fee charged for withdrawing funds denominated in this asset.
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
is returned.
Methods for managing markets¶
The methods described in this document section are used to add new markets and customize their settings.
Create a new market¶
Use this method to introduce a new market (currency pair) on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- id string
The market identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- base_asset string
The base asset (also called transaction currency), which is the first currency appearing in a currency pair.
- quote_asset string
The quote asset, which is the second currency appearing in a currency pair (both direct and indirect). It is used to determine the value of the base asset.
- amount_scale number
The number of decimal places displayed for trade amounts, which also determines the minimum allowed trade amount. Usually, this value is equal to the
scale
specified for a base asset in the pair. This value cannot be greater than the base asset scale and must be within 2–18 range.- min_amount number
The minimum allowed amount for orders placed on this market. Orders with a lesser amount will be rejected.
- price_deviation number
The allowed price deviation for limit orders placed on the market, upon exceeding which (that is, upon deviating too much from the best bid or ask prices) an order will be rejected. This value is normalized to 0–1 range: for example, 0.15 indicates an allowed deviation of 15%.
- price_scale number
The number of decimal places displayed for trade prices, which also determines the minimum allowed trade price. Usually, this value is equal to the
scale
specified for a quote asset in the pair. This value cannot be greater than the quote asset scale and must be within 2–18 range.- maker_fee number
The fee charged for orders placed by market makers providing liquidity to the market. This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A maker fee of 5% is considered substantial and may be detrimental to business.
- taker_fee number
The fee charged for orders placed by market takers diminishing market liquidity. This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A taker fee of 5% is considered substantial and may be detrimental to business.
- status string
The market status, indicating whether new orders can be currently placed on this market:
Open
— the market is operating properly and accepts orders via UI and APIPaused
— the market does not accept incoming orders via UI and API (previously placed limit orders still await execution)Halted
— placing new orders on this market is not allowed either via UI or API
For newly created markets,
status
must always be set toHalted
. To allow trading on the created market, execute the Update Market command with thestatus
parameter set toOpen
.- side string
The market side:
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,
"maker_fee": 0.002,
"taker_fee": 0.002,
"status": "Open",
"side": "BuySell"
}
Response
In case of success, HTTP code 200
is returned.
Update an existing market¶
Use this method to customize an existing market (currency pair).
Important
This operation can be performed only by users assigned the Admin role.
Users assigned the Support role can only update the Hidden
field value.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- market_id *
The market identifier (corresponds to the
id
parameter value specified when the market has been created).
Body:
- maker_fee number
The fee charged for orders placed by market makers providing liquidity to the market. This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A maker fee of 5% is considered substantial and may be detrimental to business.
- taker_fee number
The fee charged for orders placed by market takers diminishing market liquidity. This value is normalized to 0–1 range: for example, 0.05 indicates a fee of 5%. A taker fee of 5% is considered substantial and may be detrimental to business.
- hidden boolean
If
true
, the market is hidden for the exchange users.- price_scale number
The number of decimal places displayed for trade prices, which also determines the minimum allowed trade price. Usually, this value is equal to the
scale
specified for a quote asset in the pair. This value cannot be greater than the quote asset scale and must be within 2–18 range.- amount_scale number
The number of decimal places displayed for trade amounts, which also determines the minimum allowed trade amount. Usually, this value is equal to the
scale
specified for a base asset in the pair. This value cannot be greater than the base asset scale and must be within 2–18 range.- status string
The market status, indicating whether new orders can be currently placed on this market:
Open
— the market is operating properly and accepts orders via UI and APIPaused
— the market does not accept incoming orders via UI and API (previously placed limit orders still await execution)Halted
— placing new orders on this market is not allowed either via UI or API
- side string
The market side:
BuySell
Buy
Sell
- min_amount number
The minimum allowed amount for orders placed on this market. Orders with a lesser amount will be rejected.
- price_deviation number
The allowed price deviation for limit orders placed on the market, upon exceeding which (that is, upon deviating too much from the best bid or ask prices) an order will be rejected. This value is normalized to 0–1 range: for example, 0.15 indicates an allowed deviation of 15%.
PUT[host]/back-api/backoffice/market/{market_id}
PUT /back-api/backoffice/market/btc_usdt HTTP/1.1
Host: host.name
Authorization: Bearer akvmn34egjidg0jifgjdg0djg34g
{
"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
is returned.
Note
Users assigned the Support role can only update the Hidden
field value: upon attempting to customize other fields, the Forbidden status is returned, along with the name of the first encountered field that is not allowed to be changed. In this case, the new value specified for the Hidden field in this request is not applied as well.
Methods for managing tiers¶
Markets can be grouped under tiers which determine the maker and taker fees charged for trading specific volumes. Each market can only be listed by a single tier group, while each tier group can encompass any number of markets.
With tier groups, you can define a series of volume levels at which special fees apply. By acting upon the group metrics at hand, you can encourage trading on your exchange.
Get tier group settings¶
Use this method to view the current configuration of each tier group, along with its tiers and market preferences.
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
The root asset set for the exchange.
- groups array
For each tier group in the array, the linked tiers and markets are listed:
- tiers array
The following settings are listed for each tier:
- id number
The tier identifier.
- description string
The tier description.
- volume number
The minimum asset volume that must be traded for special taker and maker fees to apply.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- tierGroupId number
The tier group to which this tier belongs.
- market array
The following settings are listed for each market:
- marketId string
The market identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- tierGroupId number
The tier group covering this market.
- id
The tier group identifier.
- description string
The tier group title.
{
"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 tier settings¶
Use this method to view the current configuration of each tier.
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
The tier identifier.
- description string
The tier title.
- volume number
The minimum asset volume that must be traded for special taker and maker fees to apply.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- tier_group_id number
The tier group to which this tier belongs.
[
{
"id": 2,
"description": "first tier",
"volume": 0.000001,
"maker_fee": 0.2,
"taker_fee": 0.2,
"tier_group_id": 1
}
]
Add a tier¶
Use this method to introduce a new tier on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- description string
The tier title.
- volume number
The minimum asset volume that must be traded for special taker and maker fees to apply.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- tier_group_id string
The tier group to which this tier belongs.
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
The tier identifier.
- description string
The tier title.
- volume number
The minimum asset volume that must be traded for special taker and maker fees to apply.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- tier_group_id number
The tier group to which this tier belongs.
[
{
"id": 3,
"description": "fourth tier",
"volume": 100000000,
"maker_fee": 0.006,
"taker_fee": 0.006,
"tier_group_id": 1
}
]
Update tier settings¶
Use this method to configure a tier.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- tier_id *
The tier identifier.
Body:
- description string
The tier title.
- volume number
The minimum asset volume that must be traded for special taker and maker fees to apply.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
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
The tier identifier.
- description string
The tier title.
- volume number
The minimum asset volume that must be traded for special taker and maker fees to apply.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- tier_group_id number
The tier group to which this tier belongs.
{
"id": 3,
"description": "fourth tier",
"volume": 100000000,
"maker_fee": 0.005,
"taker_fee": 0.006,
"tier_group_id": 1
}
Remove a tier¶
Use this method to discontinue a tier and remove it from the tier list.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- tier_id *
The 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
is returned.
Get a tier group list¶
Use this method to view the identifier and title of each tier group.
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
The tier group identifier.
- description string
The tier group title.
[
{
"id": 1,
"description": "group for crypto-crypto instruments"
}
]
Create a tier group¶
Use this method to create a new tier group, after which you can start introducing new tiers on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- description string
The tier group title.
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
The tier group identifier.
- description string
The tier group title.
{
"id": 1,
"description": "group for crypto-crypto instruments"
}
Update the tier group title¶
Use this method to change the title of a tier group.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- group_id
The tier group identifier.
Body:
- description string
The new tier group title.
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
The tier group identifier.
- description string
The new tier group title.
{
"id": 1,
"description": "group for crypto-fiat instruments"
}
Remove a tier group¶
Use this method to remove an existing tier group.
Important
A group is removed along with all tiers that were added to it.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- group_id *
The 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
is returned.
Get a list of tier markets¶
Use this method to identify the markets covered by a tier group.
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
The market identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- tierGroupId number
The tier group covering this market.
[
{
"marketId": "btc_eur",
"tierGroupId": 1
}
]
Add a market to a tier group¶
Use this method to extend the tier group reach by linking a new market to it.
Note
Each market can only be listed by a single tier group.
On an attempt to list a market assigned to another group, an error is returned.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- tierGroupId number
The tier group identifier.
- marketId string
The market identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.
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
The tier group identifier.
- marketId string
The market identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.
{
"tierGroupId": 1,
"marketId": "btc_usd"
}
Exclude a market from a tier group¶
Use this method to exclude a specific market from a tier group.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- market_id*
The 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
is returned.
Methods for managing role fees¶
The exchange features personalized maker and taker fees that can be assigned to users depending on their current roles and tier groups.
Get a list of fees by user roles¶
Use this method to learn about the fees assigned to each user role.
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
The role commission identifier.
- roleName string
The user role:
Vip
Hedging
User
Demo
Trader
Market-Maker
NoCommission
Support
Admin
Bot
- tierGroupId number
The tier group identifier.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
[
{
"id": 1,
"roleName": "Trader",
"tierGroupId": 1,
"makerFee": 0.1,
"takerFee": 0.2
}
]
Configure custom role fees¶
Use this method to assign custom maker and taker fees to a specific user role and tier group.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- roleName string
The user role:
Vip
Hedging
User
Demo
Trader
Market-Maker
NoCommission
Support
Admin
Bot
- tierGroupId number
The tier group identifier.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
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 response may include one of the following:
HTTP code
200
in case of successHTTP code
404
if roleName or tierGroupId is not found
Update custom role fees¶
Use this method to configure maker and taker fees associated with a specific user role and tier group.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- role_commission_id
The role commission identifier.
Body:
- id number
Role commission identifier.
- roleName string
The user role:
Vip
Hedging
User
Demo
Trader
Market-Maker
NoCommission
Support
Admin
Bot
- tierGroupId number
The tier group identifier.
- makerFee number
The maker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
- takerFee number
The taker fee. This value is normalized to 0–1 range (where 0.15 assumes the fee of 15%).
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 response may include one of the following:
HTTP code
200
in case of successHTTP code
404
if roleName, tierGroupId or role_commission_id is not found
Remove custom role fees¶
Use this method to remove custom maker and taker fees associated with a specific user role and tier group.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- role_commission_id
The 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 response may include one of the following:
HTTP code
200
in case of successHTTP code
404
if role_commission_id is not found
Methods for PnL monitoring¶
Get PnL by assets¶
Use this method to view the current PnL values calculated for each asset traded by a specific exchange user.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained before the latest specified date.- to
The latest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained after the earliest specified date.- user
The username or email (to return entries matching this string).
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 following information is provided about each user asset:
- asset string
The asset name.
- balance string
The user balance in this asset.
- balanceInRootAsset string
The user balance in this asset, in conversion to the platform root asset (based on the latest conversion rate).
- tradedVolume string
The total asset volume traded.
- tradedVolumeInRootAsset string
The total asset volume traded, in conversion to the platform root asset (based on the latest conversion rate).
- commission string
The total commission charged in this asset.
- commissionInRootAsset string
The total commission charged in this asset, in conversion to the platform root asset (based on the latest conversion rate).
- pnl string
Obsolete: see the realizedPnl value instead.
- pnlInRootAsset string
Obsolete: see the realizedPnl value instead.
- realizedPnl string
The user realized PnL, in conversion to the platform root asset (based on the rates effective as of the moment of each historical transaction).
- unrealizedPnl string
The user unrealized PnL, in conversion to the platform root asset (based on the average rate obtained for the time period specified in the request).
- rootAsset string
The root asset set for the exchange.
{
"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 PnL by users¶
Use this method to view the current PnL of specified exchange users.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
- from string
The earliest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained before the latest specified date.- to string
The latest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained after the earliest specified date.- page number
A zero-based integer value, specifying the page number for a paging response.
- perPage number
The maximum number of entries to include in each paging response.
- roles array
An array of string values, identifying the user roles:
Omit this parameter (leave it
null
) to obtain the complete list of users, regardless of their roles.- user string
The username or email (to return entries matching this string).
Omit this parameter (leave it
null
) to obtain the complete list of users.
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
The following information is provided about each user:
- user string
The user email.
- userId string
The user identifier, in the GUID string format.
- userRoles array
An array of string values, identifying the user roles.
- activityStatus number
The user profile status:
0
— Active1
— Frozen2
— Terminated
- balanceInRootAsset string
The total user balance, in conversion to the platform root asset (based on the latest conversion rate).
- tradedVolumeInRootAsset string
The total volume traded by the user, in conversion to the platform root asset (based on the latest conversion rate).
- commissionInRootAsset string
The total commission paid by the user, in conversion to the platform root asset (based on the latest conversion rate).
- pnlInRootAsset string
Obsolete: see the realizedPnl value instead.
- realizedPnl string
The user realized PnL, in conversion to the platform root asset (based on the rates effective as of the moment of each historical transaction).
- unrealizedPnl string
The user unrealized PnL, in conversion to the platform root asset (based on the average rate obtained for the time period specified in the request).
- rootAsset string
The root asset set for the exchange.
{
"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 PnL for a time period¶
Use this method to view the PnL values calculated for each asset traded by every exchange user during a specified time period.
Note
A user asset is not included in the response if the RateToRootAsset field is not specified for the asset, meaning that it cannot be converted to the platform root asset and its PnL value cannot be obtained.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained before the latest specified date.- to
The latest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained after the earliest specified date.
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
The root asset set for the exchange.
- pnl string
Obsolete: see the totalRealizedPnl value instead.
- pnlInRootAsset string
Obsolete: see the totalRealizedPnl value instead.
- totalRealizedPnl string
The realized PnL for all assets traded so far by a specific user, in conversion to the platform root asset (based on the rates effective as of the moment of each historical transaction).
- totalUnrealizedPnl string
The unrealized PnL for all assets currently traded by a specific user, in conversion to the platform root asset (based on the average rate obtained for the time period specified in the request).
- tradedVolume string
Obsolete: see the tradedVolumeInRootAsset value instead.
- tradedVolumeInRootAsset string
The total volume traded by the user, in conversion to the platform root asset (based on the latest conversion rate).
- commission string
Obsolete: see the commissionInRootAsset value instead.
- commissionInRootAsset string
The total commission paid by the user in this asset, in conversion to the platform root asset (based on the latest conversion rate).
- assets array
An array of string values, identifying the user assets.
Note
A user asset is not included in the response if the RateToRootAsset field is not specified for the asset, meaning that it cannot be converted to the platform root asset and its PnL value cannot be obtained.
The following information is provided about each user asset:
- assetId string
The asset identifier.
- rateToRootAsset string
The rate of converting the user asset to the platform root asset.
- totalPnl string
Obsolete: see the totalRealizedPnl value instead.
- totalPnlInRootAsset string
Obsolete: see the totalRealizedPnl value instead.
- totalRealizedPnl string
The realized PnL based on the user asset amount traded so far, in conversion to the platform root asset (based on the rates effective as of the moment of each historical transaction).
- totalUnrealizedPnl string
The unrealized PnL based for the user asset, in conversion to the platform root asset (based on the average rate obtained for the time period specified in the request).
- totalVolume string
The total asset volume traded.
- totalVolumeInRootAsset string
The total asset volume traded, in conversion to the platform root asset.
- totalCommission string
The total commission charged in this asset.
- totalCommissionInRootAsset string
The total commission charged in this asset, in conversion to the platform root asset.
{
"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 the current user PnL¶
Use this method to view the current PnL values calculated for individual exchange users for a certain time period.
You can specify which assets should be taken into account when evaluating PnL for each user. You can also obtain up-to-date PnL values for all assets that have ever been traded by users.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all available data is returned.- user
The username or email (to return entries matching this string).
Omit this parameter (leave it
null
) to obtain the complete list of users.- asset
The asset identifier.
Omit this parameter (leave it
null
) to obtain the complete list of user assets.
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
The following information is provided about each user included in the response:
- user string
The user email.
- userId string
The user identifier, in the GUID string format.
- userRoles array
An array of string values, identifying the user roles.
- activityStatus number
The user profile status:
0
— Active1
— Frozen2
— Terminated
- balanceInRootAsset string
The total user balance, in conversion to the platform root asset (based on the latest conversion rate).
- tradedVolumeInRootAsset string
The total volume traded by the user, in conversion to the platform root asset (based on the latest conversion rate).
- commissionInRootAsset string
The total commission paid by the user, in conversion to the platform root asset (based on the latest conversion rate).
- pnlInRootAsset string
Obsolete: see the realizedPnl value instead.
- realizedPnl string
The realized PnL for the user assets specified in the request, in conversion to the platform root asset (based on the rates effective as of the moment of each historical transaction).
- unrealizedPnl string
The unrealized PnL for the user assets specified in the request, in conversion to the platform root asset (based on the average rate obtained for the time period specified in the request).
- rootAsset string
The root asset set for the exchange.
{
"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"
}
Methods for auditing¶
Get the audit log¶
Use this method to obtain a log of user activity based on specified criteria.
Request
Header parameters:
Authorization: Bearer <access_token>
Query parameters:
- from
The earliest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained before the latest specified date.- to
The latest date and time for which the data must be obtained:
YYYY-MM-DDThh:mm:ss
.When unspecified (
null
), all data is returned that was obtained after the earliest specified date.- user
Username or emailThe username or email (to return entries matching this string).
- type
The type of records to be included in the log.
- role
An array of string values, identifying the user roles.
- cursor
The page number, in the range indicated in a previous paging response.
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
The audit record identifier.
- timestamp string
The activity timestamp.
- email string
The user email.
- roles array
An array of string values, identifying the user roles.
- operationType string
The type of activity that has been logged.
- operationInformation string
The details of activity that has been logged.
- context string
The activity scope.
- registered string
The date and time of user registration.
- lastLogin string
The date and time when the user has last been logged in.
"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"
}
]
Methods for antifraud monitoring¶
Get user trades¶
Use this method to inspect recent trades made by exchange users.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- period *
The time period for which the trading data must be collected:
minute
— the last minuteminute3
— the last 3 minutesminute5
— the last 5 minutesday
— the last 24 hours (specify this setting only when obtaining logs for a single user)
- user
The username or email (to return entries matching this string).
- cursor
The page number, in the range indicated in a previous paging response.
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
The user identifier, in the GUID string format.
- tradesCount number
The total number of trades that have occurred during the specified time period.
{
"paging": {
"next": "0",
"prev": "-1"
},
"data": [
{
"userId": "a9fa79b8-386b-4985-1234-b0c2c5bd2e0e",
"tradesCount": 3
},
{
"userId": "dddfcbfa-2533-ad89-5678-f198a8873db3",
"tradesCount": 8
}
]
}
Get the arbitrage polygon data¶
Use this method to identify possible arbitrage polygons within the context of recent trading activity on the exchange.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- period *
The time period for which the trading data must be collected:
minute
— the last minuteminute3
— the last 3 minutesminute5
— the last 5 minutesday
— the last 24 hours (specify this setting only when obtaining logs for a single user)
- user
The username or email (to return entries matching this string).
- cursor
The page number, in the range indicated in a previous paging response.
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
The user identifier, in the GUID string format.
- arbitrage object
The following information is provided about each located arbitrage polygon (with translating it into a succession of user transactions on each market):
- marketOperations object
The succession of user trades within a located polygon (for example,
Buy bch_usd->Sell bch_btc->Sell btc_usd
).The following data is displayed for each of these trades:
- amount number
The order amount.
- lastOrderDate string
The date and time when the order has last been updated.
- instrument string
The currency pair identifier (such as
btc_usdt
):{baseAsset}_{quoteAsset}
.- orderSide string
The order side:
Buy
orSell
.
{
"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"
}
]
}
}
}