# 歷史成交明細

`GET` `/v1/trade/execution/history`

該接口用於獲取歷史訂單的成交明細，包括買入和賣出的成交記錄，不支持當日成交明細查詢。

## Parameters

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | 股票代碼，使用 `ticker.region` 格式，例如：`AAPL.US` |
| `start_at` | string | No | 開始時間，格式為時間戳 (秒)，例如：`1650410999`。. 開始時間為空時，默認為結束時間或當前時間前九十天。 |
| `end_at` | string | No | 結束時間，格式為時間戳 (秒)，例如：`1650410999`。. 結束時間為空時，默認為開始時間後九十天或當前時間。 |

## Request Example

```bash
curl --request GET \
  --url 'https://openapi.longbridge.com/v1/trade/execution/history' \
  --header 'Authorization: Bearer <access_token>'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `trades` | object[] | No | 成交明細信息 |
| `└ trade_id` | string | No | 成交 ID |
| `└ order_id` | string | No | 訂單 ID |
| `└ symbol` | string | No | 股票代碼，使用 `ticker.region` 格式，例如：`AAPL.US` |
| `└ price` | string | No | 成交價格 |
| `└ quantity` | string | No | 成交數量 |
| `└ trade_done_at` | string | No | 成交時間，格式為時間戳 (秒) |
| `└ side` | string | No | 買賣方向。**可選值：**, `Buy` - 買入，`Sell` - 賣出 |
| `has_more` | boolean | No | 是否還有更多數據。. 每次查詢最大訂單數量為 1000，如果查詢結果數量超過 1000，那麼 has_more 就會為 true |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "has_more": false,
    "trades": [
      {
        "order_id": "693664675163312128",
        "price": "388",
        "quantity": "100",
        "side": "Buy",
        "symbol": "700.HK",
        "trade_done_at": "1648611351",
        "trade_id": "693664675163312128-1648611351433741210"
      }
    ]
  }
}
```
