# 查询已保存 token

> 查询商户客户名下已保存的卡 token 或订阅 token。

```yaml
openapi: 3.1.0
info:
  title: 查询已保存 token
  version: 1.0.0
  description: 查询商户客户名下已保存的卡 token 或订阅 token。
paths:
  /v1/txn/queryTokenList:
    post:
      summary: 查询已保存 token
      description: 查询商户客户名下已保存的卡 token 或订阅 token。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 创建商户账户时分配的商户号。
                appId:
                  type: string
                  description: 商户应用 ID；不传时查询该商户号下所有已保存 token，传入时仅查询指定 `appId` 下的已保存 token。
                merchantCustId:
                  type: string
                  description: 客户在商户系统中的唯一标识，用于限定要查询的客户 token。
                subProductType:
                  type: string
                  description: 要查询的 token 类型；不传时按已保存卡 token 查询，查询订阅 token 时传 `SUBSCRIBE`。
                  enum:
                    - TOKEN
                    - SUBSCRIBE
                  x-enum-descriptions:
                    TOKEN: 已保存卡 token 查询。
                    SUBSCRIBE: 订阅 token 查询。
                sign:
                  type: string
                  description: 请求签名字符串；生成方式详见[请求签名](/zh/payments/get-started/request-signing)。
              required:
                - merchantNo
                - merchantCustId
                - sign
            examples:
              list-saved-card-tokens:
                summary: 查询已保存卡 token
                value:
                  merchantCustId: cust_demo_token_202606150001
                  merchantNo: replace_with_merchant_no
                  sign: "{{SIGN}}"
                  subProductType: TOKEN
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: 响应码；`20000` 表示查询请求处理成功，不代表一定查到 token
                      明细；其余为错误码。完整码表见[响应码](/zh/payments/api-reference/response-codes)。
                  respMsg:
                    type: string
                    description: 响应码对应的可读说明。
                  data:
                    type: object
                    properties:
                      merchantNo:
                        type: string
                        description: Onerway 分配的商户号，对应本次查询结果所属商户。
                      tokenInfos:
                        type: array
                        description: token 明细列表，承载符合查询条件的已保存卡 token 或订阅 token。Onerway 为每份订阅合约分别生成订阅
                          token，即使这些合约使用同一张卡。
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: 绑定信息 ID；调用[删除卡
                                token](/zh/payments/api-reference/endpoints/delete-card-token)时作为
                                `id` 提交。
                            tokenId:
                              type: string
                              description: token 令牌 ID，用于后续 token 支付或订阅相关操作的关联；该值不同于绑定记录 `id`。
                            appId:
                              type: string
                              description: token 所属商户应用 ID。
                            cardNumber:
                              type: string
                              description: 脱敏卡号，仅保留前 6 位和后 4 位，中间位掩码。
                            paymentMethod:
                              type: string
                              description: 具体支付方式，涵盖卡品牌或本地支付方式类型。
                            cardBinCountry:
                              type: string
                              description: 卡 BIN 所属国家或地区代码。
                            year:
                              type: string
                              description: 卡片有效期年份。
                            month:
                              type: string
                              description: 卡片有效期月份。
                        x-onerway-value:
                          empty: true
                          when:
                            en: Returns an empty array `[]` when no token matches the query conditions. The
                              field is not `null` and is not omitted.
                            zh: 没有符合条件的 token 时返回空数组 `[]`，不是 `null`，也不是省略字段。
                    description: 业务数据对象，承载商户号与 token 明细列表。
```
