# Trading

## Orders

### Place SPOT order

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/v3/orders`

#### Summary

Use this method to create and submit a new order for SPOT markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

Order creation data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `spot.btc_usdt`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.timeInForce`** `string`

The [time-in-force policy](/get-started/time-in-force.md) for the order, controlling its lifetime.

Possible values:

* `Gtc`
* `Ioc`
* `Fok`
* `Gtd`
* `Day`

**`order.requestedAmount`** `decimal string`

The quantity of the base asset to buy or sell.

For Market orders, this represents the total base amount to fill; the executed amount may be lower if liquidity is insufficient.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.cancellationDate`** `string | nullable`

For GTD orders: The date and time when the order will be automatically canceled if not executed, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

Required if `timeInForce` is set to `Gtd`; ignored for other time-in-force values.

**`order.comment`** `string | nullable`

A text note to attach to the order, up to 100 characters. The comment is inherited by the resulting position and can't be edited after the order is placed.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/v3/orders HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json

{
  "order": {
    "marketId": "spot.btc_usdt",
    "side": "Buy",
    "orderType": "Limit",
    "timeInForce": "Gtc",
    "requestedAmount": 0.02,
    "requestedPrice": 115193.35,
    "comment": "Strategy A"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The created order.

**`order.marketId`** `string`

The market identifier, same as in the request.

**`order.marketDisplayName`** `string`

The market ticker.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.orderType`** `string`

The order type, same as in the request.

**`order.side`** `string`

The order side, same as in the request.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#market-and-limit-orders).

Possible values:

* `Started`
* `Pending`
* `Working`
* `Completed`
* `Cancelled`
* `Expired`
* `Rejected`

**`order.source`** `string`

The source of the order.

Possible values:

* `Manual` — the order was created manually via UI or API.

**`order.timeInForce`** `string`

The time-in-force policy, same as in the request.

**`order.commission`** `decimal string`

The fee charged for the execution of the order, expressed in the quote asset.

Right after the order is created commission is `0`.

**`order.requestedAmount`** `decimal string`

The quantity of the base asset to buy or sell, same as in the request.

**`order.remainingAmount`** `decimal string`

The amount of the base asset that remains unfilled.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders, same as in the request; `null` for market orders.

**`order.executionPrice`** `decimal string`

The volume-weighted average price at which the order was executed.

**`order.createdAt`** `string`

The timestamp when the order was created, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.updatedAt`** `string`

The timestamp of the most recent update to the order, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.rejectDetails`** `string`

The reason and details for order rejection when `status` is `Rejected`. Currently unused and not populated.

**`order.cancellationDate`** `string | nullable`

The timestamp when the order was cancelled or expired, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`; `null` if not cancelled.

**`order.fillFactor`** `decimal string`

The ratio of the filled quantity to the originally requested quantity (`filledAmount / requestedAmount`).
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "marketId": "spot.btc_usdt",
    "marketDisplayName": "SPOT BTC/USDT",
    "orderId": "01K1ZTB4DB0S6Y2NH81S781BQX",
    "orderType": "Limit",
    "side": "Buy",
    "status": "Pending",
    "source": "Manual",
    "timeInForce": "Gtc",
    "commission": "0",
    "requestedAmount": "0.02",
    "remainingAmount": "0.02",
    "requestedPrice": "115193.35",
    "executionPrice": "0",
    "createdAt": "2025-08-06T13:50:13.931Z",
    "updatedAt": "2025-08-06T13:50:13.9325008Z",
    "rejectDetails": "",
    "cancellationDate": null,
    "fillFactor": "0"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Place CFD order

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/cfd/v4/orders`

#### Summary

Use this method to create and submit a new order for CFD markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

Order creation data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `cfd.eth_eur`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.timeInForce`** `string`

The [time-in-force policy](/get-started/time-in-force.md) for the order, controlling its lifetime.

Possible values:

* `Gtc`
* `Ioc`
* `Fok`
* `Gtd`
* `Day`

**`order.requestedLotAmount`** `decimal string`

The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.cancellationDate`** `string | nullable`

For GTD orders: The date and time when the order will be automatically canceled if not executed, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

Required if `timeInForce` is set to `Gtd`; ignored for other time-in-force values.

**`order.leverage`** `integer`

The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).

**`order.stopLoss`** `object`

The Stop loss settings.

**`order.stopLoss.price`** `decimal string`

The Stop loss price.

**`order.stopLoss.isTrailing`** `boolean`

Indicates if the Stop loss is Trailing.

**`order.takeProfit`** `object`

The Take profit settings.

**`order.takeProfit.price`** `decimal string`

The take profit price.

**`order.comment`** `string | nullable`

A text note to attach to the order, up to 100 characters. The comment is inherited by the resulting position and can't be edited after the order is placed.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/cfd/v4/orders HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json

{
  "order": {
    "marketId": "cfd.eth_eur",
    "side": "Sell",
    "orderType": "Limit",
    "timeInForce": "Gtd",
    "requestedLotAmount": 1,
    "requestedPrice": 3280,
    "leverage": 75,
    "cancellationDate": "2025-08-10T00:00:00Z",
    "stopLoss": {
      "price": 3320,
      "isTrailing": false
    },
    "takeProfit": {
      "price": 3200
    },
    "comment": "Strategy A"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The created order.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#market-and-limit-orders).

Possible values:

* `Started`
* `Pending`
* `Working`
* `Completed`
* `Cancelled`
* `Expired`
* `Rejected`
  {% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "orderId": "01K2253Q9X3VTJ68PNWY40JC6Q",
    "status": "Pending"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Place PF order

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/perpetual/v4/orders`

#### Summary

Use this method to create and submit a new order for Perpetual markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

Order creation data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `perp.eth_eur`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.timeInForce`** `string`

The [time-in-force policy](/get-started/time-in-force.md) for the order, controlling its lifetime.

Possible values:

* `Gtc`
* `Ioc`
* `Fok`
* `Gtd`
* `Day`

**`order.requestedLotAmount`** `decimal string`

The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.cancellationDate`** `string | nullable`

For GTD orders: The date and time when the order will be automatically canceled if not executed, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

Required if `timeInForce` is set to `Gtd`; ignored for other time-in-force values.

**`order.leverage`** `integer`

The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).

**`order.stopLoss`** `object`

The Stop loss settings.

**`order.stopLoss.price`** `decimal string`

The Stop loss price.

**`order.stopLoss.isTrailing`** `boolean`

Indicates if the Stop loss is Trailing.

**`order.takeProfit`** `object`

The Take profit settings.

**`order.takeProfit.price`** `decimal string`

The take profit price.

**`order.comment`** `string | nullable`

A text note to attach to the order, up to 100 characters. The comment is inherited by the resulting position and can't be edited after the order is placed.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/perpetual/v4/orders HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json

{
  "order": {
    "marketId": "perp.eth_usdt",
    "side": "Buy",
    "orderType": "Market",
    "timeInForce": "Ioc",
    "requestedLotAmount": 10,
    "leverage": 159,
    "comment": "Strategy A"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The created order.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#market-and-limit-orders).

Possible values:

* `Started`
* `Pending`
* `Working`
* `Completed`
* `Cancelled`
* `Expired`
* `Rejected`
  {% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "orderId": "01K228VN55N7WFZRG70M24T9J1",
    "status": "Working"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Cancel order

<mark style="color:red;">`DELETE`</mark> `/frontoffice/api/v3/orders/`<mark style="color:blue;">`{orderId}`</mark>

#### Summary

Use this method to cancel an active order placed on SPOT, CFD, or Perpetual markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Path parameters**

**`orderId`** <mark style="color:red;">`required`</mark>

The order identifier to cancel.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
DELETE /frontoffice/api/v3/orders/01K2PF9XS29WN4JZRHMCTTQYJB HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Accept: */*
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The canceled order.

**`order.marketId`** `string`

The market identifier, same as in the request.

**`order.marketDisplayName`** `string`

The market ticker.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.orderType`** `string`

The order type, same as in the request.

**`order.side`** `string`

The order side, same as in the request.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#market-and-limit-orders).

Possible values:

* `Started`
* `Pending`
* `Working`
* `Completed`
* `Cancelled`
* `Expired`
* `Rejected`

**`order.source`** `string`

The source of the order.

Possible values:

* `Manual`
* `StopOrder`
* `FixApi`
* `System`

**`order.timeInForce`** `string`

The time-in-force policy, same as in the request.

**`order.commission`** `decimal string`

The fee charged for the execution of the order, expressed in the quote asset.

**`order.requestedAmount`** `decimal string`

The quantity of the base asset to buy or sell, same as in the request.

**`order.remainingAmount`** `decimal string`

The amount of the base asset that remains unfilled.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders, same as in the request; `null` for market orders.

**`order.executionPrice`** `decimal string`

The volume-weighted average price at which the order was executed.

**`order.createdAt`** `string`

The timestamp when the order was created, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.updatedAt`** `string`

The timestamp of the most recent update to the order, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.rejectDetails`** `string`

The reason and details for order rejection when `status` is `Rejected`. Currently unused and not populated.

**`order.cancellationDate`** `string | nullable`

The timestamp when the order was cancelled or expired, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`; `null` if not cancelled.

**`order.fillFactor`** `decimal string`

The ratio of the filled quantity to the originally requested quantity (`filledAmount / requestedAmount`).
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "marketId": "spot.eth_usdt",
    "marketDisplayName": "SPOT ETH/USDT",
    "orderId": "01K2PF9XS29WN4JZRHMCTTQYJB",
    "orderType": "Limit",
    "side": "Buy",
    "status": "Cancelled",
    "source": "Manual",
    "timeInForce": "Gtc",
    "commission": "0",
    "requestedAmount": "0.1",
    "remainingAmount": "0.1",
    "requestedPrice": "4450",
    "executionPrice": "0",
    "createdAt": "2025-08-15T08:59:51.97Z",
    "updatedAt": "2025-08-15T09:00:06.2791048Z",
    "rejectDetails": "",
    "cancellationDate": null,
    "fillFactor": "0"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Get SPOT order data

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/v3/order-data`

#### Summary

Use this method to retrieve and validate order data for SPOT market orders before placing.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

The order data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `spot.btc_usdt`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.requestedBaseAmount`** `decimal string | nullable`

The requested amount in base asset units.

**`order.requestedQuoteAmount`** `decimal string | nullable`

The requested amount in quote asset units.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/v3/order-data HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=3.0
Accept: */*

{
  "order": {
    "marketId": "spot.eth_usdt",
    "side": "Buy",
    "orderType": "Limit",
    "requestedBaseAmount": 0.2,
    "requestedPrice": 4600
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`baseAmount`** `decimal string`

The calculated base asset amount for the order.

**`quoteAmount`** `decimal string`

The calculated quote asset amount for the order.

**`commissionAmount`** `decimal string`

The estimated commission amount to be charged.

**`total`** `decimal string`

The total quote asset amount, including the estimated commission.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "baseAmount": "0.2",
    "quoteAmount": "920",
    "commissionAmount": "9.2",
    "total": "929.2"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Get CFD order data

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/cfd/v4/order-data`

#### Summary

Use this method to retrieve and validate order data for CFD market orders before placing.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

The order data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `spot.btc_usdt`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.leverage`** `integer`

The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).

**`order.requestedLotAmount`** `decimal string`

The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.takeProfit.triggerType`** `string · enum | nullable`

The trigger calculation type for Take profit.

Possible values:

* `Price`
* `Rate`
* `Points`
* `Pnl`

**`order.takeProfit.triggerSize`** `decimal string | nullable`

The trigger value in selected units.

**`order.stopLoss.triggerType`** `string · enum | nullable`

The trigger calculation type for Stop loss.

Possible values:

* `Price`
* `Rate`
* `Points`
* `Pnl`

**`order.stopLoss.triggerSize`** `decimal string | nullable`

The trigger value in selected units.

**`order.stopLoss.isTrailing`** `boolean | nullable`

If `true`, enables the Trailing behavior for Stop loss.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/cfd/v4/order-data HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "order": {
    "takeProfit": {
      "triggerSize": 15000,
      "triggerType": "points"
    },
    "stopLoss": {
      "triggerSize": "4020",
      "triggerType": "price",
      "isTrailing": false
    },
    "marketId": "cfd.eth_eur",
    "side": "Sell",
    "orderType": "Market",
    "leverage": 135,
    "requestedLotAmount": 1
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`requiredMarginInRAT`** `decimal string`

The required margin amount, in conversion to RAT.

**`quoteAmount`** `decimal string`

The calculated quote asset amount for the order.

**`commissionAmountInRAT`** `decimal string`

The estimated commission amount to be charged, in conversion to RAT.

**`marginLevel`** `decimal string | nullable`

The resulting margin level.

**`takeProfit.price`** `decimal string`

The calculated Take profit price, based on trigger settings.

**`takeProfit.rate`** `decimal string`

The calculated Take profit rate.

**`takeProfit.points`** `integer · int64`

The calculated take profit offset, in points.

**`takeProfit.pnl`** `decimal string`

The projected PnL at Take profit.

**`stopLoss.price`** `decimal string`

The calculated Stop loss price, based on trigger settings.

**`stopLoss.rate`** `decimal string`

The calculated Stop loss rate.

**`stopLoss.points`** `integer · int64`

The calculated Stop loss offset, in points.

**`stopLoss.pnl`** `decimal string`

The projected PnL at Stop loss.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "requiredMarginInRAT": "34.4613643",
    "quoteAmount": "4004.345",
    "commissionAmountInRAT": "0",
    "marginLevel": "5.3015",
    "takeProfit": {
      "price": "3989.345",
      "rate": "0.0037",
      "points": 15000,
      "pnl": "17.42713545"
    },
    "stopLoss": {
      "price": "4020",
      "rate": "-0.0039",
      "points": -15655,
      "pnl": "-18.18812036"
    }
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Get PF order data

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/perpetual/v4/order-data`

#### Summary

Use this method to retrieve and validate order data for Perpetual market orders before placing.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

The order data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `spot.btc_usdt`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.leverage`** `integer`

The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).

**`order.requestedLotAmount`** `decimal string`

The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.takeProfit.triggerType`** `string · enum | nullable`

The trigger calculation type for Take profit.

Possible values:

* `Price`
* `Rate`
* `Points`
* `Pnl`

**`order.takeProfit.triggerSize`** `decimal string | nullable`

The trigger value in selected units.

**`order.stopLoss.triggerType`** `string · enum | nullable`

The trigger calculation type for Stop loss.

Possible values:

* `Price`
* `Rate`
* `Points`
* `Pnl`

**`order.stopLoss.triggerSize`** `decimal string | nullable`

The trigger value in selected units.

**`order.stopLoss.isTrailing`** `boolean | nullable`

If `true`, enables Trailing behavior for Stop loss.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/perpetual/v4/order-data HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "order": {
    "takeProfit": {
      "triggerSize": "0.01",
      "triggerType": "rate"
    },
    "stopLoss": {
      "triggerSize": "-100",
      "triggerType": "pnl",
      "isTrailing": false
    },
    "marketId": "perp.btc_usdt",
    "side": "Buy",
    "orderType": "Limit",
    "leverage": 100,
    "requestedLotAmount": 0.5,
    "requestedPrice": 118450
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`requiredMarginInRAT`** `decimal string`

The required margin amount, in conversion to RAT.

**`quoteAmount`** `decimal string`

The calculated quote asset amount for the order.

**`commissionAmountInRAT`** `decimal string`

The estimated commission amount to be charged, in conversion to RAT.

**`marginLevel`** `decimal string | nullable`

The resulting margin level.

**`takeProfit.price`** `decimal string`

The calculated Take profit price, based on trigger settings.

**`takeProfit.rate`** `decimal string`

The calculated Take profit rate.

**`takeProfit.points`** `integer · int64`

The calculated take profit offset, in points.

**`takeProfit.pnl`** `decimal string`

The projected PnL at Take profit.

**`stopLoss.price`** `decimal string`

The calculated Stop loss price, based on trigger settings.

**`stopLoss.rate`** `decimal string`

The calculated Stop loss rate.

**`stopLoss.points`** `integer · int64`

The calculated Stop loss offset, in points.

**`stopLoss.pnl`** `decimal string`

The projected PnL at Stop loss.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "requiredMarginInRAT": "592.25",
    "quoteAmount": "59225",
    "commissionAmountInRAT": "0",
    "marginLevel": "0.3582",
    "takeProfit": {
      "price": "119634.5",
      "rate": "0.01",
      "points": 11845,
      "pnl": "592.25"
    },
    "stopLoss": {
      "price": "118250",
      "rate": "-0.0016",
      "points": -2000,
      "pnl": "-100"
    }
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

## Stop orders

### Place SPOT Stop order

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/v3/stop-orders`

#### Summary

Use this method to create and submit a new Stop order for SPOT markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

Order creation data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `spot.btc_usdt`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.timeInForce`** `string`

The [time-in-force policy](/get-started/time-in-force.md) for the order, controlling its lifetime.

Possible values:

* `Gtc`
* `Ioc`
* `Fok`
* `Gtd`
* `Day`

**`order.requestedAmount`** `decimal string`

The quantity of the base asset to buy or sell.

For Market orders, this represents the total base amount to fill; the executed amount may be lower if liquidity is insufficient.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`activationPrice`** `decimal string | nullable`

The trigger price that activates the Stop order.

**`order.cancellationDate`** `string | nullable`

For GTD orders: The date and time when the order will be automatically canceled if not executed, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

Required if `timeInForce` is set to `Gtd`; ignored for other time-in-force values.

**`order.comment`** `string | nullable`

A text note to attach to the order, up to 100 characters. The comment is inherited by the resulting position and can't be edited after the order is placed.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/v3/stop-orders HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "order": {
    "marketId": "spot.btc_usdt",
    "side": "Buy",
    "orderType": "Market",
    "activationPrice": 128000,
    "requestedAmount": 0.01,
    "timeInForce": "Ioc",
    "comment": "Strategy A"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The created order.

**`order.marketId`** `string`

The market identifier, same as in the request.

**`order.marketDisplayName`** `string`

The market ticker.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.orderType`** `string`

The order type, same as in the request.

**`order.side`** `string`

The order side, same as in the request.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders, same as in the request; `null` for market orders.

**`activationPrice`** `decimal string | nullable`

The trigger price that activates the Stop order, same as in the request.

**`order.requestedAmount`** `decimal string`

The quantity of the base asset to buy or sell, same as in the request.

**`order.timeInForce`** `string`

The time-in-force policy, same as in the request.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#stop-orders).

Possible values:

* `WaitingForActivation`
* `Activated`
* `Rejected`

**`order.createdAt`** `string`

The timestamp when the order was created, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.updatedAt`** `string`

The timestamp of the most recent update to the order, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.cancellationDate`** `string | nullable`

The timestamp when the order was cancelled or expired, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`; `null` if not cancelled.

**`order.comment`** `string | nullable`

The text note attached to the order, up to 100 characters.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "marketId": "spot.btc_usdt",
    "marketDisplayName": "SPOT BTC/USDT",
    "orderId": "01K2MNC3BVR5WRTBEE9YWAS91K",
    "orderType": "Market",
    "side": "Buy",
    "requestedPrice": "0",
    "activationPrice": "128000",
    "requestedAmount": "0.01",
    "timeInForce": "Ioc",
    "status": "WaitingForActivation",
    "createdAt": "2025-08-14T16:07:25.8193038Z",
    "updatedAt": "2025-08-14T16:07:25.8193044Z",
    "cancellationDate": null,
    "comment": null
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Place CFD Stop order

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/cfd/v4/stop-orders`

#### Summary

Use this method to create and submit a new Stop order for CFD markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

Order creation data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `cfd.eth_eur`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.timeInForce`** `string`

The [time-in-force policy](/get-started/time-in-force.md) for the order, controlling its lifetime.

Possible values:

* `Gtc`
* `Ioc`
* `Fok`
* `Gtd`
* `Day`

**`order.requestedLotAmount`** `decimal string`

The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.activationPrice`** `decimal string | nullable`

The trigger price that activates the Stop order.

**`order.cancellationDate`** `string | nullable`

For GTD orders: The date and time when the order will be automatically canceled if not executed, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

Required if `timeInForce` is set to `Gtd`; ignored for other time-in-force values.

**`order.leverage`** `integer`

The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).

**`order.stopLoss`** `object`

The Stop loss settings.

**`order.stopLoss.price`** `decimal string`

The Stop loss price.

**`order.stopLoss.isTrailing`** `boolean`

Indicates if the Stop loss is Trailing.

**`order.takeProfit`** `object`

The Take profit settings.

**`order.takeProfit.price`** `decimal string`

The take profit price.

**`order.comment`** `string | nullable`

A text note to attach to the order, up to 100 characters. The comment is inherited by the resulting position and can't be edited after the order is placed.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/cfd/v4/stop-orders HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "order": {
    "marketId": "cfd.eth_eur",
    "side": "Sell",
    "orderType": "Limit",
    "activationPrice": 3200,
    "requestedLotAmount": 0.5,
    "timeInForce": "Gtd",
    "leverage": 76,
    "requestedPrice": 3500,
    "cancellationDate": "2025-08-18T00:00:00Z",
    "stopLoss": {
      "price": "3900",
      "isTrailing": false
    },
    "takeProfit": {
      "price": "3100"
    },
    "comment": "Strategy A"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The created order.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#stop-orders).

Possible values:

* `WaitingForActivation`
* `Activated`
* `Rejected`
  {% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "orderId": "01K2MNRWP2J1S8T9TKTCXWYY87",
    "status": "WaitingForActivation"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Place PF Stop order

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/perpetual/v4/stop-orders`

#### Summary

Use this method to create and submit a new Stop order for Perpetual markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`order`** `object`

Order creation data.

**`order.marketId`** `string`

The market identifier, in the following format: `{marketType}.{baseAssetId}_{quoteAssetId}`, for example: `cfd.eth_eur`.

Must match one of the available markets returned by the [Get markets](/rest-api/settings.md#get-markets) endpoint.

**`order.side`** `string`

The order side, indicating the direction of the trade.

Possible values:

* `Buy`
* `Sell`

**`order.orderType`** `string`

The [order type](/get-started/order-types.md).

Possible values:

* `Market`
* `Limit`

**`order.timeInForce`** `string`

The [time-in-force policy](/get-started/time-in-force.md) for the order, controlling its lifetime.

Possible values:

* `Gtc`
* `Ioc`
* `Fok`
* `Gtd`
* `Day`

**`order.requestedLotAmount`** `decimal string`

The quantity of the base asset to buy or sell, in lots. Lot size is defined per market and determines the base asset quantity represented by one lot. Upon execution, this defines the opened position size in lots.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.activationPrice`** `decimal string | nullable`

The trigger price that activates the Stop order.

**`order.cancellationDate`** `string | nullable`

For GTD orders: The date and time when the order will be automatically canceled if not executed, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

Required if `timeInForce` is set to `Gtd`; ignored for other time-in-force values.

**`order.leverage`** `integer`

The leverage factor applied to the position. Leverage determines margin required to open and maintain the position (for example, with leverage 10, only 10% of the position's notional value is required as margin).

**`order.stopLoss`** `object`

The Stop loss settings.

**`order.stopLoss.price`** `decimal string`

The Stop loss price.

**`order.stopLoss.isTrailing`** `boolean`

Indicates if the Stop loss is Trailing.

**`order.takeProfit`** `object`

The Take profit settings.

**`order.takeProfit.price`** `decimal string`

The take profit price.

**`order.comment`** `string | nullable`

A text note to attach to the order, up to 100 characters. The comment is inherited by the resulting position and can't be edited after the order is placed.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/perpetual/v4/stop-orders HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "order": {
    "marketId": "perp.btc_usdt",
    "side": "Sell",
    "orderType": "Market",
    "activationPrice": 115000,
    "requestedLotAmount": 1,
    "timeInForce": "Fok",
    "leverage": 22,
    "stopLoss": {
      "price": "118020",
      "isTrailing": true
    },
    "takeProfit": {
      "price": "113873"
    },
    "comment": "Strategy A"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The created order.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#stop-orders).

Possible values:

* `WaitingForActivation`
* `Activated`
* `Rejected`
  {% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "orderId": "01K2MNM0S8B2R9DS7BWJ8PGYPR",
    "status": "WaitingForActivation"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Cancel Stop order

<mark style="color:red;">`DELETE`</mark> `/frontoffice/api/v3/stop-orders/`<mark style="color:blue;">`{orderId}`</mark>

#### Summary

Use this method to cancel an active Stop order placed on SPOT, CFD, or Perpetual markets.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Path parameters**

**`orderId`** <mark style="color:red;">`required`</mark>

The Stop order identifier to cancel.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
DELETE /frontoffice/api/v3/stop-orders/01K2MNGAWPMQJ7WGATFSCAS1G4 HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`order`** `object`

The canceled order.

**`order.marketId`** `string`

The market identifier, same as in the request.

**`order.marketDisplayName`** `string`

The market ticker.

**`order.orderId`** `string`

The unique identifier of the order assigned by the system.

**`order.orderType`** `string`

The order type, same as in the request.

**`order.side`** `string`

The order side, same as in the request.

**`order.requestedPrice`** `decimal string | nullable`

The limit price for Limit orders (the maximum price for a buy or minimum price for a sell).

Must be `null` or omitted for Market orders.

**`order.activationPrice`** `decimal string | nullable`

The trigger price that activates the Stop order.

**`order.requestedAmount`** `decimal string`

The quantity of the base asset to buy or sell, same as in the request.

**`order.timeInForce`** `string`

The time-in-force policy, same as in the request.

**`order.status`** `string`

The current [order status](/get-started/order-statuses.md#stop-orders).

Possible values:

* `WaitingForActivation`
* `Activated`
* `Rejected`

**`order.createdAt`** `string`

The timestamp when the order was created, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.updatedAt`** `string`

The timestamp of the most recent update to the order, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`.

**`order.cancellationDate`** `string | nullable`

The timestamp when the order was cancelled or expired, in the following format: `YYYY-MM-DDTHH:MM:SS.sssZ`; `null` if not cancelled.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "order": {
    "marketId": "perp.btc_usdt",
    "marketDisplayName": "Perpetual BTC/USDT",
    "orderId": "01K2MNGAWPMQJ7WGATFSCAS1G4",
    "orderType": "Limit",
    "side": "Sell",
    "requestedPrice": "115100",
    "activationPrice": "115000",
    "requestedAmount": "1",
    "timeInForce": "Gtc",
    "status": "Rejected",
    "createdAt": "2025-08-14T16:09:44.5986099Z",
    "updatedAt": "2025-08-14T16:09:44.5986103Z",
    "cancellationDate": null
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

## Positions

### Close position

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/v4/positions/`<mark style="color:blue;">`{positionId}`</mark>`/close`

#### Summary

Use this method to close a specific position entirely or partially.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Path parameters**

**`positionId`** <mark style="color:red;">`required`</mark>

The position identifier to close.

**Body**

**`closePositionLotAmount`** `decimal string | nullable`

The portion of the position to close, in lots.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/v4/positions/01K2PFXDP1FWCJSGTX4GJ6JHM0/close HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`positionId`** `string`

The position identifier.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "positionId": "01K2PFXDP1FWCJSGTX4GJ6JHM0"
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Bulk close positions

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/v4/positions/bulk-close`

#### Summary

Use this method to close multiple positions simultaneously based on different criteria such as all positions, positive PnL only, or negative PnL only.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Body**

**`mode`** `string` <mark style="color:red;">`required`</mark>

The bulk close mode.

Possible values:

* `AllPositions` — close all positions.
* `PositivePnl` — close only positions with positive PnL.
* `NegativePnl` — close only positions with negative PnL.
  {% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/v4/positions/bulk-close HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "mode": "AllPositions"
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned containing identifiers of closed positions.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "status": "accepted",
  "positionIds": [
    "01K228VNC2Q7E7K9W8GABWBZ5Z",
    "01K22BZ2DCETJZKW6MK81N1T8Y",
    "01K2CXF06A3A5SK2YFJT67CMZ5",
    "01K2CXF2ZJ6MJYMEK663TBBY8K",
    "01K2PFXDP1FWCJSGTX4GJ6JHM0"
  ]
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Get trigger data

<mark style="color:blue;">`POST`</mark> `/frontoffice/api/v4/positions/`<mark style="color:blue;">`{positionId}`</mark>`/trigger-data`

#### Summary

Use this method to retrieve Stop loss and Take profit settings for an open position.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Path parameters**

**`positionId`** <mark style="color:red;">`required`</mark>

The position identifier.

**Body**

**`stopLoss.triggerType`** `string · enum | nullable`

The trigger calculation type for Stop loss.

Possible values:

* `Price`
* `Rate`
* `Points`
* `Pnl`

**`stopLoss.triggerSize`** `decimal string | nullable`

The trigger value in selected units.

**`stopLoss.isTrailing`** `boolean | nullable`

Indicates if Stop loss is Trailing.

**`takeProfit.triggerType`** `string · enum | nullable`

The trigger calculation type for Take profit.

Possible values:

* `Price`
* `Rate`
* `Points`
* `Pnl`

**`order.takeProfit.triggerSize`** `decimal string | nullable`

The trigger value in selected units.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
POST /frontoffice/api/v4/positions/01K2HYXA7N2G9NHTFEWYVM9SEQ/trigger-data HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "stopLoss": {
    "triggerSize": "-0.01",
    "triggerType": "rate",
    "isTrailing": true
  },
  "takeProfit": {
    "triggerSize": 2500,
    "triggerType": "points"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned.

Each object contains the following information:

**`takeProfit.price`** `decimal string`

The calculated Take profit price, based on trigger settings.

**`takeProfit.rate`** `decimal string`

The calculated Take profit rate.

**`takeProfit.points`** `integer · int64`

The calculated take profit offset, in points.

**`takeProfit.pnl`** `decimal string`

The projected PnL at Take profit.

**`stopLoss.price`** `decimal string`

The calculated Stop loss price, based on trigger settings.

**`stopLoss.rate`** `decimal string`

The calculated Stop loss rate.

**`stopLoss.points`** `integer · int64`

The calculated Stop loss offset, in points.

**`stopLoss.pnl`** `decimal string`

The projected PnL at Stop loss.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "takeProfit": {
    "price": "248.27",
    "rate": "0.1119",
    "points": 2500,
    "pnl": "21.5"
  },
  "stopLoss": {
    "price": "221.04",
    "rate": "-0.01",
    "points": -223,
    "pnl": "-1.91"
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Submit triggers

<mark style="color:blue;">`PUT`</mark> `/frontoffice/api/v4/positions/`<mark style="color:blue;">`{positionId}`</mark>`/triggers`

#### Summary

Use this method to modify Stop loss and Take profit settings for an open position.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Path parameters**

**`positionId`** <mark style="color:red;">`required`</mark>

The position identifier.

**Body**

**`stopLoss.price`** `decimal string`

The Stop loss trigger price.

**`stopLoss.isTrailing`** `boolean`

If `true`, enables the Trailing behavior for Stop loss.

**`takeProfit.price`** `decimal string`

The Take profit trigger price.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
PUT /frontoffice/api/v4/positions/01K2HYXA7N2G9NHTFEWYVM9SEQ/triggers HTTP/1.1
Host: {host}
Authorization: Bearer JWT
accountId: {accountId}
Content-Type: application/json; x-api-version=4.0
Accept: */*

{
  "stopLoss": {
    "price": "165.13",
    "isTrailing": true
  },
  "takeProfit": {
    "price": 250
  }
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned containing the identifier of the updated position.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "positionId": "01K2HYXA7N2G9NHTFEWYVM9SEQ"
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

## Commissions

### Get account trading volume

<mark style="color:green;">`GET`</mark> `/frontoffice/api/v3/commission/`<mark style="color:blue;">`{dynamicCommissionGroupId}`</mark>`/account-trading-volume`

#### Summary

Use this method to obtain a cumulative account trading volume used for calculating the commission tier.

#### Request

{% columns %}
{% column width="60%" %}
**Header parameters**

**`accountId`** <mark style="color:red;">`required`</mark>

The trading account identifier.

**Path parameters**

**`dynamicCommissionGroupId`** <mark style="color:red;">`required`</mark>

The dynamic commission group identifier.

Use [Get market](/rest-api/settings.md#get-market) to obtain.
{% endcolumn %}

{% column width="40%" %}
{% code title="Request example" %}

```http
GET /frontoffice/api/v3/commission/{dynamicCommissionGroupId}/account-trading-volume HTTP/1.1
Host: {host}
Authorization: Bearer JWT
Content-Type: application/json; x-api-version=4.0
Accept: */*
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

#### Response

{% columns %}
{% column width="60%" %}
In case of success, an object will be returned containing current trading volume, in RAT, for the account.
{% endcolumn %}

{% column width="40%" %}
{% code title="Response example — 200: OK" %}

```json
{
  "currentTradingVolumeInRAT": "string"
}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.b2prime.com/rest-api/trading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
