Order

View as Markdown

Note

Order endpoints require trade permission.

Place Order

1POST /v1/private/order/place
2Content-Type: application/json

Request parameters:

ParameterTypeRequiredDescription
symbolstringYesSymbol
typestringYesLIMIT / MARKET
sidestringYesBUY / SELL
positionSidestringNoBOTH / LONG / SHORT, default BOTH
pricestringConditionally requiredRequired for limit orders
quantitystringConditionally requiredQuantity. Can be omitted when closePosition=true
timeInForcestringNoGTC / IOC / FOK, default GTC
reduceOnlyboolNoReduce-only, default false
makerOnlyboolNoMaker-only, default false
closePositionboolNoClose the entire position, default false
clientOrderIdstringNoClient-defined order ID
placeTypestringNoOrder placement type marker
priceTypeint32NoBBO price type: 0 specified price, 1 opponent price 1, 2 opponent price 5, 3 same-side price 1, 4 same-side price 5

Request example:

1{
2 "symbol": "BTCUSDT",
3 "type": "LIMIT",
4 "side": "BUY",
5 "price": "85000",
6 "quantity": "0.1",
7 "timeInForce": "GTC",
8 "makerOnly": true,
9 "clientOrderId": "ext-1772710377808-001"
10}

Response fields:

FieldTypeDescription
orderIdstringServer order ID
clientOrderIdstringClient-defined order ID
statusstringOrder status
timestampint64Timestamp

Batch Place Orders

1POST /v1/private/order/batch-place
2Content-Type: application/json

Request body:

1{
2 "orders": [
3 {
4 "symbol": "BTCUSDT",
5 "type": "LIMIT",
6 "side": "BUY",
7 "price": "85000",
8 "quantity": "0.1",
9 "clientOrderId": "ext-buy-001"
10 }
11 ]
12}

Response fields:

FieldTypeDescription
successCountint32Number of successful orders
failedCountint32Number of failed orders
results[]arrayResult for each order

Place Condition Order

1POST /v1/private/order/place-condition
2Content-Type: application/json

Request parameters:

ParameterTypeRequiredDescription
symbolstringYesSymbol
typestringYesSTOP_MARKET / TAKE_PROFIT_MARKET / STOP_LIMIT / TAKE_PROFIT_LIMIT / TRAILING_STOP
sidestringYesBUY / SELL
positionSidestringNoBOTH / LONG / SHORT
pricestringConditionally requiredRequired for STOP_LIMIT / TAKE_PROFIT_LIMIT
quantitystringConditionally requiredQuantity. Can be omitted when closePosition=true
timeInForcestringNoGTC / IOC / FOK / GTE_GTC
reduceOnlyboolNoReduce-only
clientOrderIdstringNoClient-defined order ID
stopPricestringConditionally requiredTrigger price
workingTypestringNoMARK_PRICE / CONTRACT_PRICE, default CONTRACT_PRICE
priceProtectboolNoWhether price protection is enabled
activatePricestringConditionally requiredTrailing order activation price
callbackRatestringConditionally requiredTrailing order callback rate
closePositionboolNoClose the entire position

Response fields:

FieldTypeDescription
conditionIdstringCondition order ID
conditionStatusstringCondition order status
timestampint64Timestamp

Place Strategy Order

1POST /v1/private/order/place-strategy
2Content-Type: application/json

Request parameters:

ParameterTypeRequiredDescription
strategyTypestringYesOTOCO / OTO / OCO
subOrderListarrayYesSub-order list

Fields in subOrderList[] are mostly the same as normal orders and condition orders, with additional dependency fields:

ParameterTypeDescription
strategySubIdint64Sub-order ID
firstDrivenIdint64First driving order ID. 0 means no dependency
firstDrivenOnstringFirst trigger condition
firstTriggerstringFirst trigger action
secondDrivenIdint64Second driving order ID
secondDrivenOnstringSecond trigger condition
secondTriggerstringSecond trigger action

Response fields:

FieldTypeDescription
strategyIdstringStrategy ID
strategyStatusstringStrategy status
timestampint64Timestamp

Query Single Order

1GET /v1/private/order?symbol=BTCUSDT&orderId=2022543809547603968

Request parameters:

ParameterTypeRequiredDescription
symbolstringYesSymbol
orderIdstringNoServer order ID
clientOrderIdstringNoClient-defined order ID

At least one of orderId and clientOrderId must be provided. If both are provided, the server performs an exact match on both conditions.

Current Normal Orders

1GET /v1/private/order/current?symbol=BTCUSDT

