Methods for managing trades

On this page:

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

Get a list of trades

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

Get a history of user trades

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

Get details about trades

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

Get a list of trades with user details

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

Get a list of recent trades

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

Revert a trade


Get a list 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 or market.

orderstatus

The current order status, which can be one of the following:

  • Working — to view trades that are currently awaiting execution

  • Completed — 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 or taker.

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 or market

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 or sell.

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.

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

Get a history of user trades

Use this method to obtain a list of trades made by a specified user.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

user required

The username or email (to return entries matching this string).

Query parameters:

count required

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 or taker.

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 or market.

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 or sell.

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.

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

Get details about trades

Use this method to obtain detailed information about specified trades.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

ids type:array required

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 or taker.

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 or market.

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 or sell.

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.

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

Get a list of trades with user details

Use this method to view the detailed information about trades meeting various criteria.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

from required

The earliest date and time when the trades must have occurred to be included: YYYY-MM-DDThh:mm:ss.

to required

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 or taker.

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 or market.

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 or sell.

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.

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

Get a list of recent 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.

RESPONSE EXAMPLE
[
  {
    "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 required

The user identifier, in the GUID string format.

executionId number required

The trade execution identifier.

orderId number required

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 cancelled user trades.

RESPONSE EXAMPLE
{
  "updatedExecutionsCount": 1
}