Rate Limit: 1 request per 1 second
Tip:
You can create order by websocket after login.
Request
only support market reduce-only orders currently.
{
"id":"",
"action":"MULTI_PLACE_ORDER",
"args":[
{
"clientOrderId":"",
"sym":"OKX_PERP_ETH_USDT",
"side":"SELL",
"orderType":"MARKET",
"timeInForce":"IOC",
"positionSide":"LONG",
"orderQty":"0.7"
},
{
"clientOrderId":"",
"sym":"OKX_PERP_ETH_USDT",
"side":"SELL",
"orderType":"MARKET",
"timeInForce":"GTC",
"positionSide":"LONG",
"orderQty":"0.4"
},
{
"clientOrderId":"",
"sym":"OKX_PERP_ETH_USDT",
"side":"SELL",
"orderType":"MARKET",
"timeInForce":"GTC",
"positionSide":"LONG",
"orderQty":"0.1"
}
]
}
Field name | Type | Necessary | Remarks |
---|---|---|---|
id | String | N | client request id |
action | String | Y | place_order |
args | Object | Y | request params |
> clientOrderId | String | N | Customer defined order ID ,only support letters(a-z) and numbers(0-9) |
> sym | String | Y | Sym(unique identifier:Exchange_Business_Base_Counter. Example: If you want to place a SPOT order for the BTC/USDT trading pair on the Binance exchange, you can use a unique identifier like this: "BINANCE_SPOT_BTC_USDT" ; If you want to place a PERPETUAL order for the BTC/USDT trading pair on the Binance exchange, you can use a unique identifier like this: "BINANCE_PERP_BTC_USDT" ; ) Note that we currently only support the SPOT and PERPETUAL trade of Binance and OKX. |
> side | String | Y | Side(BUY, SELL) |
> orderType | String | Y | Only support MARKET for now |
> timeInForce | String | N | TimeInForce (default GTC, support type enums:GTC,IOC,FOK,GTX), GTX = GTC + Post only |
> orderQty | String | N | Order quantity(Mandatory, unless spot market buy ) note: trading unit of OKX is the number of contracts/ trading unit of Binance is the number of coin |
> positionSide | String | N | Position side, must NONE/LONG/SHORT |
Response
Success example:
{
"id":"",
"event":"MULTI_PLACE_ORDER",
"code":200000,
"msg":"Success",
"data":[
{
"orderId":"2028325069557826",
"clientOrderId":"2028325069557826"
},
{
"orderId":"2028325069558082",
"clientOrderId":"2028325069558082"
},
{
"orderId":"2028325069558338",
"clientOrderId":"2028325069558338"
}
]
}
Fail example:
{
"channel":"Orders",
"instId":"OKX_PERP_ETH_USDT",
"data":{
"portfolioId":"1732605780300000",
"orderId":"2028325069558338",
"clientOrderId":"2028325069558338",
"exchangeType":"OKX",
"businessType":"PERP",
"sym":"OKX_PERP_ETH_USDT",
"limitPrice":"1800.02",
"orderQty":"0.1",
"quoteOrderQty":"0",
"side":"SELL",
"orderType":"DMA",
"exchangeOrderType":"MARKET",
"timeInForce":"GTC",
"executedQty":"0",
"executedAmount":"0",
"executedAvgPrice":"0",
"lastExecutedQty":"0",
"lastExecutedPrice":"0",
"lastExecutedAmount":"0",
"borrowAmount":"0",
"borrowAsset":"",
"fee":"0",
"feeCoin":"",
"rebate":"0",
"rebateCoin":"",
"orderState":"FAIL",
"updateAt":"1745894381668",
"createAt":"1745894381668",
"reason":"{\"code\":\"401093\",\"message\":\"This order is close order, but your positionQty is 0\"}",
"reduceOnly":true,
"leverage":"10",
"positionSide":"LONG",
"tpTriggerPrice":"",
"tpTriggerType":"",
"tpPrice":"",
"slTriggerPrice":"",
"slTriggerType":"",
"slPrice":""
}
}
Field name | Type | Remarks |
---|---|---|
id | String | client request id |
event | String | Event |
code | String | Code |
msg | String | Msg |
data | Object | response data |
> orderId | String | Order ID |
> clientOrderId | String | Customer defined order ID |