查询历史订单
类型 GET
描述: /v4/history-order
请求参数
| 名称 | 类型 | 必填 | 默认值 | 描述 | 取值范围 |
|---|---|---|---|---|---|
| symbol | string | 否 | N/A | 交易对,不填表示全部 | — |
| bizType | string | 否 | N/A | 业务类型 | SPOT, LEVER |
| side | string | 否 | N/A | 买卖方向 | BUY, SELL |
| type | string | 否 | N/A | 订单类型 | LIMIT, MARKET |
| state | string | 否 | N/A | 订单状态 | PARTIALLY_FILLED, FILLED, CANCELED, REJECTED, EXPIRED |
| fromId | number | 否 | N/A | 起始ID | — |
| direction | string | 否 | N/A | 查询方向 | PREV, NEXT |
| limit | number | 否 | 20 | 限制数量(最大100) | — |
| startTime | number | 否 | N/A | 开始时间(示例:1657682804112) | — |
| endTime | number | 否 | N/A | 结束时间 | — |
| hiddenCanceled | bool | 否 | N/A | 是否隐藏已取消订单 | — |
限流规则
- 10次/秒/每apikey
请求示例
curl --location --request GET 'https://sapi.xt.com/v4/history-order?symbol=XT_USDT&direction=NEXT&limit=10&startTime=xxxxxxxx&endTime=xxxxxxxx' \
--header 'accept: */*' \
--header 'Content-Type: application/json' \
--header 'validate-algorithms: HmacSHA256' \
--header 'validate-recvwindow: 60000' \
--header 'validate-appkey: xxxxxxxxxx' \
--header 'validate-timestamp: xxxxxxxxxx' \
--header 'validate-signature: xxxxxxxxxx'
响应示例
Response
{
"rc": 0,
"mc": "string",
"ma": [{}],
"result": {
"hasPrev": true,
"hasNext": true,
"items": [ // 字段信息参见【查询单个订单】接口
{
"symbol": "BTC_USDT",
"orderId": "6216559590087220004",
"clientOrderId": "16559590087220001",
"baseCurrency": "string",
"quoteCurrency": "string",
"side": "BUY",
"type": "LIMIT",
"timeInForce": "GTC",
"price": "40000",
"origQty": "2",
"origQuoteQty": "48000",
"executedQty": "1.2",
"leavingQty": "string",
"tradeBase": "2",
"tradeQuote": "48000",
"avgPrice": "42350",
"fee": "string",
"feeCurrency": "string",
"state": "NEW",
"time": 1655958915583,
"ip": "127.0.0.1",
"updatedTime": 1655958915583
}
]
}
}