Skip to main content

Get Order History

Description

Get previous futures orders.

HTTP Request

GET /v3/trade/order/history

Request Parameters

ParameterRequiredTypeDescription
symbolNoStringA trading pair, consisting of two currencies: base currency and quote currency
sideNoStringTrade Side, Enumerate BUY and SELL
ordIdNoStringOrder ID
clOrdIdNoStringClient Order ID as assigned by the client
stateNoStringOrder Status: Enumerate Filled, Partial_Canceled, and Canceled
typeNoStringOrder type; various order types are supported.
sTimeNoStringStarting time of the history, Unix timestamp format in milliseconds. The default is the last 180 days
eTimeNoStringEnding time of the history, Unix timestamp format in milliseconds. The default is the last 180 days
fromNoLongIt is ordId. ID for the query starts at 0 by default.
limitNoIntegerPagination size defaults to 10, with a maximum limit of 100.
directNoStringEnumerate: PREV, NEXT, The default is NEXT

Response Parameters

ParameterTypeDescription
symbolStringA trading pair, consisting of two currencies: base currency and quote currency
sideStringEnumerate: BUY and SELL
typeStringOrder type; enumerate market, limit, and LIMIT_MAKER
ordIdStringOrder ID
clOrdIdStringClient Order ID as assigned by the client
mgnModeStringMargin Mode, Enumerate: ISOLATED, CROSS
pxStringPrice
szStringOrder size, specifically in Cont
stateStringOrder Status: Enumerate NEW, PARTIALLY_FILLED, FILLED, PARTIALLY_CANCELED, CANCELED, and REJECTED
cancelReasonStringUSER_CANCEL_ORDER_ACTION, LIMIT_MAKER_ORDER_INCORRECT_PRICE_CONDITION, LIMIT_MATCH_IOC_OR_FOK_ORDER_PRICE_CANNOT_MATCH, LIMIT_MATCH_FOK_ORDER_MAKER_INSUFFICIENT_AVAILABLE_QUANTITY, LIMIT_MATCH_IOC_ORDER_CANNOT_FILLED, LIMIT_MATCH_ORDER_TAKER_SELF_TRADE,MARKET_ORDER_NO_OTHER_SIDE_ORDER, INVALID_PARAM_WHEN_PLACE_ORDER, INVALID_ORDER_TYPE_WHEN_PLACE_ORDER, INVALID_SEQUENCE_PLACE_ORDER_AFTER_CANCEL_SAME_ORDER, MATCH_SYMBOL_TRADE_LIMIT_NOT_EXIST, EXCEED_SLIPPAGE_TOLERANCE, OUT_OF_RANGE_LIMIT_PRICE,NO_MARGIN_QUANTITY_GREAT_THAN_POSITION, LIMIT_MATCH_ORDER_ONLY_SELF_TRADE, FL_CANCEL_ORDER_ACTION, RISK_CANCEL_ORDER_ACTION, SYS_CANCEL_ORDER_ACTION
sourceStringOrder Source: Enumerate WEB, APP, API, SMART, WEB_MARGIN, APP_IOS, APP_ANDROID, APP_IOS_MARGIN, APP_ANDROID_MARGIN, API_MARGIN, SMART_MARGIN, WS, WS_MARGIN, GRID, GRID_MARGIN, SYSTEM, COPY_TRADING, TRIGGER, LIQUIDATION, ADL, TRIAL, MARGIN_FL, MARGIN_FL_OFFLINE
reduceOnlyBooleanReduce only
timeInForceStringEnumerate FOK, IOC, and GTC. It is an optional field with GTC by default.
avgPxStringAverage execution price
execQtyStringCumulative execution amount
execAmtStringCumulative execution value
feeCcyStringName of the currency used for trading fees
feeAmtStringCumulative amount of trading fee
deductCcyStringName of the currency used to deduct trading fees
deductAmtStringCumulative amount of trading fee deducted
stpModeStringEnumerate
- EXPIRE_TAKER
- EXPIRE_MAKER
- EXPIRE_BOTH
Default is NONE
cTimeStringOrder creation time with a UTC timestamp (MS)
uTimeStringOrder update time with a UTC timestamp (MS)

Request Example

{
"symbol": "BTC_USDT_PERP",
"direct": "NEXT",
"From": "0",
"limit": 100,
"sTime": "1719971873000",
"eTime": "1719973853000"
}

