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

# 按交易ID查询支付流水列表

> 根据交易ID获取支付流水列表。返回指定交易的所有支付流水（包括重试记录）。

根据交易ID获取支付流水列表。返回指定交易的所有支付流水（包括重试记录）。


## OpenAPI

````yaml openapi/v1-zh.yaml GET /api/v1/payments
openapi: 3.0.3
info:
  title: Subotiz API
  description: Subotiz OpenAPI
  version: 1.0.0
servers:
  - url: https://{api}.subotiz.com
    variables:
      api:
        default: api
security:
  - sec0: []
tags:
  - name: 折扣
    description: 折扣
  - name: 发票
    description: 发票
  - name: 退款
    description: 退款
  - name: 商品管理
    description: 商品管理
  - name: 订阅
    description: 订阅
  - name: 商品定价
    description: 商品定价方案
  - name: 交易单
    description: 交易单
  - name: 支付流水
    description: 支付流水
  - name: 结账会话
    description: 结账会话
  - name: 顾客
    description: 顾客
  - name: 顾客门户
    description: 顾客门户
  - name: Webhook
    description: Webhook
  - name: 争议
    description: 争议订单
paths:
  /api/v1/payments:
    get:
      tags:
        - 支付流水
      summary: 按交易ID查询支付流水列表
      description: 根据交易ID获取支付流水列表。返回指定交易的所有支付流水（包括重试记录）。
      operationId: v1-payment-list-payments-by-trade-id
      parameters:
        - name: trade_id
          in: query
          description: 交易ID
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPaymentsResponse'
        '400':
          description: trade_id 参数必填
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              example:
                code: parameter_missing
                message: trade_id is required
        '404':
          description: trade_id 不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
              example:
                code: resource_missing
                message: trade_id does not exist
components:
  parameters:
    HeaderRequestID:
      name: Request-Id
      in: header
      description: 请求的唯一标识符
      required: true
      schema:
        type: string
        default: 008e3967-a1b5-48bb-be14-d5bff5092e61
  schemas:
    ListPaymentsResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/ListPaymentsResponse_Data'
      description: ListPaymentsResponse - 支付流水列表响应
    BaseResponse:
      type: object
      properties:
        code:
          type: string
          description: 错误码
        message:
          type: string
          description: 错误详细信息
    ListPaymentsResponse_Data:
      type: object
      properties:
        total:
          type: string
          description: 总数量
        list:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
          description: 支付流水列表
      description: ListPaymentsResponse - 支付流水列表响应
    Payment:
      type: object
      properties:
        id:
          type: string
          description: 数据库主键ID（雪花ID，字符串格式）
        out_trans_id:
          type: string
          description: 支付流水ID
        trade_id:
          type: string
          description: 订单ID / 交易ID
        merchant_id:
          type: string
          description: 商户ID
        payment_method:
          type: string
          description: 支付方式
        payment_channel:
          type: string
          description: 支付渠道
        status:
          type: string
          description: 支付状态
        amount:
          type: string
          description: 支付金额，截断到两位小数
        currency:
          type: string
          description: 币种
        channel_trade_id:
          type: string
          description: 渠道交易ID
        order_trans_id:
          type: string
          description: 订单交易ID（全局唯一，代表一次支付尝试）
        channel_payment_method:
          allOf:
            - $ref: '#/components/schemas/ChannelPaymentMethod'
          description: 支付方式信息
        created_at:
          type: string
          description: 创建时间
        channel_ret_code:
          type: string
          description: 渠道返回码
        channel_ret_msg:
          type: string
          description: 渠道返回消息
        verification:
          allOf:
            - $ref: '#/components/schemas/Verification'
          description: 卡支付安全验证结果（CVC / AVS / 3DS）；非卡支付或失败时为 null
      description: Payment - 支付流水
    ChannelPaymentMethod:
      type: object
      properties:
        type:
          type: string
          description: 类型，固定值 "card"
        card:
          allOf:
            - $ref: '#/components/schemas/CardInfo'
          description: 卡片信息
      description: ChannelPaymentMethod - 渠道支付方式
    Verification:
      type: object
      properties:
        cvc_check:
          type: string
          description: CVC 校验结果：pass / fail / unchecked / unavailable
        avs:
          allOf:
            - $ref: '#/components/schemas/Avs'
          description: 地址校验结果；未触发时为 null
        three_d_secure:
          allOf:
            - $ref: '#/components/schemas/ThreeDSecure'
          description: 3DS 校验结果；未走 3DS 时为 null
      description: Verification - 卡支付安全验证结果
    CardInfo:
      type: object
      properties:
        brand:
          type: string
          description: 卡片品牌
        country:
          type: string
          description: 发卡国家
        last4:
          type: string
          description: 卡号后4位
        funding:
          type: string
          description: 卡片类型（信用卡/借记卡）
        authcode:
          type: string
          description: 发卡行授权码；卡支付有值，非卡支付为空
        network_transaction_id:
          type: string
          description: 卡组织网络交易 ID；卡支付有值，非卡支付为空
      description: CardInfo - 卡片信息
    Avs:
      type: object
      properties:
        line1_check:
          type: string
          description: 地址行校验：pass / fail / unchecked / unavailable
        postal_code_check:
          type: string
          description: 邮编校验：pass / fail / unchecked / unavailable
      description: Avs - 地址校验结果
    ThreeDSecure:
      type: object
      properties:
        authentication_flow:
          type: string
          description: 认证流程：frictionless / challenge
        result:
          type: string
          description: >-
            认证结果：authenticated / attempt_acknowledged / not_supported / failed /
            exempted / processing_error
        result_reason:
          type: string
          description: 失败 / 降级原因，成功时为空
        version:
          type: string
          description: 3DS 协议版本，如 2.2.0
        eci:
          type: string
          description: ECI 电子商务指示符；非 3DS 交易或发卡行未返回时为空
      description: ThreeDSecure - 3DS 校验结果
  securitySchemes:
    sec0:
      type: http
      description: 'Bearer API Key 鉴权。格式：Authorization: Bearer {your_api_key}'
      scheme: bearer

````