Request parameters:

ParameterTypeRequiredDescription
symbolstringNoSymbol
limitint32NoReturn count limit
lastOrderIdint64NoCursor field

Response fields:

FieldTypeDescription
list[]arrayCurrent normal order list
totalint32Count

Current Condition Orders

1GET /v1/private/order/current-condition?symbol=BTCUSDT

Request parameters:

ParameterTypeRequiredDescription
symbolstringNoSymbol

Historical Normal Orders

1GET /v1/private/order/history?symbol=BTCUSDT&page=1&pageSize=20

Request parameters:

ParameterTypeRequiredDescription
symbolstringNoSymbol
orderIdstringNoExact order ID filter
clientOrderIdstringNoExact client order ID filter
typeint32NoOrder type filter: 1 limit, 2 market
sideint32NoSide filter: 1 buy, 2 sell
statusint32NoStatus filter
startTimeint64NoStart time
endTimeint64NoEnd time
pageint64NoPage number, default 1
pageSizeint64NoItems per page, default 20

Historical Condition Orders

1GET /v1/private/order/history-condition?symbol=BTCUSDT&page=1&pageSize=20

Request parameters:

ParameterTypeRequiredDescription
symbolstringNoSymbol
sideint32NoSide filter: 1 buy, 2 sell
statusint32NoStatus filter
startTimeint64NoStart time
endTimeint64NoEnd time
pageint64NoPage number, default 1
pageSizeint64NoItems per page, default 20

Trade Records

1GET /v1/private/order/trades?symbol=BTCUSDT&page=1&pageSize=20

Request parameters:

ParameterTypeRequiredDescription
symbolstringNoSymbol
orderIdstringNoOrder ID filter
startTimeint64NoStart time
endTimeint64NoEnd time
pageint64NoPage number, default 1
pageSizeint64NoItems per page, default 20

Response fields:

FieldTypeDescription
list[].fillIdstringFill detail ID
list[].tradeIdstringTrade record ID
list[].orderIdstringOrder ID
list[].symbolstringSymbol
list[].sidestringSide
list[].roleTypestringmaker / taker
list[].pricestringFilled price
list[].quantitystringFilled quantity
list[].tradeValuestringTrade value
list[].handlingFeestringHandling fee
list[].realizedPnlstringRealized PnL
list[].positionSidestringPosition side
list[].createdAtint64Trade time
totalint64Total count

Cancel Order

1POST /v1/private/order/cancel
2Content-Type: application/json

Request body:

1{
2 "symbol": "BTCUSDT",
3 "orderId": "2022543809547603968"
4}

clientOrderId can also be used to cancel an order.

Amend Order

1POST /v1/private/order/move
2Content-Type: application/json

Request body:

1{
2 "symbol": "BTCUSDT",
3 "orderId": "2022543809547603968",
4 "price": "85100",
5 "quantity": "0.2"
6}

quantity is the final total order quantity after amendment, not the remaining quantity.

Batch Amend Orders

1POST /v1/private/order/batch-move
2Content-Type: application/json

Request body:

1{
2 "symbol": "BTCUSDT",
3 "orders": [
4 {
5 "orderId": "2022543809547603968",
6 "price": "85100",
7 "quantity": "0.2"
8 }
9 ]
10}

Batch Cancel Orders

1POST /v1/private/order/batch-cancel
2Content-Type: application/json

Request body:

1{
2 "orders": [
3 {
4 "symbol": "BTCUSDT",
5 "orderId": "2022543809547603968"
6 }
7 ]
8}

Cancel All

1POST /v1/private/order/batch-cancel-all
2Content-Type: application/json

Request parameters:

ParameterTypeRequiredDescription
symbolstringNoSymbol
cancelTypeint32No0 all normal orders, 1 limit orders only, 2 all condition orders. Default 0

Cancel-all for normal orders is accepted asynchronously. Final status should be determined by WebSocket ORDER_TRADE_UPDATE or query endpoints.

Cancel Condition Order

1POST /v1/private/order/cancel-condition
2Content-Type: application/json

Request body:

1{
2 "symbol": "BTCUSDT",
3 "conditionId": "2022543809547603968"
4}

Strategy Order Detail

1GET /v1/private/order/strategy?strategyId=2022543809547603968

Response fields:

FieldTypeDescription
strategyIdstringStrategy ID
strategyTypestringOTOCO / OTO / OCO
strategyStatusstringWORKING / ALL_DONE / CANCELLED
bookTimeint64Creation time
subOrders[]arraySub-order details
updateTimeint64Update time