# longbridge coupon

查看賬戶中的卡券，以及每張卡券所使用的訂單。

:::info 僅支持香港（AP）賬戶
這些命令讀取 AP（香港）數據中心的數據。美國賬戶執行時會返回錯誤，提示該命令在美國數據中心不可用；美國沒有對應的命令，重試也不會成功。`coupon list` 輸出中的時間均為香港時間（+08:00）。
:::

## 基本用法

```bash
# 賬戶中的卡券
longbridge coupon list
# 某張卡券所使用的訂單
longbridge coupon orders --card-id 0123456789abcdef0123456789abcdef
```

## coupon list

列出賬戶中的卡券：免佣卡、平台費抵扣卡、股票卡、行情 / 基本面數據卡、現金卡、IPO 卡等。

### 查看有效卡券

```bash
longbridge coupon list
longbridge coupon list --format json
```

預設表格顯示卡券 id、類型、標題、金額（有面值時含幣種）、狀態、生效時間及到期時間（永久有效顯示 `no expiry`），最後打印總數及已過期數。需要下方列出的全部字段時請使用 `--format json`。

```json
{
  "cards": [
    {
      "card_id": "0123456789abcdef0123456789abcdef",
      "card_type": "commission",
      "title": "港股免佣卡",
      "card_status": 0,
      "card_status_label": "unused",
      "start_time": "2026-11-01T00:00:00+08:00",
      "end_time": "2026-12-31T23:59:59+08:00",
      "trade_sessions": [],
      "commission": {
        "markets": ["HK"],
        "targets": ["stocks", "ETF"],
        "rebate_rate": "1",
        "bz_types": [0, 3],
        "commission_duration": 0,
        "unlimited": 1,
        "usage_count": 0,
        "lave_usage_count": 0,
        "amount_limit": 0,
        "superposition": false
      }
    }
  ],
  "total": 1,
  "expired_count": 3
}
```

示例中的值僅作說明。

### 查看已過期卡券

```bash
longbridge coupon list --status expired
```

### 按卡券類型篩選

```bash
# commission、platform_fee_deduct、stock、quote、cash 等
longbridge coupon list --card-type platform_fee_deduct
```

### 包含完整使用須知

```bash
longbridge coupon list --with-terms
```

預設 `description` 會被截短，`detail` 不輸出；`--with-terms` 會完整返回兩者。

### 翻頁

```bash
longbridge coupon list --page 2 --count 50
```

App 置頂或置底展示的卡券只在第 1 頁返回。

### 參數

| 參數 | 說明 |
| --- | --- |
| `--status` | `valid`（預設，未過期：未使用、使用中或已使用）或 `expired` |
| `--card-type` | 卡券類型，如 `commission`、`platform_fee_deduct`、`stock`、`quote`、`cash`（預設全部） |
| `--with-terms` | 返回每張卡券完整的使用須知（`description`、`detail`） |
| `--page` | 頁碼（預設 1；傳 `0` 按 1 處理） |
| `--count` | 每頁條數（預設 20，最大 50，超過按 50 處理）。別名：`--size`、`--limit` |

### 輸出字段

`cards[]` 中每項包含：

