Skip to main content

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

ParameterRequiredTypeDescription
symbolYesStringA trading pair, consisting of two currencies: base currency and quote currency
sideYesStringEnumerate: BUY and SELL
mgnModeYesStringMargin modeCROSSISOLATED, Required in LONG/SHORT mode, linked with posSide in buy/sell mode, either fill in all or leave them blank
posSideYesStringRequired 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.
typeYesStringOrder type; enumerate MARKET, LIMIT, and LIMIT_MAKER
clOrdIdNoStringClient Order ID as assigned by the client
pxNoStringPrice, applicable for limit orders only. No price input is required for market orders.
szYesStringOrder size, specifically in Cont
reduceOnlyNoBooleanReduce only
timeInForceNoStringEnumerate FOK, IOC, and GTC. It is an optional field with GTC by default.
stpModeNoStringEnumerate
- 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 is BOTH.
  • In long/short mode, it is mandatory. Valid values are LONG or SHORT.
  • 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 in LONG)
    • Open short: sell and open short (side: fill in SELL; posSide: fill in SHORT)
    • Close long: sell and close long (side: fill in SELL; posSide: fill in LONG)
    • Close short: buy and close short (side: fill in BUY; posSide: fill in SHORT)

Response Parameters

ParameterTypeDescription
ordIdStringOrder ID
clOrdIdStringClient 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"
}