Skip to main content

Place TP/SL Order

  • POST /capi/v2/order/placeTpSlOrder

Weight(IP): 2, Weight(UID): 5

Request parameters

ParameterTypeRequired?Description
symbolStringYesTrading pair
clientOrderIdStringYesCustom order ID (no more than 40 characters)
planTypeStringYesTP/SL type:
profit_plan: Take-profit plan order
loss_plan: Stop-loss plan order
triggerPriceStringYesTrigger price
executePriceStringNoExecution price. If not provided or set to 0, market price will be used. Value > 0 means limit price
sizeStringYesOrder quantity
positionSideStringYesPosition direction:
long: Long position
short: Short position
marginModeIntegerNoMargin mode:
1: Cross Mode
3: Isolated Mode
Default is 1 (Cross Mode)

Request example

curl -X POST "https://api-contract.weex.com/capi/v2/order/placeTpSlOrder" \
-H "ACCESS-KEY:*******" \
-H "ACCESS-SIGN:*" \
-H "ACCESS-PASSPHRASE:*" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:zh-CN" \
-H "Content-Type: application/json" \
-d '{"symbol": "cmt_btcusdt", "clientOrderId": "123456789", "planType": "profit_plan",
"triggerPrice": "50000", "executePrice": "0", "size": "1", "positionSide": "long", "marginMode": 1}'

Response parameters

ParameterTypeDescription
successBooleanWhether the TP/SL order was placed successfully
orderIdLongOrder ID (0 if failed)

Response example

[
{
"orderId": 696073048050107226,
"success": true
}
]