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
Parameter | Required | Type | Comments |
---|---|---|---|
category | true | string | Product type. linear , option |
request | true | array | Object |
> symbol | true | string | Symbol name |
> side | true | string | Buy , Sell |
> orderType | true | string | Market , Limit |
> qty | true | string | Order quantity |
> price | false | string | Order price. Invalid if orderType =Market |
> orderIv | false | string | Implied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed |
> timeInForce | true | string | Time in force. GoodTillCancel , ImmediateOrCancel , FillOrKill , PostOnly |
> positionIdx | false | integer | Position index. 0 : one-way mode. Unified margin supports one-way mode only |
> orderLinkId | false | string | User customised order id. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported. rule of linear :
option : |
> reduceOnly | false | boolean | What 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 |
> closeOnTrigger | false | boolean | What 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. |
> mmp | false | boolean | Market maker protection. true means this order is a market maker protection order |
Response Parameters
Parameter | Type | Comments |
---|---|---|
result | Object | |
> list | array | Object |
>> category | string | Products category |
>> symbol | string | Symbol name |
>> orderId | string | Order id |
>> orderLinkId | string | User customised order id |
>> createAt | string | Order created time (ms) |
retExtInfo | Object | |
> list | array | Object |
>> code | integer | Success/error code |
>> msg | string | Success/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
}