Place Multiple Orders
Description
Place orders in a batch. A maximum of 10 orders can be placed per request.
HTTP Request
POST /v3/trade/orders
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
symbol | Yes | String | A trading pair, consisting of two currencies: base currency and quote currency |
side | Yes | String | Enumerate: BUY and SELL |
mgnMode | Yes | String | Margin modeCROSS 、ISOLATED , Required in LONG/SHORT mode, linked with posSide in buy/sell mode, either fill in all or leave them blank |
posSide | Yes | String | Required in two-way position mode, and only LONG or SHORT can be selected,It is required in LONG/SHORT mode and linked with mgnMode in Buy/Sell mode. Either BOTH fields are filled in or BOTH fields are left blank. |
type | Yes | String | Order type; enumerate MARKET , LIMIT , and LIMIT_MAKER |
clOrdId | No | String | Client Order ID as assigned by the client |
px | No | String | Price, applicable for limit orders only. No price input is required for market orders. |
sz | Yes | String | Order size, specifically in Cont |
reduceOnly | No | Boolean | Reduce only |
timeInForce | No | String | Enumerate FOK , IOC , and GTC . It is an optional field with GTC by default. |
stpMode | No | String | Enumerate - EXPIRE_TAKER - EXPIRE_MAKER - EXPIRE_BOTH Default is NONE |
Note:
posSide
- Position side, this parameter is not mandatory in
BOTH
mode. If you pass it through, the only valid value isBOTH
. - In long/short mode, it is mandatory. Valid values are
LONG
orSHORT
. - In long/short mode, side and posSide need to be specified in the combinations below:
- Open long: buy and open long (side: fill in
BUY
; posSide: fill inLONG
) - Open short: sell and open short (side: fill in
SELL
; posSide: fill inSHORT
) - Close long: sell and close long (side: fill in
SELL
; posSide: fill inLONG
) - Close short: buy and close short (side: fill in
BUY
; posSide: fill inSHORT
)
- Open long: buy and open long (side: fill in
Response Parameters
Parameter | Type | Description |
---|---|---|
ordId | String | Order ID |
clOrdId | String | Client Order ID as assigned by the client |
Request Example
[
{
"symbol": "BTC_USDT_PERP",
"side": "buy",
"mgnMode": "CROSS",
"posSide": "BOTH",
"type": "limit",
"px": "60000",
"sz": "1",
"timeInForce": "GTC",
"stpMode": "",
"reduceOnly": false,
"clOrdId": "310d7fc9-8bb4-472f-b477-d974724f077d"
},
{
"symbol": "BTC_USDT_PERP",
"side": "buy",
"mgnMode": "CROSS",
"posSide": "BOTH",
"type": "limit",
"px": "60000",
"sz": "2",
"timeInForce": "GTC",
"stpMode": "EXPIRE_TAKER",
"reduceOnly": false,
"clOrdId": "2486353f-64d3-4f7d-aa0a-7e34f45b6a6e"
},
{
"symbol": "BTC_USDT_PERP",
"side": "buy",
"mgnMode": "CROSS",
"posSide": "BOTH",
"type": "limit",
"px": "60000",
"sz": "2",
"timeInForce": "GTC",
"stpMode": "EXPIRE_TAKER",
"reduceOnly": false,
"clOrdId": "57faf779-d45b-46ee-87e6-9cb11d5804f4"
},
{
"symbol": "BTC_USDT_PERP",
"side": "sell",
"mgnMode": "CROSS",
"posSide": "BOTH",
"type": "limit_maker",
"px": "60000",
"sz": "1",
"timeInForce": "GTC",
"stpMode": "",
"reduceOnly": false,
"clOrdId": "843afc62-06ec-4439-bace-b93dd4d96fbd"
},
{
"symbol": "BTC_USDT_PERP",
"side": "sell",
"mgnMode": "CROSS",
"posSide": "BOTH",
"type": "limit",
"px": "60000",
"sz": "2",
"timeInForce": "GTC",
"stpMode": "EXPIRE_TAKER",
"reduceOnly": false,
"clOrdId": "fa8011fe-8312-4b23-a671-b0ed34df3f30"
},
{
"symbol": "BTC_USDT_PERP",
"side": "sell",
"mgnMode": "CROSS",
"posSide": "BOTH",
"type": "limit",
"px": "60000",
"sz": "2",
"timeInForce": "GTC",
"stpMode": "EXPIRE_TAKER",
"reduceOnly": false,
"clOrdId": "c9a20e43-1dda-45f4-9f69-3c0656b53161"
}
]
Response Example
{
"code":200,
"data":[
{
"clOrdId":"310d7fc9-8bb4-472f-b477-d974724f077d",
"code":10014,
"msg":"Price limit, high 0.6897,low 0.5643",
"ordId":""
},
{
"clOrdId":"2486353f-64d3-4f7d-aa0a-7e34f45b6a6e",
"code":200,
"msg":"Success",
"ordId":"331377100571541504"
},
{
"clOrdId":"57faf779-d45b-46ee-87e6-9cb11d5804f4",
"code":200,
"msg":"Success",
"ordId":"331377100605095936"
},
{
"clOrdId":"843afc62-06ec-4439-bace-b93dd4d96fbd",
"code":10014,
"msg":"Price limit, high 0.6897,low 0.5643",
"ordId":""
},
{
"clOrdId":"fa8011fe-8312-4b23-a671-b0ed34df3f30",
"code":200,
"msg":"Success",
"ordId":"331377100613484545"
},
{
"clOrdId":"c9a20e43-1dda-45f4-9f69-3c0656b53161",
"code":200,
"msg":"Success",
"ordId":"331377100621873152"
}
],
"msg":"Success"
}