# 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-CN/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-CN/docs/cli/account/coupon#coupon-list) 中的 id，而不是 `bank-cards` 中的 id。不是 32 位十六进制的 id 会直接报错，不发出请求；看起来像银行卡 id 时会附带提示。

### 参数

| 参数 | 说明 |
| --- | --- |
| `--card-id` | 卡券 id（[`coupon list`](/zh-CN/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-CN/docs/trade/trade-overview)。