Skip to main content

Batch Place Order

tip

This endpoint provides the batch order mode to place a bunch of orders.

  • Make sure you have sufficient funds in your account when place an order. Once an order is placed, according to the funds required by the order, the funds in your account will be frozen by the corresponding amount during the life cycle of the order.
  • The same request can only contain orders of the same contract type, i.e., options and futures cannot be placed at the same time. Only Limit / Market active order is supported, the conditional order is not supported.
  • If both future and option orders are in one request, then by given the category type, only the orders whose symbol matches the category will be operated.
  • The maximum number of orders included in each request is 10 orders. The returned data list is divided into two lists. The list created by the order and the created information are returned. The structure of the two lists are completely consistent.

HTTP Request

POST /unified/v3/private/order/create-batch

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type. linear, option
requesttruearrayObject
> symboltruestringSymbol name
> sidetruestringBuy, Sell
> orderTypetruestringMarket, Limit
> qtytruestringOrder quantity
> pricefalsestringOrder price. Invalid if orderType=Market
> orderIvfalsestringImplied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed
> timeInForcetruestringTime in force. GoodTillCancel, ImmediateOrCancel, FillOrKill, PostOnly
> positionIdxfalseintegerPosition index. 0: one-way mode. Unified margin supports one-way mode only
> orderLinkIdfalsestringUser customised order id. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported.
rule of linear:
  • optional param
  • The same orderLinkId can be used for both USDC PERP and USDT PERP.
  • An orderLinkId can be reused once the original order is either Filled or Cancelled
  • rule of option:
  • required param
  • always unique
> reduceOnlyfalsebooleanWhat is a reduce-only order? true means your position can only reduce in size if this order is triggered. When reduce_only is true, take profit/stop loss cannot be set
> closeOnTriggerfalsebooleanWhat is a close on trigger order? For a closing order. It can only reduce your position, not increase it. If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin.
> mmpfalsebooleanMarket maker protection. true means this order is a market maker protection order

Response Parameters

ParameterTypeComments
resultObject
> listarrayObject
>> categorystringProducts category
>> symbolstringSymbol name
>> orderIdstringOrder id
>> orderLinkIdstringUser customised order id
>> createAtstringOrder created time (ms)
retExtInfoObject
> listarrayObject
>> codeintegerSuccess/error code
>> msgstringSuccess/error message

Request Example

POST /unified/v3/private/order/create-batch HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672817108675
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"category": "linear",
"request": [
{
"symbol": "ETHUSDT",
"orderType": "Limit",
"side": "Buy",
"qty": "0.05",
"price": "1000",
"timeInForce": "GoodTillCancel",
"orderLinkId": "test-002",
"reduceOnly": false,
"closeOntrigger": false
},
{
"symbol": "XRPUSDT",
"orderType": "Limit",
"side": "Buy",
"qty": "100",
"price": "0.3",
"timeInForce": "GoodTillCancel",
"orderLinkId": "test-003",
"reduceOnly": false,
"closeOntrigger": false
}
]
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"category": "linear",
"symbol": "ETHUSDT",
"orderId": "ce295fcb-8c8a-4f12-89f4-4ab23d38ccd8",
"orderLinkId": "test-002",
"createAt": "1672817109797"
},
{
"category": "linear",
"symbol": "XRPUSDT",
"orderId": "e97f0355-6586-49a4-965f-feb7253cef14",
"orderLinkId": "test-003",
"createAt": "1672817109796"
}
]
},
"retExtInfo": {
"list": [
{
"code": 0,
"msg": "success"
},
{
"code": 0,
"msg": "success"
}
]
},
"time": 1672817109804
}