Response Example

{
"code": 200,
"data": [
{
"avgPx": "0.6272",
"cTime": "1719973768748",
"cancelReason": "",
"clOrdId": "polo331380922769473536",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "1.8816",
"execQty": "3",
"feeAmt": "0.00009408",
"feeCcy": "USDT",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331380922769473536",
"px": "60000",
"reduceOnly": "false",
"side": "BUY",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "WEB",
"state": "FILLED",
"stpMode": "NONE",
"symbol": "BTC_USDT_PERP",
"sz": "3",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973768764"
},
{
"avgPx": "0.6272",
"cTime": "1719973712694",
"cancelReason": "",
"clOrdId": "12345",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "1.8816",
"execQty": "3",
"feeAmt": "0.00009408",
"feeCcy": "USDT",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331380687661957120",
"px": "0",
"reduceOnly": "true",
"side": "BUY",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "FILLED",
"stpMode": "NONE",
"symbol": "BTC_USDT_PERP",
"sz": "3",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "MARKET",
"uTime": "1719973712703"
},
{
"avgPx": "0",
"cTime": "1719973298692",
"cancelReason": "ORDER_SOURCE_API",
"clOrdId": "4251fe5c-2b1e-4abd-b9b2-e7c713435653",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331378951211712512",
"px": "60000",
"reduceOnly": "false",
"side": "SELL",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973526115"
},
{
"avgPx": "0",
"cTime": "1719973298689",
"cancelReason": "ORDER_SOURCE_API",
"clOrdId": "9e36e89c-6cab-45c6-9c8a-245b7547601a",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331378951199129601",
"px": "60000",
"reduceOnly": "false",
"side": "SELL",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973454788"
},
{
"avgPx": "0",
"cTime": "1719973298688",
"cancelReason": "ORDER_SOURCE_API",
"clOrdId": "1e073485-dfdc-44b9-9523-3daa871984f3",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331378951194935296",
"px": "60000",
"reduceOnly": "false",
"side": "BUY",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973642669"
},
{
"avgPx": "0",
"cTime": "1719973298685",
"cancelReason": "ORDER_SOURCE_API",
"clOrdId": "225c8607-d98f-4a2e-a27b-faea04fe718f",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331378951182352384",
"px": "60000",
"reduceOnly": "false",
"side": "BUY",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973454787"
},
{
"avgPx": "0",
"cTime": "1719972857477",
"cancelReason": "USER_CANCEL_ORDER_ACTION",
"clOrdId": "c9a20e43-1dda-45f4-9f69-3c0656b53161",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331377100621873152",
"px": "60000",
"reduceOnly": "false",
"side": "SELL",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973253399"
},
{
"avgPx": "0",
"cTime": "1719972857475",
"cancelReason": "USER_CANCEL_ORDER_ACTION",
"clOrdId": "fa8011fe-8312-4b23-a671-b0ed34df3f30",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331377100613484545",
"px": "60000",
"reduceOnly": "false",
"side": "SELL",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973253398"
},
{
"avgPx": "0",
"cTime": "1719972857473",
"cancelReason": "USER_CANCEL_ORDER_ACTION",
"clOrdId": "57faf779-d45b-46ee-87e6-9cb11d5804f4",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331377100605095936",
"px": "60000",
"reduceOnly": "false",
"side": "BUY",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973253397"
},
{
"avgPx": "0",
"cTime": "1719972857465",
"cancelReason": "USER_CANCEL_ORDER_ACTION",
"clOrdId": "2486353f-64d3-4f7d-aa0a-7e34f45b6a6e",
"deductAmt": "0",
"deductCcy": "0",
"execAmt": "0",
"execQty": "0",
"feeAmt": "0",
"feeCcy": "",
"lever": "20",
"mgnMode": "CROSS",
"ordId": "331377100571541504",
"px": "60000",
"reduceOnly": "false",
"side": "BUY",
"slPx": "",
"slTrgPx": "",
"slTrgPxType": "",
"source": "API",
"state": "CANCELED",
"stpMode": "EXPIRE_TAKER",
"symbol": "BTC_USDT_PERP",
"sz": "2",
"timeInForce": "GTC",
"tpPx": "",
"tpTrgPx": "",
"tpTrgPxType": "",
"type": "LIMIT",
"uTime": "1719973253396"
}
],
"msg": "Success"
}