Place TP/SL Conditional Orders (TRADE)
- POST
/capi/v3/placeTpSlOrder
Request Weight
1 on 10s order rate limit(X-ORDER-COUNT-10S); 1 on 1min order rate limit(X-ORDER-COUNT-1M); 0 on IP rate limit(X-USED-WEIGHT-1M);
Request parameters
| Parameter | Type | Required? | Description |
|---|---|---|---|
| symbol | String | Yes | Trading pair. |
| clientAlgoId | String | Yes | Client-defined identifier (1-36 characters, pattern ^[\\.A-Z\:/a-z0-9_-]{1,36}$). |
| planType | String | Yes | Plan type. Values: TAKE_PROFIT, STOP_LOSS. |
| triggerPrice | String | Yes | Trigger price (> 0). |
| executePrice | String | Conditional | Execution price. Set to 0 or omit for market execution. Copy-trading API keys only support market close, so this field must be 0 or omitted. |
| quantity | String | No | Quantity to execute. Set to 0 or omit to set TP/SL for the full position. Copy-trading API keys must close the full position, so this field must be 0 or omitted. |
| positionSide | String | Yes | Position side (LONG, SHORT). |
| triggerPriceType | String | No | Trigger source. CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE. |
| reduceOnly | Boolean | No | Whether the order is reduce-only. |
Request example
Code
Response parameters
Returns an array of objects with the following fields:
| Field | Type | Description |
|---|---|---|
| success | Boolean | Whether the plan order was accepted. |
| orderId | Long | Plan order ID when successful. |
| errorCode | String | Error code when success = false. |
| errorMessage | String | Error description when success = false. |
Response example
Code