Get Pre-upgrade Order History
After the account is upgraded to a Unified account, you can get the orders which occurred before the upgrade.
UTA2.0:
By category=linear, you can query USDT Perps, USDC Perps data occurred during classic account
By category=spot, you can query Spot data occurred during classic account
By category=option, you can query Options data occurred during classic account
By category=inverse, you can query Inverse Contract data occurred during classic account or UTA1.0UTA1.0:
By category=linear, you can query USDT Perps, USDC Perps data occurred during classic account
By category=spot, you can query Spot data occurred during classic account
By category=option, you can query Options data occurred during classic account
- can get all status in 7 days
- can only get filled orders beyond 7 days
- USDC Perpeual & Option support the recent 6 months data. Please download older data via GUI
HTTP Request
GET /v5/pre-upgrade/order/history
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
category | true | string | Product type linear , inverse , option , spot |
symbol | false | string | Symbol name, like BTCUSDT , uppercase only.
|
baseCoin | false | string | Base coin, uppercase only. Used for option query |
orderId | false | string | Order ID |
orderLinkId | false | string | User customised order ID |
orderFilter | false | string | Order : active order, StopOrder : conditional order |
orderStatus | false | string | Order status. Not supported for spot category |
startTime | false | integer | The start timestamp (ms)
|
endTime | false | integer | The end timestamp (ms) |
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 |
list | array | Object |
> orderId | string | Order ID |
> orderLinkId | string | User customised order ID |
> blockTradeId | string | Block trade ID |
> symbol | string | Symbol name |
> price | string | Order price |
> qty | string | Order qty |
> side | string | Side. Buy ,Sell |
> isLeverage | string | Useless field for those orders before upgraded |
> positionIdx | integer | Position index. Used to identify positions in different position modes |
> orderStatus | string | Order status |
> cancelType | string | Cancel type |
> rejectReason | string | Reject reason |
> avgPrice | string | Average filled price. If unfilled, it is "" , and also for those orders have partilly filled but cancelled at the end |
> leavesQty | string | The remaining qty not executed |
> leavesValue | string | The estimated value not executed |
> cumExecQty | string | Cumulative executed order qty |
> cumExecValue | string | Cumulative executed order value |
> cumExecFee | string | Cumulative executed trading fee |
> timeInForce | string | Time in force |
> orderType | string | Order type. Market ,Limit |
> stopOrderType | string | Stop order type |
> orderIv | string | Implied volatility |
> triggerPrice | string | Trigger price. If stopOrderType =TrailingStop, it is activate price. Otherwise, it is trigger price |
> takeProfit | string | Take profit price |
> stopLoss | string | Stop loss price |
> tpTriggerBy | string | The price type to trigger take profit |
> slTriggerBy | string | The price type to trigger stop loss |
> triggerDirection | integer | Trigger direction. 1 : rise, 2 : fall |
> triggerBy | string | The price type of trigger price |
> lastPriceOnCreated | string | Last price when place the order |
> reduceOnly | boolean | Reduce only. true means reduce position size |
> closeOnTrigger | boolean | Close on trigger. What is a close on trigger order? |
> placeType | string | Place type, option used. iv , price |
> smpType | string | SMP execution type |
> smpGroup | integer | Smp group ID. If the UID has no group, it is 0 by default |
> smpOrderId | string | The counterparty's orderID which triggers this SMP execution |
> createdTime | string | Order created timestamp (ms) |
> updatedTime | string | Order updated timestamp (ms) |
nextPageCursor | string | Refer to the cursor request parameter |
Request Example
GET /v5/pre-upgrade/order/history?category=linear&limit=1&orderStatus=Filled HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1682576940304
X-BAPI-RECV-WINDOW: 5000
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"orderId": "67836246-460e-4c52-a009-af0c3e1d12bc",
"orderLinkId": "",
"blockTradeId": "",
"symbol": "BTCUSDT",
"price": "27203.40",
"qty": "0.200",
"side": "Sell",
"isLeverage": "",
"positionIdx": 0,
"orderStatus": "Filled",
"cancelType": "UNKNOWN",
"rejectReason": "EC_NoError",
"avgPrice": "28632.126000",
"leavesQty": "0.000",
"leavesValue": "0",
"cumExecQty": "0.200",
"cumExecValue": "5726.4252",
"cumExecFee": "3.43585512",
"timeInForce": "IOC",
"orderType": "Market",
"stopOrderType": "UNKNOWN",
"orderIv": "",
"triggerPrice": "0.00",
"takeProfit": "0.00",
"stopLoss": "0.00",
"tpTriggerBy": "UNKNOWN",
"slTriggerBy": "UNKNOWN",
"triggerDirection": 0,
"triggerBy": "UNKNOWN",
"lastPriceOnCreated": "0.00",
"reduceOnly": true,
"closeOnTrigger": true,
"smpType": "None",
"smpGroup": 0,
"smpOrderId": "",
"createdTime": "1682487465732",
"updatedTime": "1682487465735",
"placeType": ""
}
],
"nextPageCursor": "page_token%3D69406%26",
"category": "linear"
},
"retExtInfo": {},
"time": 1682576940540
}