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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 检索支付（两张卡）

> 通过 GET /v2/payments/{payment_id} 检索由两张卡出资的支付，包括每张卡的金额和交易。

此请求使用请求路径中的 `id`，检索通过[创建支付（两张卡）](https://docs.y.uno/zh-hans/reference/payments/create-payment-v2.md)创建的支付。基础 URL 在 sandbox 中为 `https://api-sandbox.y.uno/v2`，在生产环境中为 `https://api.y.uno/v2`。

响应中包含 `split_payment_methods: true`、`payment_methods_count: 2`，并在 `payment_method.payment_methods` 中为每张卡提供一个条目，每个条目都有其 `sequence`（`1` 或 `2`）、`type`、`amount` 和 `transactions`。卡本身没有独立的状态：请从每张卡的交易中读取该卡的结果，从支付级别的 `status` 和 `sub_status` 中读取支付结果。请参阅[使用两张卡支付](https://docs.y.uno/zh-hans/docs/payment-features/pay-with-two-cards.md#statuses)。

> [!NOTE]
>
> 对于通过 `POST /v1/payments` 创建的支付，请使用 v1 请求 `GET /v1/payments/{payment_id}`。v1 响应将支付作为一个整体显示，而不是按卡显示。


## OpenAPI

````yaml openapi/zh-hans/payments/retrieve-payment-two-cards.json GET /payments/{payment_id}
openapi: 3.1.0
info:
  title: payments-v2
  version: 2.0.0
servers:
  - url: https://api-sandbox.y.uno/v2
    description: Sandbox
  - url: https://api.y.uno/v2
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /payments/{payment_id}:
    get:
      summary: 检索支付（v2）
      description: >-
        检索使用 `POST /v2/payments` 创建的支付，`payment_method.payment_methods`
        中每张卡对应一条记录。
      operationId: retrieve-payment-two-cards
      parameters:
        - name: payment_id
          in: path
          required: true
          description: '`POST /v2/payments` 返回的支付 `id`。'
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: 支付
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentV2'
              examples:
                Both cards charged:
                  value:
                    id: 7c1b6e2a-5f3d-4a8e-9b21-3e4f5a6b7c8d
                    account_id: 493e9374-510a-4201-9e09-de669d75f256
                    description: Order paid with two cards
                    country: BR
                    status: SUCCEEDED
                    sub_status: APPROVED
                    merchant_order_id: order-10045
                    created_at: '2026-10-27T14:02:11.120Z'
                    updated_at: '2026-10-27T14:02:12.300Z'
                    split_payment_methods: true
                    payment_methods_count: 2
                    sdk_action_required: false
                    amount:
                      currency: BRL
                      value: 300
                    checkout:
                      session: null
                    payment_method:
                      capture: true
                      account_updater: false
                      payment_methods:
                        - sequence: 1
                          type: CARD
                          amount:
                            currency: BRL
                            value: 200
                          transactions:
                            - id: d2a4f6b8-1c3e-4a5b-8d7f-9e0a1b2c3d4e
                              type: PURCHASE
                              status: SUCCEEDED
                              category: CARD
                              amount: 200
                              provider_id: YUNO_TEST_PAYMENT_GATEWAY
                              response_code: SUCCEEDED
                              response_message: Transaction successful
                              reason: null
                              description: null
                              merchant_reference: null
                              three_d_secure_action_required: false
                              created_at: '2026-10-27T14:02:11.402Z'
                              updated_at: '2026-10-27T14:02:12.118Z'
                        - sequence: 2
                          type: CARD
                          amount:
                            currency: BRL
                            value: 100
                          transactions:
                            - id: e3b5a7c9-2d4f-4b6c-9e8a-0f1b2c3d4e5f
                              type: PURCHASE
                              status: SUCCEEDED
                              category: CARD
                              amount: 100
                              provider_id: YUNO_TEST_PAYMENT_GATEWAY
                              response_code: SUCCEEDED
                              response_message: Transaction successful
                              reason: null
                              description: null
                              merchant_reference: null
                              three_d_secure_action_required: false
                              created_at: '2026-10-27T14:02:11.402Z'
                              updated_at: '2026-10-27T14:02:12.118Z'
                    customer_payer:
                      id: cfae0941-7234-427a-a739-ef4fce966c79
                      first_name: Ana
                      last_name: Souza
                      email: ana.souza@example.com
                    workflow: DIRECT
                    callback_url: https://merchant.example.com/checkout/return
                    metadata: []
                One card captured:
                  value:
                    id: 7c1b6e2a-5f3d-4a8e-9b21-3e4f5a6b7c8d
                    account_id: 493e9374-510a-4201-9e09-de669d75f256
                    description: Order paid with two cards
                    country: BR
                    status: SUCCEEDED
                    sub_status: PARTIALLY_CAPTURED
                    merchant_order_id: order-10045
                    created_at: '2026-10-27T14:02:11.120Z'
                    updated_at: '2026-10-27T14:02:12.300Z'
                    split_payment_methods: true
                    payment_methods_count: 2
                    sdk_action_required: false
                    amount:
                      currency: BRL
                      value: 300
                    checkout:
                      session: null
                    payment_method:
                      capture: false
                      account_updater: false
                      payment_methods:
                        - sequence: 1
                          type: CARD
                          amount:
                            currency: BRL
                            value: 200
                          transactions:
                            - id: d2a4f6b8-1c3e-4a5b-8d7f-9e0a1b2c3d4e
                              type: AUTHORIZE
                              status: SUCCEEDED
                              category: CARD
                              amount: 200
                              provider_id: YUNO_TEST_PAYMENT_GATEWAY
                              response_code: SUCCEEDED
                              response_message: Transaction successful
                              reason: null
                              description: null
                              merchant_reference: null
                              three_d_secure_action_required: false
                              created_at: '2026-10-27T14:02:11.402Z'
                              updated_at: '2026-10-27T14:02:12.118Z'
                            - id: a5d7c9e1-4f6b-4d8e-9a0c-2b3c4d5e6f7a
                              type: CAPTURE
                              status: SUCCEEDED
                              category: CARD
                              amount: 200
                              provider_id: YUNO_TEST_PAYMENT_GATEWAY
                              response_code: SUCCEEDED
                              response_message: Transaction successful
                              reason: null
                              description: null
                              merchant_reference: null
                              three_d_secure_action_required: false
                              created_at: '2026-10-27T14:02:11.402Z'
                              updated_at: '2026-10-27T14:02:12.118Z'
                        - sequence: 2
                          type: CARD
                          amount:
                            currency: BRL
                            value: 100
                          transactions:
                            - id: e3b5a7c9-2d4f-4b6c-9e8a-0f1b2c3d4e5f
                              type: AUTHORIZE
                              status: SUCCEEDED
                              category: CARD
                              amount: 100
                              provider_id: YUNO_TEST_PAYMENT_GATEWAY
                              response_code: SUCCEEDED
                              response_message: Transaction successful
                              reason: null
                              description: null
                              merchant_reference: null
                              three_d_secure_action_required: false
                              created_at: '2026-10-27T14:02:11.402Z'
                              updated_at: '2026-10-27T14:02:12.118Z'
                    customer_payer:
                      id: cfae0941-7234-427a-a739-ef4fce966c79
                      first_name: Ana
                      last_name: Souza
                      email: ana.souza@example.com
                    workflow: DIRECT
                    callback_url: https://merchant.example.com/checkout/return
                    metadata: []
        '401':
          description: 凭证无效
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: INVALID_CREDENTIALS
                messages:
                  - Invalid credentials
        '404':
          description: 未找到支付
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
              example:
                code: PAYMENT_NOT_FOUND
                messages:
                  - Payment not found
components:
  schemas:
    PaymentV2:
      type: object
      description: 由两张卡共同支付的支付。
      properties:
        id:
          type: string
          format: uuid
        account_id:
          type: string
          format: uuid
        description:
          type: string
        country:
          type: string
        status:
          type: string
          description: >-
            支付的汇总状态。参见[使用两张卡支付](/zh-hans/docs/payment-features/pay-with-two-cards#statuses)。
        sub_status:
          type: string
          description: >-
            汇总子状态，例如
            `APPROVED`、`AUTHORIZED`、`PARTIALLY_CAPTURED`、`PARTIALLY_REFUNDED`、`REFUND_RETRY_IN_PROCESS`
            或 `CANCEL_RETRY_IN_PROCESS`。
        merchant_order_id:
          type: string
        merchant_reference:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        split_payment_methods:
          type: boolean
          description: 由两张卡共同支付的支付为 `true`。
        payment_methods_count:
          type: integer
          description: 为该支付出资的卡数量：`2`。
        sdk_action_required:
          type: boolean
          description: 当 SDK 必须继续该支付时为 `true`，例如运行 3DS 验证。
        amount:
          type: object
          description: 支付总额。
          required:
            - currency
            - value
          properties:
            currency:
              type: string
              description: ISO 4217 货币代码（3 个字符）。
              example: BRL
            value:
              type: number
              description: 以主单位表示的金额（0.0001 的倍数）。
              example: 300
        checkout:
          type: object
          properties:
            session:
              type:
                - string
                - 'null'
        payment_method:
          type: object
          properties:
            capture:
              type: boolean
              description: 两张卡共用的捕获设置。
            account_updater:
              type:
                - boolean
                - 'null'
            payment_methods:
              type: array
              description: 每张卡一条记录。不提供单卡状态：请从各卡的 `transactions` 中读取其结果。
              minItems: 2
              maxItems: 2
              items:
                type: object
                properties:
                  sequence:
                    type: integer
                    description: 卡的位置：`1` 或 `2`。
                  type:
                    type: string
                    enum:
                      - CARD
                  amount:
                    type: object
                    description: 该卡支付的总额部分。
                    required:
                      - currency
                      - value
                    properties:
                      currency:
                        type: string
                        description: ISO 4217 货币代码（3 个字符）。
                        example: BRL
                      value:
                        type: number
                        description: 以主单位表示的金额（0.0001 的倍数）。
                        example: 300
                  payment_method_detail:
                    type: object
                    description: 卡详细信息，与 v1 支付对象一致。
                  payment_method_owner:
                    type: object
                    description: 持卡人，在请求中发送时返回。
                  transactions:
                    type: array
                    description: >-
                      该卡的交易。经过 3DS 的卡会显示 `THREE_D_SECURE`，随后是 `PURCHASE` 或
                      `AUTHORIZE`。
                    items:
                      type: object
                      description: 该卡的一笔交易。请从其交易中读取该卡的结果。
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: 交易 id。用于按交易执行的操作。
                        type:
                          type: string
                          description: >-
                            交易类型，例如
                            `THREE_D_SECURE`、`PURCHASE`、`AUTHORIZE`、`CAPTURE`、`CANCEL`
                            或 `REFUND`。
                        status:
                          type: string
                          description: >-
                            该交易的状态，例如 `SUCCEEDED`、`DECLINED`、`PENDING` 或
                            `ERROR`。
                        category:
                          type: string
                          example: CARD
                        amount:
                          type: number
                          description: 该交易的金额。
                        provider_id:
                          type: string
                          description: 处理该交易的服务提供商。
                        response_code:
                          type: string
                          description: 该交易的 Yuno 响应代码。
                        response_message:
                          type: string
                        reason:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                        merchant_reference:
                          type:
                            - string
                            - 'null'
                        three_d_secure_action_required:
                          type:
                            - boolean
                            - 'null'
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type:
                            - string
                            - 'null'
                          format: date-time
        customer_payer:
          type: object
          description: 付款方，与请求中发送的一致。
        additional_data:
          type:
            - object
            - 'null'
        callback_url:
          type: string
        workflow:
          type: string
          enum:
            - DIRECT
            - REDIRECT
            - SDK_CHECKOUT
        metadata:
          type: array
          items:
            type: object
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: private-secret-key
      x-default: <Your private-secret-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.