Trades

On this page:

THE TRADE OBJECT

A detailed description of the JSON object

GET[base]/trades

Get a trades list

GET[base]/trades/{tradeId}

Get trade details


The Trade object

This object provides the following data about the trade:

tradeId string

The identifier of a trade.

tradeIdentifier string

The identifier of a trade on a trading platform.

tradeTime string

The date and time when a trade has been executed.

paymentCount integer

The total number of rewards paid or the trade.

platformId string

The identifier of a trading platform.

platformName string

The name of a trading platform.

platformProvider string

The name of a connection provider of the trading platform.

platformAddress string

The hostname and port used to set up connection to a trading platform.

platformGroupId string

The identifier of a trading group on the platform.

platformGroupName string

The group name of a trading group on the platform.

environment string

Deprecated.

profileId string

The identifier of a user profile.

accountId string

The identifier of a client account.

accountNumber string

The number of a client account on a trading platform.

accountUuid string

The universally unique identifier of a trading account (if provided). Refer to Integrations for more information.

accountType integer

The account type. Possible values:

  • 0 — default

  • 1 — payment

  • 2 — investment

  • 3 — master

  • 4 — B2Copy investment

  • 5 — B2Copy master

  • 6 — PAMM investment

  • 7 — PAMM master

  • 8 — MAM investment

  • 9 — MAM master

symbolId string

The symbol identifier.

symbolPath string

The hierarchical symbol path: platform group\\symbol group\\symbol name.

symbolName string

The symbol name.

symbolQuoteCurrencyCode string

The alphabetic code of a quote currency.

volume string

The trade volume, in lots.

usdTradingVolume string

The trade volume, in USD.

price string

The execution price of a trade.

side string

The trade side. Possible values:

  • buy

  • sell

position string

The state of a position, as a result of a trade. Possible values:

  • open

  • closed

positionId string

The identifier of a position.

positionLifetime integer

The lifetime of a position, in seconds.

profitAmount string

The profit amount after the trade execution.

profitCurrencyCode string

The alphabetic code of a currency in which the profit amount was calculated.

pnlAmount string

The profit-loss value.

pnlCurrencyCode string

The alphabetic code of a currency in which the profit-loss value was calculated.

swapAmount string

The swap amount.

swapCurrencyCode string

The alphabetic code of a swap currency.

commissionAmount string

The amount of commission paid for the trade.

commissionCurrencyCode string

The alphabetic code of currency in which the commission was paid.

createTime string

The date and time when the object has been created.

updateTime string

The date and time when the object has been last updated.

uuid string

The universally unique identifier of the object (if provided). Refer to Integrations for more information.

THE TRADE OBJECT
{
  "tradeId": "6006dda272f002519c3eb505",
  "tradeIdentifier": "12345",
  "tradeTime": "2021-01-01T00:00:00+00:00",
  "paymentCount": 2,
  "platformId": "6006dda272f002519c3eb505",
  "platformName": "MetaTrader 5",
  "platformProvider": "metatrader5",
  "platformAddress": "5.9.30.186:4443",
  "platformGroupId": "6006dda272f002519c3eb505",
  "platformGroupName": "B2BUSD",
  "environment": "production",
  "profileId": "6006dda272f002519c3eb505",
  "accountId": "6006dda272f002519c3eb505",
  "accountNumber": "12345",
  "accountUuid": null,
  "accountType": 2,
  "symbolId": "6006dda272f002519c3eb505",
  "symbolPath": "B2BUSD\\Shares\\AAPL",
  "symbolName": "AAPL",
  "symbolQuoteCurrencyCode": "BTC",
  "volume": "1.000000000000000000",
  "usdTradingVolume": "1.000000000000000000",
  "price": "2.14285602",
  "side": "culpa conse",
  "position": "open",
  "positionId": "6006dda272f002519c3eb505",
  "positionLifetime": 2,
  "profitAmount": "2.14285602",
  "profitCurrencyCode": "BTC",
  "pnlAmount": "2.14285602",
  "pnlCurrencyCode": "BTC",
  "swapAmount": "2.14285602",
  "swapCurrencyCode": "BTC",
  "commissionAmount": "-2.620000000000000000",
  "commissionCurrencyCode": "BTC",
  "createTime": "2021-01-01T00:00:00+00:00",
  "updateTime": "2021-01-01T00:00:00+00:00",
  "uuid": null
}

Get a trades list

Use this method to obtain a list of available trades.

To obtain detailed information about a specified trade, use a separate method to get trade details.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

This method supports pagination, sorting, filtering, and query. For details on applying the parameters, refer to the Query parameters section. Possible parameters for filtering, sorting, and query are listed below. For values description, refer to the Trade object.

Possible values for the filter parameter:

  • accountId

  • accountType

  • paymentCount

  • tradePlatformGroupNames

  • platformId

  • profileId

  • tradeEndTime

  • tradeIdentifier

  • tradePosition

  • tradePositionId

  • tradePositionLifetime

  • tradeSide

  • tradeStartTime

  • symbolName

  • volume

Possible values for the sort_by parameter:

  • accountId

  • accountIdentifier

  • createTime (default)

  • paymentCount

  • platformGroupName

  • platformId

  • price

  • profit

  • tradeIdentifier

  • symbolName

  • tradePosition

  • tradePositionId

  • tradePositionLifetime

  • tradeSide

  • tradeTime

  • volume

Possible values for the query parameter:

  • payments — information about trade-related reward payments

GET[base]/trades

curl --location -g --request GET 'https://your.base-url.here/trades?limit=10&offset=0&sort_by=createTime&sort_order=desc&filter[accountId]=6006dda272f002519c3eb505&accountType=2&filter[payments]=<boolean>&filter[platformGroupName]=B2BUSD, real&filter[platformId]=6006dda272f002519c3eb505&filter[profileId]=6006dda272f002519c3eb505&filter[tradeEndTime]=2021-01-31T23:59:59+00:00&filter[tradeIdentifier]=12345&filter[tradePosition]=open&filter[tradePositionId]=6006dda272f002519c3eb505&filter[tradePositionLifetime]=2&filter[tradeSide]=buy&filter[tradeStartTime]=2021-01-01T00:00:00+00:00&filter[symbolName]=BTCUSD&filter[volume]=1.000000000000000000&query[payments]=1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an array of Trade objects providing information about all trades that correspond to the query parameters specified in the request.

Additionally, the response body may contain the following information if it was specified in the query parameters of the request:


Get trade details

Use this method to obtain detailed information about a specified trade.

To obtain a list of available trades, use a separate method to get a list of trades.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

tradeId required

The trade identifier.

Query parameters:

This method supports query. For details on applying the parameters, refer to the Query parameters section.

Possible values for the query parameter:

  • payments — information about trade-related reward payments

GET[base]v1/trades/{tradeId}

curl --location -g --request GET 'https://your.base-url.here/trades/60ba407d15951453e60e49f8?query[payments]=1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains a Trade object providing information about the specified trade.

Additionally, the response body may contain the following information if it was specified in the query parameters of the request: