Bind take-profit / stop-loss to a position
POSTπ Trading
Attaches a take-profit and/or stop-loss trigger order to an existing position; at least one of takeProfitTriggerPrice or stopLossTriggerPrice must be provided.
Request Parametersβ
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Market symbol of the position to attach TP/SL to (e.g. BTC-PERP). |
| orderSide | String | Yes | Side of the closing trigger order; the opposite of the position direction (SELL for LONG, BUY for SHORT). |
| positionMode | String | No | Position mode of the target position (ONE_WAY or HEDGE). Required in hedge mode to disambiguate. |
| positionId | String | Yes | Identifier of the position to attach TP/SL to. |
| takeProfitTriggerType | String | No | Reference price type used to evaluate the take-profit trigger (INDEX_PRICE, LAST_PRICE, or MARK_PRICE). |
| takeProfitTriggerPrice | Double | No | Take-profit trigger price. Required if stopLossTriggerPrice is not provided. |
| stopLossTriggerType | String | No | Reference price type used to evaluate the stop-loss trigger (INDEX_PRICE, LAST_PRICE, or MARK_PRICE). |
| stopLossTriggerPrice | Double | No | Stop-loss trigger price. Required if takeProfitTriggerPrice is not provided. |
Response Contentβ
| Name | Type | Description |
|---|---|---|
| symbol | String | Market symbol of the position (e.g. BTC-PERP). |
| status | Integer | Status code of the TP/SL binding. |
| type | Integer | Event type code of the TP/SL response entry (indicates whether it represents take-profit or stop-loss). |
| orderId | String | Server-assigned identifier of the created trigger order. |
| clOrderId | String | Client-assigned order id, if provided in the request. |
| triggerPrice | Double | Trigger price at which the take-profit or stop-loss will fire. |
| positionMode | String | Position mode of the target position (ONE_WAY or HEDGE). |
| positionDirection | String | Position direction of the target position (LONG or SHORT). |
| positionId | String | Identifier of the position the trigger is attached to. |
| timestamp | Long | Server timestamp of the response, in milliseconds since epoch. |
| message | String | Human-readable message describing the result. |
example
POST
https://api.btse.com/futures/api/v3/trade/positions/tpslRequest (default)
{
"symbol": "BTC-PERP",
"orderSide": "SELL",
"positionId": "BTC-PERP-USDT",
"takeProfitTriggerType": "MARK_PRICE",
"takeProfitTriggerPrice": 63010.5,
"stopLossTriggerType": "MARK_PRICE",
"stopLossTriggerPrice": 57009.5
}
Response (default)
[
{
"symbol": "BTC-PERP",
"status": 9,
"type": 0,
"orderId": "bf02a69f-d735-437c-bc59-4759dc850c2b",
"clOrderId": "",
"triggerPrice": 0,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timestamp": 1784882344606,
"message": null
}
]