| 字段 | 說明 |
| --- | --- |
| `card_id` | 卡券 id（32 位十六進制），可傳給 [`coupon orders --card-id`](/zh-HK/docs/cli/account/coupon#coupon-orders) |
| `card_type`、`title`、`title_sec`、`description`、`detail` | 卡券類型、標題及使用須知 |
| `card_status`、`card_status_label` | 服務端原始狀態碼，及其標籤（CLI 未知的狀態碼沒有標籤）：`unused`、`used`、`expired`、`redeeming`、`in_use` 或 `processing` |
| `start_time`、`end_time` | 有效期。永久有效的卡券沒有 `end_time`，返回 `no_expiry: true` |
| `activate_time` | 激活時間 |
| `amount`、`currency` | 卡券面值（如適用），為十進制字符串，如 `"1000.00"` |
| `available_trade_session`、`trade_sessions` | 可使用的交易時段（展示文案，以及服務端返回的取值） |
| `subscription_id` | 訂閱 id，按服務端返回原樣輸出 |

每張卡券還帶有與其 `card_type` 對應的條款對象，例如免佣卡帶 `commission`；其他類型的對象不會出現。

| 對象 | 字段 |
| --- | --- |
| `commission` | `markets`, `targets`, `rebate_rate`, `bz_types`, `commission_balance`, `commission_duration`, `unlimited`, `commission_expired_time`, `usage_count`, `lave_usage_count`, `settlement_model`, `amount_limit`, `superposition` |
| `platform_fee_deduct` | `bz_types`, `counter_id`, `counter_name`, `markets`, `usage_count`, `lave_usage_count`, `superposition` |
| `cash` | `receive_duration` |
| `stock` | `counter_id`, `counter_name`, `amount`, `redemption_type`, `send_way`, `optional_counters[]` {`counter_id`, `shares`}, `fallback` {`enabled`, `type`, `counter_id`, `shares`} |
| `stock_fragment` | `counter_id`, `counter_name`, `market`, `markets`, `underlying_type`, `amounts` |
| `quote`, `fundamental` | `current_end_time`, `inapplicable`, `investor_type`, `manual_activate`, `markets`, `member_investor_type`, `pair_spu_no`, `quote_duration`, `quote_market`, `quote_tags`, `superposition` |
| `ipo` | `subscription_id` |
| `ipo_commission` | `bz_types`, `counter_id`, `counter_name`, `financing_limit` |
| `ipo_interest` | `discount_rate` |
| `finance_interest` | `discount_mode`, `discount_rate`, `superposition` |
| `fund_deduct` | `max_risk_level`, `min_order_amount`, `order_types`, `underlying_type`, `underlying_values`, `underlying_names` |
| `crypto` | `fallback` {`enabled`, `counter_id`}, `optional_counters[]` {`counter_id`} |
| `coffee_coupon` | `coupon_channel`, `coupon_id`, `coupon_no`, `is_available_all_store`, `period_type`, `settled_store_id`, `store_id_list`, `store_list[]` {`store_id`, `store_name`}, `threshold`, `use_limit` |
| `ai_benefit` | `benefit_days`, `benefit_start`, `benefit_end`, `benefit_tag` |

這些對象中的代碼均為服務端原始數字，CLI 未知的代碼也會原樣輸出：

- `bz_types`（`commission` 與 `platform_fee_deduct` 中）及 `stock_fragment.underlying_type`：`0` 股票，`1` 美股期權，`2` 港股窩輪，`3` ETF，`4` LOF。`commission.targets` 為其中已知代碼的名稱（`stocks` / `options` / `warrants` / `ETF` / `LOF`），`bz_types` 中至少有一個已知代碼時才會出現
- `ipo_commission.bz_types`：`1` 融資認購新股，`2` 現金認購新股
- `commission.unlimited`：`0` 限時免佣，`1` 返佣，`2` 抵扣，`6` 按次使用、每次固定金額的卡（`amount` / `usage_count`），`7` 按次使用、每次優惠以 `amount_limit` 為上限的折扣卡
- `investor_type`（`quote` / `fundamental` 中）：`0` 不限，`1` 非專業投資者，`2` 專業投資者

其他取值：

- `commission.commission_duration` 與 `quote_duration` 以秒為單位；200 年及以上表示終身免費
- `commission.amount_limit` 為 `unlimited` 為 `7` 的卡每次使用的優惠上限
- `usage_count` 與 `lave_usage_count` 為已使用次數和剩餘次數；`superposition` 為 `true` 表示可與其他卡券疊加使用
- `ai_benefit.benefit_days` 以天為單位
- `ipo_interest.discount_rate` 為年化利率
- `coffee_coupon.coupon_no` 為券的模板編碼（如 `coffee-50`），不是個人兌換碼；卡券尚未在門店核銷時沒有 `settled_store_id`
- `cash.receive_duration` 及 `finance_interest` 各字段的含義尚未確認，按服務端返回原樣輸出

`commission.commission_balance`、`stock.amount` 和 `finance_interest.discount_rate` 為十進制字符串，其餘取值按服務端返回原樣輸出。這些對象中的時間（`commission_expired_time`、`current_end_time`、`benefit_start`、`benefit_end`）均為香港時間（+08:00），未設置的時間不輸出。

沒有值的字段不會出現在 JSON 中，而不是輸出為 `null` 或空字符串。例如從未激活的卡券沒有 `activate_time`。

`total` 為符合篩選條件的卡券數，`expired_count` 為已過期卡券數。輸出中不含任何賬號。

## coupon orders

列出某張卡券（如免佣卡、平台費抵扣卡）所使用的訂單。

### 查看使用了某張卡券的訂單

```bash
# 卡券 id 為 `longbridge coupon list` 中的 card_id（32 位十六進制）
longbridge coupon orders --card-id 0123456789abcdef0123456789abcdef
longbridge coupon orders --card-id 0123456789abcdef0123456789abcdef --format json
```

預設表格每個訂單一行，顯示分組（`locked` 或 `settled`）、訂單號、狀態、價格、數量、幣種、返還金額及返還日期。需要下方列出的全部字段時請使用 `--format json`。

```json
{
  "card_id": "0123456789abcdef0123456789abcdef",
  "locked": [],
  "settled": [
    {
      "order_id": "100000000000000001",
      "state": "Filled",
      "state_val": "FilledStatus",
      "executed_price": "385.20",
      "executed_quantity": "200",
      "currency": "HKD",
      "settlement_currency": "HKD",
      "rebate": "15.00",
      "rebate_dt": "2026-11-04"
    }
  ]
}
```

示例中的值僅作說明。

純數字的 id 是銀行卡 id，不是卡券。請使用 [`coupon list`](/zh-HK/docs/cli/account/coupon#coupon-list) 中的 id，而不是 `bank-cards` 中的 id。不是 32 位十六進制的 id 會直接報錯，不發出請求；看起來像銀行卡 id 時會附帶提示。

### 參數

| 參數 | 說明 |
| --- | --- |
| `--card-id` | 卡券 id（[`coupon list`](/zh-HK/docs/cli/account/coupon#coupon-list) 中的 `card_id`）。必填 |

### 輸出字段

| 字段 | 說明 |
| --- | --- |
| `card_id` | 查詢的卡券 id |
| `locked[]` | 佔用該卡、返還尚未結算的訂單 |
| `settled[]` | 已結算返還的訂單 |

每個訂單包含 `order_id`、`state`、`state_val`、`executed_price`、`executed_quantity`、`currency`、`settlement_currency`、`rebate` 和 `rebate_dt`；`executed_price`、`executed_quantity` 和 `rebate` 為十進制字符串。`rebate_dt` 為返還日期，按服務端返回原樣輸出，CLI 不做時區轉換。輸出中不含任何賬號。

沒有值的字段不會出現在 JSON 中，而不是輸出為 `null` 或空字符串。例如返還尚無日期時沒有 `rebate_dt`。

## 權限要求

需要 OAuth 賬戶權限。參見[賬戶權限設置](/zh-HK/docs/trade/trade-overview)。