获取用户所有历史订单
响应示例
{
"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
需要权限: 读取订单信息
请求参数:
| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| symbol | string | false | 合约名 |
| states | string | false | 订单状态,1:待报,2未完成,3已完成,4已撤销,5无效;多个用 ',' 隔开 |
| category | int | false | 订单类别,1:限价委托,2:强平代管委托,3:代管平仓委托,4:ADL减仓 |
| start_time | long | false | 开始时间(Unix毫秒时间戳) |
| end_time | long | false | 结束时间(Unix毫秒时间戳) |
| page_num | int | true | 当前页数,默认为1 |
| page_size | int | true | 每页大小,默认20,最大100 |
| orderId | long | false | 订单ID号 |
响应参数:
| 参数名 | 类型 | 说明 |
|---|---|---|
| pageSize | int | 页面大小 |
| totalCount | int | 总条数 |
| totalPage | int | 总页数 |
| currentPage | int | 当前页 |
| resultList | list | 数据结果集 |
| orderId | long | 页面大小 |
| symbol | string | 合约名 |
| positionId | long | 持仓id |
| price | decimal | 委托价格 |
| vol | decimal | 委托数量 |
| leverage | long | 杠杆倍数 |
| side | int | 订单方向 1开多,2平空,3开空,4平多 |
| category | int | 订单类别:1限价委托,2强平代管委托,3代管平仓委托,4ADL减仓 |
| orderType | int | 1:限价单,2:Post Only只做Maker,3:立即成交或立即取消,4:全部成交或者全部取消 |
| dealAvgPrice | decimal | 成交均价 |
| dealVol | decimal | 成交数量 |
| orderMargin | decimal | 委托保证金 |
| usedMargin | decimal | 已经使用的保证金 |
| takerFee | decimal | 买单手续费 |
| makerFee | decimal | 卖单手续费 |
| profit | decimal | 平仓盈亏 |
| feeCurrency | string | 收费币种 |
| openType | int | 开仓类型,1逐仓,2全仓 |
| state | int | 订单状态,1:待报,2未完成,3已完成,4已撤销,5无效 |
| errorCode | int | 错误code,0:正常,1:参数错误,2:账户余额不足,3:仓位不存在,4:仓位可用持仓不足,5:多仓时,委托价小于了强平价,空仓时,委托价大于了强平价,6:开多时,强平价大于合理价,开空时,强平价小于合理价 |
| externalOid | string | 外部订单号 |
| createTime | date | 创建时间 |
| updateTime | date | 修改时间 |
| bboTypeNum | int | 限价订单类型-BBO类型订单; 0:不是BBO订单;1:对手价1;2:对手价5;3:同向价1;4:同向价5 |
| lossTrend | int | 止损价格类型;1:最新价;2:合理价;3:指数价 |
| profitTrend | int | 止盈价格类型; |
| takeProfitPrice | decimal | 止盈价 |
| stopLossPrice | decimal | 止损价 |
| priceProtect | int | 价差保护 1:开启;0:关闭 |
| positionMode | int | 仓位模式;1:双向持仓;2:单向持仓 |
注意:本接口返回的price为平台接管成交价格,若想查询强平订单的强平价格可通过[获取用户当前持仓接口]查询,发生强平的订单,该价格为平台的接管价格,与强平价或会出现差异,具体可参考:强平与风险限制