Welcome to the new WEEX API documentation. Looking for the previous version?Switch to the legacy docs
WEEX

Place Conditional Order (TRADE)

  • POST /capi/v3/algoOrder

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

ParameterTypeRequired?Description
symbolStringYesTrading pair, e.g. BTCUSDT.
sideStringYesOrder side. Values: BUY, SELL.
positionSideStringYesPosition side. Values: LONG, SHORT.
typeStringYesConditional order type. Values: STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_MARKET.
quantityStringYesOrder quantity. Must be > 0.
priceStringConditionalExecution price. Required when type is STOP or TAKE_PROFIT.
triggerPriceStringConditionalTrigger price. Required when type is STOP, TAKE_PROFIT, STOP_MARKET, or TAKE_PROFIT_MARKET.
clientAlgoIdStringYesClient-defined identifier (1-36 characters, pattern ^[\\.A-Z\:/a-z0-9_-]{1,36}$).
presetTakeProfitPriceStringNoOptional take-profit trigger price.
presetStopLossPriceStringNoOptional stop-loss trigger price.
TpWorkingTypeStringNoTake-profit trigger type: CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE.
SlWorkingTypeStringNoStop-loss trigger type: CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE.
activatePriceStringNoTrailing stop activation price. Only valid when type = TRAILING_MARKET. If omitted, the current market price is used based on workingType.
callbackRateStringConditionalTrailing stop callback rate. Required when type = TRAILING_MARKET. Range: [0.001, 0.9999].
workingTypeStringNoPrice type used for trailing activation and callback. Values: CONTRACT_PRICE, MARK_PRICE. Default CONTRACT_PRICE.
reduceOnlyBooleanNoWhether the order is reduce-only.
Request example
PowerShellCode
curl -X POST "https://api-contract.weex.com/capi/v3/algoOrder" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "Content-Type: application/json" \ -d '{ "symbol": "BTCUSDT", "side": "BUY", "positionSide": "LONG", "type": "STOP", "quantity": "0.01", "price": "68800", "triggerPrice": "68900", "clientAlgoId": "algo-20240201-1", "presetTakeProfitPrice": "70500", "presetStopLossPrice": "68000", "TpWorkingType": "MARK_PRICE", "reduceOnly": false }'
Response parameters

Identical to the schema described in Place Order (TRADE).

Response example
JSONCode
{ "orderId": "702345678901234700", "clientOrderId": "algo-20240201-1", "success": true, "errorCode": "", "errorMessage": "" }