跳到主要内容

获取用户所有历史订单

响应示例

{
"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

需要权限: 读取订单信息

请求参数:

参数名类型是否必填说明
symbolstringfalse合约名
statesstringfalse订单状态,1:待报,2未完成,3已完成,4已撤销,5无效;多个用 ',' 隔开
categoryintfalse订单类别,1:限价委托,2:强平代管委托,3:代管平仓委托,4:ADL减仓
start_timelongfalse开始时间(Unix毫秒时间戳)
end_timelongfalse结束时间(Unix毫秒时间戳)
page_numinttrue当前页数,默认为1
page_sizeinttrue每页大小,默认20,最大100
orderIdlongfalse订单ID号

响应参数:

参数名类型说明
pageSizeint页面大小
totalCountint总条数
totalPageint总页数
currentPageint当前页
resultListlist数据结果集
orderIdlong页面大小
symbolstring合约名
positionIdlong持仓id
pricedecimal委托价格
voldecimal委托数量
leveragelong杠杆倍数
sideint订单方向 1开多,2平空,3开空,4平多
categoryint订单类别:1限价委托,2强平代管委托,3代管平仓委托,4ADL减仓
orderTypeint1:限价单,2:Post Only只做Maker,3:立即成交或立即取消,4:全部成交或者全部取消
dealAvgPricedecimal成交均价
dealVoldecimal成交数量
orderMargindecimal委托保证金
usedMargindecimal已经使用的保证金
takerFeedecimal买单手续费
makerFeedecimal卖单手续费
profitdecimal平仓盈亏
feeCurrencystring收费币种
openTypeint开仓类型,1逐仓,2全仓
stateint订单状态,1:待报,2未完成,3已完成,4已撤销,5无效
errorCodeint错误code,0:正常,1:参数错误,2:账户余额不足,3:仓位不存在,4:仓位可用持仓不足,5:多仓时,委托价小于了强平价,空仓时,委托价大于了强平价,6:开多时,强平价大于合理价,开空时,强平价小于合理价
externalOidstring外部订单号
createTimedate创建时间
updateTimedate修改时间
bboTypeNumint限价订单类型-BBO类型订单; 0:不是BBO订单;1:对手价1;2:对手价5;3:同向价1;4:同向价5
lossTrendint止损价格类型;1:最新价;2:合理价;3:指数价
profitTrendint止盈价格类型;
takeProfitPricedecimal止盈价
stopLossPricedecimal止损价
priceProtectint价差保护 1:开启;0:关闭
positionModeint仓位模式;1:双向持仓;2:单向持仓

注意:本接口返回的price为平台接管成交价格,若想查询强平订单的强平价格可通过[获取用户当前持仓接口]查询,发生强平的订单,该价格为平台的接管价格,与强平价或会出现差异,具体可参考:强平与风险限制