Skip to main content

See Order History (Quant)

Type: GET

Description: /future/trade/v1/order/quant/list-history

Quant account dedicated historical order query interface, supports cursor pagination, returns up to 2000 records.

Parameters

NameTypeMandatoryDefaultDescriptionRanges
idlongfalseN/ACursor ID for pagination, the last orderId from previous response
directionstringfalseNEXTPagination directionPREV;NEXT
limitintegerfalse10Number of records per page, max 2000
symbolstringfalseN/ATrading pair
forceClosebooleanfalsefalseWhether to query forced liquidation orders
startTimelongfalseN/AStart time (millisecond timestamp), earliest 90 days ago
endTimelongfalseN/AEnd time (millisecond timestamp)
origTypeintegerfalseN/AConditional order type: 1=Limit TP, 2=Limit SL, 3=Market TP, 4=Market SL
orderSideintegerfalseN/AOrder side: 1=Buy, 2=Sell
stateslist<integer>falseN/AOrder states: 2=Partially Filled, 3=Filled, 4=Canceled, 6=Expired
orderOrigTypeintegerfalseN/AOrder type: 1=Limit, 2=Market, 3=Limit TP/SL, 4=Market TP/SL, 5=MMR Stop Loss
welfareAccountbooleanfalsefalseWhether to query bonus account

Limit Flow Rules

200/s/apikey

Request Example

Request
curl -G "https://fapi.xt.com/future/trade/v1/order/quant/list-history" \
-H "validate-appkey: $APPKEY" \ # Required
-H "validate-timestamp: $TIMESTAMP" \ # Required
-H "validate-signature: $SIGNATURE" \ # Required
-H "Content-Type: application/x-www-form-urlencoded" \ # Required
-d "symbol=btc_usdt" \
-d "limit=10"

Response Example

Response
{
"returnCode": 0,
"msgInfo": "",
"error": {
"code": "",
"msg": ""
},
"result": {
"hasPrev": false,
"hasNext": true,
"items": [
{
"orderId": 123456789, // Order ID
"clientOrderId": "", // Client order ID
"symbol": "btc_usdt", // Trading pair
"orderSide": "BUY", // Order side
"orderType": "LIMIT", // Order type
"positionSide": "LONG", // Position side
"price": "50000.00", // Order price
"origQty": "0.1", // Original quantity (contracts)
"executedQty": "0.1", // Executed quantity (contracts)
"avgPrice": "50000.00", // Average filled price
"state": "FILLED", // Order state: NEW; PARTIALLY_FILLED; FILLED; CANCELED; REJECTED; EXPIRED
"closePosition": false, // Whether to close all when triggered
"closeProfit": "100.00", // Close profit and loss
"marginFrozen": "0", // Frozen margin
"forceClose": false, // Whether it's a liquidation order
"sourceId": 0, // Trigger condition ID
"timeInForce": "GTC", // Time in force
"triggerProfitPrice": "0", // TP trigger price
"triggerStopPrice": "0", // SL trigger price
"createdTime": 1703520000000, // Created time
"updatedTime": 1703520100000 // Updated time
}
]
}
}

Cursor Pagination Guide

  1. First request: Do not pass the id parameter
  2. Next page: Use the last record's ID from the previous response as the id parameter, with direction=NEXT
  3. Previous page: Use the first record's ID from the current list as the id parameter, with direction=PREV
  4. Check for more data: Use hasNext and hasPrev fields

Error Codes

Error CodeDescription
not_quantification_accountNot a quant account, no permission to access this interface