Skip to main content

Order History

Order History

Get historical order records

Request frequency limit: 1/1s

Request URL

GET /deepcoin/trade/orders-history

Request Parameters

Field NameRequiredTypeDescription
instTypetruestringProduct type
Spot: SPOT
Contract: SWAP
instIdfalsestringProduct ID
ordTypefalsestringOrder type
Market order: market
Limit order: limit
Post only: post_only
statefalsestringOrder state
Canceled: canceled
Filled: filled
afterfalsestringPagination of data before this ID (older data), value should be ordId from the response
beforefalsestringPagination of data after this ID (newer data), value should be ordId from the response
limitfalseintegerNumber of results per page, maximum 100, default 100
ordIdfalsestringOrder ID

Response Parameters

Field NameTypeDescription
instTypestringProduct type
instIdstringProduct ID
tgtCcystringMarket order quantity type
Base currency: base_ccy
Quote currency: quote_ccy, only applicable to spot orders
ccystringMargin currency, only applicable to cross margin orders in single-currency margin mode
ordIdstringOrder ID
clOrdIdstringCustom order ID
tagstringOrder tag
pxstringOrder price
szstringOrder size
pnlstringProfit and loss
ordTypestringOrder type
Market order: market
Limit order: limit
Post only: post_only
sidestringOrder side
Buy: buy
Sell: sell
posSidestringPosition side
tdModestringTrading mode
accFillSzstringAccumulated fill size
fillPxstringLatest fill price
tradeIdstringLatest trade ID
fillSzstringLatest fill size
fillTimestringLatest fill time
avgPxstringAverage fill price
statestringOrder state
Pending: live
Partially filled: partially_filled
leverstringLeverage between 0.01 and 125, only applicable to margin/futures/perpetual trading
tpTriggerPxstringTake profit trigger price
tpTriggerPxTypestringTake profit trigger price type
Last price: last
Index price: index
Mark price: mark
tpOrdPxstringTake profit order price
slTriggerPxstringStop loss trigger price
slTriggerPxTypestringStop loss trigger price type
Last price: last
Index price: index
Mark price: mark
slOrdPxstringStop loss order price
feeCcystringFee currency
feestringTrading fee
rebateCcystringRebate currency
sourcestringOrder source, 13: Limit order generated after strategy order is triggered
rebatestringRebate amount. Platform pays maker rebates to users who reach specified trading levels. Empty string if no rebate. Positive number for fee rebate, e.g., 0.01
categorystringOrder category
uTimestringOrder update time, Unix timestamp in milliseconds
cTimestringOrder creation time, Unix timestamp in milliseconds

Response Example

{
"code": "0",
"msg": "",
"data": [
{
"instType": "SWAP",
"instId": "BTC-USDT-SWAP",
"tgtCcy": "",
"ccy": "",
"ordId": "1000587866072658",
"clOrdId": "",
"tag": "",
"px": "90000",
"sz": "300",
"pnl": "0",
"ordType": "limit",
"side": "sell",
"posSide": "short",
"tdMode": "cross",
"accFillSz": "300",
"fillPx": "98230.5",
"tradeId": "",
"fillSz": "300",
"fillTime": "1739261250000",
"avgPx": "98230.5",
"state": "filled",
"lever": "1",
"tpTriggerPx": "",
"tpTriggerPxType": "",
"tpOrdPx": "",
"slTriggerPx": "",
"slTriggerPxType": "",
"slOrdPx": "",
"feeCcy": "USDT",
"fee": "8.840745",
"rebateCcy": "",
"source": "",
"rebate": "",
"category": "normal",
"uTime": "1739261250000",
"cTime": "1739261250000"
}
]
}