Get All Historical Orders
Response Example
{
"success": true,
"code": 0,
"data": [
{
"orderId": "739211854408619008",
"symbol": "DOGE_USDT",
"positionId": 1110417836,
"price": 0.18695,
"priceStr": "0.186950000000000000",
"vol": 1,
"leverage": 20,
"side": 3,
"category": 1,
"orderType": 5,
"dealAvgPrice": 0.18695,
"dealAvgPriceStr": "0.186950000000000000",
"dealVol": 1,
"orderMargin": 0.93475,
"takerFee": 0,
"makerFee": 0,
"profit": 0,
"feeCurrency": "USDT",
"openType": 1,
"state": 3,
"externalOid": "test00002",
"errorCode": 0,
"usedMargin": 0.93475,
"createTime": 1761912240000,
"updateTime": 1761912240000,
"positionMode": 1,
"version": 2,
"showCancelReason": 1,
"showProfitRateShare": 0,
"bboTypeNum": 0,
"totalFee": 0,
"zeroSaveTotalFeeBinance": 0.0102,
"zeroTradeTotalFeeBinance": 0.0102
},
{
"orderId": "739211257974395392",
"symbol": "DOGE_USDT",
"positionId": 1110417836,
"price": 0.18645,
"priceStr": "0.186450000000000000",
"vol": 1,
"leverage": 20,
"side": 3,
"category": 1,
"orderType": 5,
"dealAvgPrice": 0.18645,
"dealAvgPriceStr": "0.186450000000000000",
"dealVol": 1,
"orderMargin": 0.93225,
"takerFee": 0,
"makerFee": 0,
"profit": 0,
"feeCurrency": "USDT",
"openType": 1,
"state": 3,
"externalOid": "test00001",
"errorCode": 0,
"usedMargin": 0.93225,
"createTime": 1761912098000,
"updateTime": 1761912098000,
"positionMode": 1,
"version": 2,
"showCancelReason": 1,
"showProfitRateShare": 0,
"bboTypeNum": 0,
"totalFee": 0,
"zeroSaveTotalFeeBinance": 0.0102,
"zeroTradeTotalFeeBinance": 0.0102
}
]
}
- GET
/api/v1/private/order/list/history_orders
Required Permission: View Order Details
Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | false | Contract |
| states | string | false | Order status,1: pending,2 unfilled,3 filled,4 canceled,5 invalid; multiple separated by ',' |
| category | int | false | Order category,1: limit,2: liquidation custody,3: custody close,4: ADL reduction |
| start_time | long | false | Unix millisecond timestamp |
| end_time | long | false | Unix millisecond timestamp |
| page_num | int | true | Current page, default 1 |
| page_size | int | true | Page size, default 20, max 100 |
| orderId | long | false | Order ID |
Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| pageSize | int | Page size |
| totalCount | int | Total count |
| totalPage | int | Total pages |
| currentPage | int | Current page |
| resultList | list | Result set |
| orderId | long | Page size |
| symbol | string | Contract |
| positionId | long | Position id |
| price | decimal | Order price |
| vol | decimal | Order quantity |
| leverage | long | Leverage |
| side | int | Order side 1 open long,2 close short,3 open short,4 close long |
| category | int | Order category:1 limit,2 liquidation custody,3 custody close,4 ADL reduction |
| orderType | int | 1: Limit,2: Post Only (maker only),3: Immediate-Or-Cancel,4: Fill-Or-Kill |
| dealAvgPrice | decimal | Average deal price |
| dealVol | decimal | Deal quantity |
| orderMargin | decimal | Order margin |
| usedMargin | decimal | Used margin |
| takerFee | decimal | Taker fee |
| makerFee | decimal | Maker fee |
| profit | decimal | Close PnL |
| feeCurrency | string | Fee currency |
| openType | int | Open type,1 isolated,2 cross |
| state | int | Order status,1: pending,2 unfilled,3 filled,4 canceled,5 invalid |
| errorCode | int | Error code,0: normal,1: parameter error,2: insufficient balance,3: position not found,4: insufficient available position,5: for long, order price < liquidation price; for short, order price > liquidation price,6: when opening long, liquidation price > fair price; when opening short, liquidation price < fair price |
| externalOid | string | External order ID |
| createTime | date | Created time |
| updateTime | date | Updated time |
| bboTypeNum | int | Limit order type - BBO type; 0: not BBO;1: best opposite 1;2: best opposite 5;3: same-side 1;4: same-side 5 |
| lossTrend | int | Stop-loss price type;1: latest price;2: fair price;3: index price |
| profitTrend | int | Take-profit price type; |
| takeProfitPrice | decimal | Take-profit price |
| stopLossPrice | decimal | Stop-loss price |
| priceProtect | int | Price difference protection 1: on;0: off |
| positionMode | int | Position mode;1: dual-side;2: one-way |
Note: The price returned by this interface is the platform takeover deal price. To query the liquidation price of a forced liquidation order, use [Get Open Positions]. For orders under forced liquidation, this price is the platform’s takeover price and may differ from the liquidation price. For details, see: Forced Liquidation and Risk Limits