Rate Limit: 1200 requests per 60 seconds
Tip:
You can create order by websocket after login.
Request
demo
{
"id": "XXX",
"action": "place_order",
"args":
{
"clientOrderId": "XXXX",
"sym": "BINANCE_SPOT_BTC_USDT",
"side": "BUY",
"orderType": "LIMIT",
"timeInForce": "GTC",
"orderQty": "1000",
"limitPrice": "60000",
"reduceOnly": "false"
}
}
| 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 | Order type(default LIMIT, support type enums:LIMIT,MARKET) |
| > timeInForce | String | N | Limit Order:default GTC, support type enums:GTC,IOC,FOK,GTX. GTX = GTC + Post only. Market Order:No need to fill in, default&only IOC |
| > 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 |
| > limitPrice | String | N | Limit order price(Mandatory for limit order) |
| > quoteOrderQty | String | N | Order quote quantity, only use for spot market buy order |
| > reduceOnly | String | N | Reduce position orders only, must "true" or "false" |
| > positionSide | String | N | Position side, must NONE/LONG/SHORT |
| > tpTriggerPrice | String | N | Take profit trigger price |
| > tpTriggerType | String | N | Take profit trigger price type : LAST_PRICE or MARK_PRICE default LAST_PRICE |
| > tpPrice | String | N | Take profit price; "0" indicates market price; default "0" |
| > slTriggerPrice | String | N | Stop loss trigger price |
| > slTriggerType | String | N | Stop loss trigger price type : LAST_PRICE or MARK_PRICE default LAST_PRICE |
| > slPrice | String | N | Stop loss price ; "0" indicates market price; default "0" |
| > syncMode | String | N | API synchronous validation or asynchronous validation(required "true" or "false") |
Response
Success example:
{
"id": "XXXX",
"event": "place_order",
"code": "200000",
"msg": "",
"data": {
"orderId": "XXXXX",
"clientOrderId": "XXXXX"
}
}
Fail example:
{
"id":"***",
"event": "error",
"code": "60009",
"msg": "CreateOrder failed."
}
| 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 |
