Get Open Orders
tip
Query unfilled or partially filled orders in real-time.
- At most 500 unfilled or partially filled orders will be returned if neither
orderIdnororderLinkIdis passed. - The records are sort by the
createdTimefrom newest to oldest.
HTTP Request
GET /unified/v3/private/order/unfilled-orders
Request Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| category | true | string | Product type. linear, option |
| symbol | false | string | Symbol name |
| baseCoin | false | string | Base coin. Ifcategory=option,then it returns BTC data when this field is not passed |
| orderId | false | string | Order id |
| orderLinkId | false | string | User customised order id |
| orderFilter | false | string | Order: active order, StopOrder: conditional order |
| direction | false | string | Page direction. prev, next. Default: next |
| limit | false | integer | Limit for data size per page. [1, 50]. Default: 20 |
| cursor | false | string | Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| category | string | Product type |
| nextPageCursor | string | Refer to the cursor request parameter |
| list | array | Object |
| > orderId | string | Order ID |
| > orderLinkId | string | User customised order ID |
| > blockTradeId | string | Paradigm block trade ID |
| > symbol | string | Symbol name |
| > iv | string | Implied volatility. linear does not have this field |
| > price | string | Order price |
| > qty | string | Order qty |
| > side | string | Side. Buy,Sell |
| > orderStatus | string | Order status |
| > orderType | string | Order type. Market,Limit |
| > stopOrderType | string | Stop order type. option does not have this field |
| > cumExecValue | string | Cumulative executed order value |
| > cumExecFee | string | Cumulative executed trading fee |
| > cumExecQty | string | Cumulative executed order qty |
| > tpTriggerBy | string | The price type to trigger take profit. option does not have this field |
| > slTriggerBy | string | Stop loss price. option does not have this field |
| > timeInForce | string | Time in force |
| > basePrice | string | Base price |
| > triggerBy | string | The price type of trigger price. option does not have this field |
| > triggerPrice | string | Trigger price. If stopOrderType=TrailingStop, it is activate price. Otherwise, it is trigger price. option does not have this field |
| > leavesQty | string | The remaining qty not executed |
| > reduceOnly | boolean | Reduce only. true means reduce position size |
| > closeOnTrigger | boolean | Close on trigger. option does not have this field |
| > takeProfit | string | Take profit price. option does not have this field |
| > stopLoss | string | Stop loss price. option does not have this field |
| > orderIM | string | Order initial margin. For portfolio margin mode, it returns "" |
| > createdTime | number | Order created timestamp (ms) |
| > updatedTime | number | Order updated timestamp (ms) |
Request Example
GET /unified/v3/private/order/unfilled-orders?category=option&baseCoin=BTC HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1673079658059
X-BAPI-RECV-WINDOW: 5000
Response Example
- linear
- option
{
"retCode": 0,
"retMsg": "OK",
"result": {
"nextPageCursor": "d00b5b7b-4e05-4a12-a81c-8afb6ddf76bc%3A1673079539417%2Cd00b5b7b-4e05-4a12-a81c-8afb6ddf76bc%3A1673079539417",
"category": "linear",
"list": [
{
"symbol": "MATICUSDT",
"orderType": "Limit",
"orderLinkId": "",
"orderId": "d00b5b7b-4e05-4a12-a81c-8afb6ddf76bc",
"stopOrderType": "UNKNOWN",
"orderStatus": "New",
"takeProfit": "",
"cumExecValue": "0.00000000",
"blockTradeId": "",
"price": "1.00000000",
"createdTime": 1673079539417,
"tpTriggerBy": "UNKNOWN",
"timeInForce": "PostOnly",
"basePrice": "",
"updatedTime": 1673079539426,
"side": "Sell",
"triggerPrice": "",
"cumExecFee": "0.00000000",
"slTriggerBy": "UNKNOWN",
"leavesQty": "500.0000",
"closeOnTrigger": true,
"cumExecQty": "0.00000000",
"reduceOnly": true,
"qty": "500.0000",
"stopLoss": "",
"triggerBy": "UNKNOWN",
"orderIM": ""
}
]
},
"retExtInfo": {},
"time": 1673079551691
}
{
"retCode": 0,
"retMsg": "OK",
"result": {
"nextPageCursor": "b8e9fd9c-c710-4c78-86a3-ab923e19c380%3A1673079645947%2Cb8e9fd9c-c710-4c78-86a3-ab923e19c380%3A1673079645947",
"category": "option",
"list": [
{
"symbol": "BTC-27JAN23-12000-P",
"orderType": "Limit",
"updatedTime": 1673079645958,
"side": "Sell",
"orderLinkId": "",
"cumExecFee": "0.00000000",
"orderId": "b8e9fd9c-c710-4c78-86a3-ab923e19c380",
"leavesQty": "0.1000",
"orderStatus": "New",
"iv": "0.78295834",
"cumExecValue": "0.00000000",
"blockTradeId": "",
"cumExecQty": "0.00000000",
"reduceOnly": false,
"price": "30.00000000",
"qty": "0.1000",
"createdTime": 1673079645947,
"timeInForce": "GoodTillCancel",
"orderIM": "169.75360098",
"basePrice": ""
}
]
},
"retExtInfo": {},
"time": 1673079658761
}