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 URL
POST /deepcoin/v2/trade/batch-orders
Request Parameters
Request body:
| Field Name | Required | Type | Description |
|---|---|---|---|
| orders | true | array | Order list, maximum 5 items per request |
Order item fields:
| Field Name | Required | Type | Description |
|---|---|---|---|
| instId | true | string | Product ID |
| tdMode | true | string | Trading mode Cross: crossIsolated: isolated |
| ccy | false | string | Margin currency, only applicable to cross margin orders in single-currency margin mode |
| side | true | string | Order side Buy: buySell: sell |
| posSide | false | string | Position side Required when product type is SWAPLong: longShort: short |
| mrgPosition | false | string | Position mode Required when product type is SWAPMerged: mergeSplit: split |
| closePosId | false | string | Position ID to close, required in split mode |
| ordType | true | string | Order type Market: marketLimit: limitPost only: post_onlyIOC: ioc |
| sz | true | string | Order size, get minimum order size (minSz) through Get Product Info API |
| px | false | string | Order price, only applicable to limit and post_only orders |
| reduceOnly | false | boolean | Reduce-only flag |
| tgtCcy | false | string | Market order quantity type for spot ordersbase_ccy / quote_ccy |
| tpTriggerPx | false | string | Take profit trigger price |
| slTriggerPx | false | string | Stop 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 Name | Type | Description |
|---|---|---|
| ordId | string | Order ID. Empty string when placement fails |
| sCode | string | Per-order execution result code, 0 means success |
| sMsg | string | Per-order error message |
Response Example
{
"code": "0",
"msg": "",
"data": [
{
"ordId": "1000587866646229",
"sCode": "0",
"sMsg": ""
},
{
"ordId": "",
"sCode": "36",
"sMsg": "InsufficientMoney"
}
]
}