> ## Documentation Index
> Fetch the complete documentation index at: https://developer.wooxpro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询合约历史订单 (KEYED)

`适用于查询某合约订单历史记录`

#### 请求URL

`GET https://cloud-api.wooxpro.com/contract/private/order-history`

#### 请求限制

参见 [速率限制详细](/cn/rate-limit)

#### 请求参数

> 请求

```shell theme={null}
curl -H 'X-API-KEY:{{AccessKey}}'
https://cloud-api.wooxpro.com/contract/private/order-history?symbol=BTCUSDT&start_time=1662368173&end_time=1662368179
```

| 参数                | 类型     | 是否必填 | 描述                                                    |
| :---------------- | :----- | :--- | :---------------------------------------------------- |
| symbol            | String | 必填   | 合约交易对（如BTCUSDT）                                       |
| order\_id         | String | 选填   | 订单编号                                                  |
| client\_order\_id | String | 选填   | 用户自定义订单ID                                             |
| account           | String | 选填   | 交易用户<br />-`futures`=合约主账号<br />-`copy_trading`=跟单子账号 |
| start\_time       | Long   | 选填   | 开始时间(时间戳，精确到秒)                                        |
| end\_time         | Long   | 选填   | 结束时间(时间戳，精确到秒)                                        |

##### 注意

* 没有填写时间范围 `start_time`和`end_time`，默认查询最近7天数据
* 填写时间范围的话，`end_time` 必须比 `start_time` 的值大， 并且`start_time`和`end_time` 最大支持 90 天的查询间隔
* 每次请求最多返回200条，超过的将不会返回

#### 响应详情

> 响应

```json theme={null}
{
  "code": 1000,
  "message": "Ok",
  "data": [
    {
      "order_id": "3000101684062644",
      "client_order_id": "PLAN_3000097492004577",
      "price": "0",
      "trigger_price": "0",
      "execution_price": "0",
      "size": "1",
      "symbol": "BTCUSDT",
      "state": 4,
      "side": 2,
      "type": "market",
      "account": "futures",
      "position_mode": "hedge_mode",
      "leverage": "20",
      "open_type": "cross",
      "deal_avg_price": "84802",
      "deal_size": "1",
      "create_time": 1743160485193,
      "update_time": 1743160485258,
      "activation_price_type": 1,
      "activation_price": "0",
      "callback_rate": "0",
      "preset_take_profit_price_type": 0,
      "preset_stop_loss_price_type": 0,
      "preset_take_profit_price": "",
      "preset_stop_loss_price": ""
    }
  ],
  "trace": "b15f261868b540889e57f826e0420621.80.17434162457898722"
}
```

| 字段                                | 类型     | 描述                                                                                                                                                       |
| :-------------------------------- | :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| symbol                            | String | 合约交易对（如BTCUSDT）                                                                                                                                          |
| order\_id                         | String | 订单编号                                                                                                                                                     |
| client\_order\_id                 | String | 用户自定义ID（如果该字段未定义，则返回空）                                                                                                                                   |
| side                              | Int    | 订单方向                                                                                                                                                     |
| type                              | String | 订单类型<br />-`limit`=限价单<br />-`market`=市价单<br />-`liquidate`=强平单<br />-`bankruptcy`=爆仓破产单<br />-`adl`=adl单<br />-`trailing`=跟踪委托单<br />-`planorder`=计划委托单 |
| account                           | String | 交易用户<br />-`futures`=合约主账号<br />-`copy_trading`=跟单子账号                                                                                                    |
| position\_mode                    | String | 持仓模式 <br />-`hedge_mode`=双向持仓<br />-`one_way_mode`=单向持仓                                                                                                  |
| leverage                          | String | 杠杆下单倍数                                                                                                                                                   |
| open\_type                        | String | 开仓类型<br />-`cross`=全仓<br />-`isolated`=逐仓                                                                                                                |
| deal\_avg\_price                  | String | 成交均价                                                                                                                                                     |
| deal\_size                        | String | 成交数量                                                                                                                                                     |
| price                             | String | 委托价格                                                                                                                                                     |
| trigger\_price                    | String | 触发价格,计划委托单返回                                                                                                                                             |
| execution\_price                  | String | 执行价格,计划委托单返回<br />-`Market price`=如果执行价格为市价，返回Market<br />-`Limit price`=如果执行价格为限价，返回设置的限价价格                                                             |
| size                              | String | 委托数量                                                                                                                                                     |
| state                             | Int    | 订单状态<br />-`2`=委托中<br />-`4`=已结束                                                                                                                         |
| activation\_price                 | String | 激活价格,跟踪委托单返回                                                                                                                                             |
| callback\_rate                    | String | 回调幅度,跟踪委托单返回                                                                                                                                             |
| activation\_price\_type           | Int    | 激活价格类型,跟踪委托单返回 <br />-`1`=最新成交价<br />-`2`=标记价格                                                                                                           |
| executive\_order\_id              | String | 触发执行订单编号                                                                                                                                                 |
| preset\_take\_profit\_price\_type | Int    | 预设止盈委托价格类型 <br />-`0`=未设置<br />-`1`=最新成交价<br />-`2`=标记价格                                                                                                 |
| preset\_stop\_loss\_price\_type   | Int    | 预设止损委托价格类型   <br />-`0`=未设置<br />-`1`=最新成交价<br />-`2`=标记价格                                                                                               |
| preset\_take\_profit\_price       | String | 预设止盈价格                                                                                                                                                   |
| preset\_stop\_loss\_price         | String | 预设止损价格                                                                                                                                                   |
| create\_time                      | Long   | 订单创建时间(ms)                                                                                                                                               |
| update\_time                      | Long   | 订单更新时间(ms)                                                                                                                                               |
