Skip to main content

Batch Place Orders

Batch Place Orders

Submit up to 5 orders in a single request. Each order is executed independently, and a failure in one item does not affect the others.

Request frequency limit: 1/1s

Request URL

POST /deepcoin/trade/batch-orders

Request Parameters

Request body:

Field NameRequiredTypeDescription
orderstruearrayOrder list, maximum 5 items per request

Order item fields:

Field NameRequiredTypeDescription
instIdtruestringProduct ID
tdModetruestringTrading mode
Isolated: isolated
Cross: cross
Cash: cash
ccyfalsestringMargin currency, only applicable to cross margin orders in single-currency margin mode
clOrdIdfalsestringCustom order ID, combination of letters and numbers, length between 1-32. Currently not supported by downstream order placement
tagfalsestringOrder tag, combination of letters and numbers, length between 1-16. Currently not supported by downstream order placement
sidetruestringOrder side
Buy: buy
Sell: sell
posSidefalsestringPosition side
Required when product type is SWAP
Long: long
Short: short
mrgPositionfalsestringPosition mode
Required when product type is SWAP
Merged: merge
Split: split
closePosIdfalsestringPosition ID to close, required in split mode
ordTypetruestringOrder type
Market: market
Limit: limit
Post only: post_only
IOC: ioc
sztruestringOrder size, get minimum order size (minSz) through Get Product Info API
pxfalsestringOrder price, only applicable to limit and post_only orders
reduceOnlyfalsebooleanReduce-only flag
tgtCcyfalsestringMarket order quantity type for spot orders
base_ccy / quote_ccy
tpTriggerPxfalsestringTake profit trigger price
slTriggerPxfalsestringStop loss trigger price

Request Example

{
"orders": [
{
"instId": "BTC-USDT-SWAP",
"tdMode": "cross",
"side": "buy",
"ordType": "limit",
"sz": "1",
"px": "65000",
"posSide": "long",
"mrgPosition": "merge"
},
{
"instId": "ETH-USDT-SWAP",
"tdMode": "cross",
"side": "sell",
"ordType": "market",
"sz": "2",
"posSide": "short",
"mrgPosition": "merge"
}
]
}

Response Parameters

The data field is an array, and each item corresponds to the same index in the request orders.

Field NameTypeDescription
ordIdstringOrder ID. Empty string when placement fails
clOrdIdstringCustom order ID. Currently returned as empty string
tagstringOrder tag. Currently returned as empty string
sCodestringPer-order execution result code, 0 means success
sMsgstringPer-order error message

Response Example

{
"code": "0",
"msg": "",
"data": [
{
"ordId": "1000587866646229",
"clOrdId": "",
"tag": "",
"sCode": "0",
"sMsg": ""
},
{
"ordId": "",
"clOrdId": "",
"tag": "",
"sCode": "36",
"sMsg": "InsufficientMoney"
}
]
}