Skip to main content

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:

ParameterTypeRequiredDescription
symbolstringfalseContract
statesstringfalseOrder status,1: pending,2 unfilled,3 filled,4 canceled,5 invalid; multiple separated by ','
categoryintfalseOrder category,1: limit,2: liquidation custody,3: custody close,4: ADL reduction
start_timelongfalseUnix millisecond timestamp
end_timelongfalseUnix millisecond timestamp
page_numinttrueCurrent page, default 1
page_sizeinttruePage size, default 20, max 100
orderIdlongfalseOrder ID

Response Parameters:

ParameterTypeDescription
pageSizeintPage size
totalCountintTotal count
totalPageintTotal pages
currentPageintCurrent page
resultListlistResult set
orderIdlongPage size
symbolstringContract
positionIdlongPosition id
pricedecimalOrder price
voldecimalOrder quantity
leveragelongLeverage
sideintOrder side 1 open long,2 close short,3 open short,4 close long
categoryintOrder category:1 limit,2 liquidation custody,3 custody close,4 ADL reduction
orderTypeint1: Limit,2: Post Only (maker only),3: Immediate-Or-Cancel,4: Fill-Or-Kill
dealAvgPricedecimalAverage deal price
dealVoldecimalDeal quantity
orderMargindecimalOrder margin
usedMargindecimalUsed margin
takerFeedecimalTaker fee
makerFeedecimalMaker fee
profitdecimalClose PnL
feeCurrencystringFee currency
openTypeintOpen type,1 isolated,2 cross
stateintOrder status,1: pending,2 unfilled,3 filled,4 canceled,5 invalid
errorCodeintError 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
externalOidstringExternal order ID
createTimedateCreated time
updateTimedateUpdated time
bboTypeNumintLimit order type - BBO type; 0: not BBO;1: best opposite 1;2: best opposite 5;3: same-side 1;4: same-side 5
lossTrendintStop-loss price type;1: latest price;2: fair price;3: index price
profitTrendintTake-profit price type;
takeProfitPricedecimalTake-profit price
stopLossPricedecimalStop-loss price
priceProtectintPrice difference protection 1: on;0: off
positionModeintPosition 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