> ## 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.

# 捕获授权

> 捕获先前已授权的支付，可部分或全额捕获，取决于服务提供商。

> [!WARNING]
>
> 请勿在另一笔捕获进行中时执行捕获。请等待当前操作完成后再开始新的操作。

此请求用于捕获先前已授权的支付。当创建授权时 capture 选项设为 `false`，需要执行此操作才能完成支付。根据支付服务提供商的不同，捕获可以是部分捕获（包括多次捕获）或全额捕获。`amount` 为可选：如果省略，API 将捕获全部已授权金额。超过授权金额的捕获会转发给服务提供商，由其决定是否接受。

> [!NOTE]
>
> **使用 Yuno 促销的支付**
>
> 授权金额是客户支付的金额，即 `amount.value` 减去 `discount_amount`，因此全额捕获会捕获该金额，`payment.amount.captured` 也会显示该金额。请参阅[促销](https://docs.y.uno/zh-hans/docs/payment-features/promotions#refunds-captures-and-cancellations)。

> [!NOTE]
>
> **部分批准的支付**
>
> 对于发送时带有 `payment_method.detail.card.partial_approval: true` 且已批准金额低于请求金额的支付，授权金额为 `payment.amount.authorized`。不带 `amount` 的捕获会捕获 `amount.authorized`，捕获全部该金额即完成捕获。超过 `amount.authorized` 的捕获会被拒绝，并返回 `400 INVALID_PARAMETERS` 和消息“Amount to capture exceeds the authorized amount.”。对于其他所有支付，捕获按上文所述方式进行。

如果授权已通过[增量授权](https://docs.y.uno/zh-hans/reference/payments/increment-authorization.md)提高，显式指定的 `amount` 最多可结算到提高后的总额，不带 `amount` 的捕获会结算该交易当前的全部冻结金额，即原始授权金额加上该交易上所有成功的增量。

请注意，此请求需要 `X-Idempotency-Key`。如需了解更多信息，请查看[身份验证](https://docs.y.uno/zh-hans/reference/getting-started/authentication.md#idempotency)页面。


## OpenAPI

````yaml openapi/zh-hans/payments/capture-authorization.json POST /payments/{payment_id}/transactions/{transaction_id}/capture
openapi: 3.1.0
info:
  title: payment-api-refundcancel-payment
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
    sec2: []
paths:
  /payments/{payment_id}/transactions/{transaction_id}/capture:
    post:
      summary: 捕获授权
      operationId: capture-authorization
      parameters:
        - name: payment_id
          in: path
          description: 支付的唯一标识符（UUID，36 个字符）。
          schema:
            type: string
          required: true
        - name: transaction_id
          in: path
          description: 交易的唯一标识符（UUID，36 个字符）
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - merchant_reference
                - reason
              properties:
                merchant_reference:
                  type: string
                  description: 由商户定义的支付交易标识（MAX 255；MIN 3）
                amount:
                  type: object
                  description: >-
                    指定捕获的金额对象。可选：如果省略，API 会捕获全部已授权金额。对于使用
                    `payment_method.detail.card.partial_approval: true`
                    发送且获得部分批准的支付，已授权金额为 `payment.amount.authorized`：不带 `amount`
                    的捕获会使用该金额，而超过该金额的 `amount` 会被拒绝并返回 `400 INVALID_PARAMETERS`。
                  required:
                    - currency
                    - value
                  properties:
                    currency:
                      type: string
                      description: >-
                        用于支付的币种。有关币种代码的完整列表，请参阅[国家参考](/zh-hans/reference/country-reference)（MAX
                        3；MIN 3；ISO 4217）。
                    value:
                      type: number
                      description: 支付金额（0.0001 的倍数）。
                      format: float
                reason:
                  type: string
                  description: 指示捕获的原因。例如：PRODUCT_CONFIRMED 和 REQUESTED_BY_CUSTOMER。
                additional_data:
                  type: object
                  description: 用于补充支付捕获的附加数据
                  properties:
                    order:
                      type: object
                      description: 指定订单对象。
                      properties:
                        shipping_amount:
                          type: number
                          description: 订单的运费金额（0.0001 的倍数）
                          format: float
                        fee_amount:
                          type: number
                          description: 订单的手续费金额（0.0001 的倍数）
                          format: float
                        items:
                          type: array
                          description: 指定商品对象数组。
                          items:
                            properties:
                              id:
                                type: string
                                description: 商品的唯一标识符（MAX 255；MIN 3）。
                              name:
                                type: string
                                description: 商品名称（MAX 255；MIN 3）。
                              quantity:
                                type: integer
                                description: 商品数量。
                                format: int32
                              unit_amount:
                                type: number
                                description: 商品单价（0.0001 的倍数）。
                                format: float
                              category:
                                type: string
                                description: >-
                                  商品类别。请查看[商品类别参考](/zh-hans/reference/items-category-list)。
                                enum:
                                  - art
                                  - baby
                                  - coupons
                                  - beauty_&_personal_care
                                  - donations
                                  - computing
                                  - books
                                  - grocery_&_gourmet_food
                                  - cameras
                                  - video_games
                                  - television
                                  - car_electronics
                                  - electronics
                                  - automotive
                                  - toys_&_games
                                  - musical_instruments
                                  - handmade
                                  - garden_&_outdoor
                                  - entertainment
                                  - industrial_&_scientific
                                  - fashion
                                  - games
                                  - pet_supplies
                                  - home
                                  - musical
                                  - phones
                                  - services
                                  - learnings
                                  - tickets
                                  - travels
                                  - virtual_goods
                                  - others
                              brand:
                                type: string
                                description: 商品品牌（MAX 255；MIN 3）。
                              sku_code:
                                type: string
                                description: 商品的库存单位（SKU）（MAX 255；MIN 3）。
                              manufacture_part_number:
                                type: string
                                description: 商品的制造商零件编号
                            required:
                              - id
                              - name
                              - quantity
                              - unit_amount
                            type: object
                    airline:
                      type: object
                      description: 指定航空公司对象。
                      properties:
                        pnr:
                          type: string
                          description: 旅客订座记录（MAX 10；MIN 1）。
                        legs:
                          type: array
                          description: 指定航段对象数组。
                          items:
                            properties:
                              departure_airport:
                                type: string
                                description: IATA 代码。请参阅 http://www.iata.org（MAX 3；MIN 3）。
                              departure_datetime:
                                type: string
                                description: >-
                                  以 UTC 时间表示的出发日期和时间（[ISO
                                  8601](https://en.wikipedia.org/wiki/ISO_8601)，MAX
                                  27；MIN 27）。
                                format: date-time
                              departure_airport_timezone:
                                type: string
                                description: 机场时区（MAX 6；MIN 6）。
                              arrival_airport:
                                type: string
                                description: >-
                                  IATA 机场代码。请参阅 http://www.iata.org（MAX 3；MIN
                                  3）。
                              carrier_code:
                                type: string
                                description: >-
                                  IATA 承运人代码。请参阅 http://www.iata.org（MAX 2；MIN
                                  2）。
                              carrier_name:
                                type: string
                                description: 航空承运人名称（MAX 100；MIN 1）。
                              flight_number:
                                type: string
                                description: 航空承运人分配的航班号（MAX 5；MIN 1）。
                              fare_basis_code:
                                type: string
                                description: >-
                                  票价基础代码除舱位服务外还提供有关票价的具体信息，两者均为预订所必需（MAX 15；MIN
                                  1）。
                              fare_class_code:
                                type: string
                                description: >-
                                  航空公司的票价舱位代码（MAX 1；MIN
                                  1）。值可以是一个字母（A-Z），但可能因航空公司的定义而异。请查看[航空公司信息参考](/zh-hans/reference/airline-information#fare-class-code)。
                                enum:
                                  - F
                                  - FR
                                  - B
                                  - CR
                                  - 'Y'
                                  - YD
                              base_fare:
                                type: number
                                description: 交易金额，不含税费和手续费，以货币的最小单位表示（multipleOf 0.0001）。
                                format: float
                              base_fare_currency:
                                type: string
                                description: >-
                                  交易金额所用的货币（MAX 3；MIN 3；[ISO
                                  4217](country-reference)）。
                              stopover_code:
                                type: string
                                description: >-
                                  1
                                  个字母的代码，指示乘客是否可以中途停留。仅允许两种字符：O：允许中途停留（字母“O”，不是数字零）/
                                  X：不允许中途停留。（MAX 1；MIN 1）
                            required:
                              - departure_airport
                              - departure_datetime
                              - departure_airport_timezone
                              - arrival_airport
                              - carrier_code
                              - flight_number
                              - fare_basis_code
                              - fare_class_code
                            type: object
                        passengers:
                          type: array
                          description: 指定与机票关联的乘客对象数组。
                          items:
                            properties:
                              first_name:
                                type: string
                                description: 旅客的名字（MAX 255；MIN 3）。
                              last_name:
                                type: string
                                description: 乘客的姓（MAX 255；MIN 3）
                              middle_name:
                                type: string
                                description: 旅客的中间名（MAX 255；MIN 3）。
                              type:
                                type: string
                                description: >-
                                  旅客类型（MAX 1；MIN
                                  1）。请查看[航空公司信息参考](/zh-hans/reference/airline-information#passenger-type)。
                                enum:
                                  - A
                                  - C
                                  - I
                              date_of_birth:
                                type: string
                                description: 旅客的出生日期，格式为 YYYY-MM-DD（MAX 10；MIN 10）。
                                format: date
                              nationality:
                                type: string
                                description: >-
                                  旅客的国籍（MAX 2；MIN 2；[ISO
                                  3166-1](country-reference)）。
                                enum:
                                  - AR
                                  - BO
                                  - BR
                                  - CL
                                  - CO
                                  - CR
                                  - EC
                                  - SV
                                  - GT
                                  - HN
                                  - MX
                                  - NI
                                  - PA
                                  - PY
                                  - PE
                                  - US
                                  - UY
                              document:
                                type: object
                                description: 指定乘客的证件对象。
                                properties:
                                  document_number:
                                    type: string
                                    description: 旅客的证件号码（MAX 40；MIN 3）。
                                  document_type:
                                    type: string
                                    description: >-
                                      乘客的证件类型（MAX 6；MIN
                                      2；（[国家参考](country-reference)））。
                                    enum:
                                      - DNI
                                      - CI
                                      - LC
                                      - LE
                                      - CUIT
                                      - CUIL
                                      - PAS
                                      - CPF
                                      - RG
                                      - CNH
                                      - CNPJ
                                      - RUT
                                      - RUN
                                      - CC
                                      - CE
                                      - NIT
                                      - DUI
                                      - PIC
                                      - DPI
                                      - IFR
                                      - INE
                                      - CP
                                      - RFC
                                      - CURP
                                      - CIP
                                      - CIC
                                      - CUI
                                      - RUC
                                      - ''
                                  country:
                                    type: string
                                    description: >-
                                      证件签发国家/地区（MAX 2；MIN 2；[ISO
                                      3166-1](country-reference)）。
                                    enum:
                                      - AR
                                      - BO
                                      - BR
                                      - CL
                                      - CO
                                      - CR
                                      - EC
                                      - SV
                                      - GT
                                      - HN
                                      - MX
                                      - NI
                                      - PA
                                      - PY
                                      - PE
                                      - US
                                      - UY
                              loyalty_number:
                                type: string
                                description: 旅客忠诚度计划的编号。
                              loyalty_tier:
                                type: string
                                description: >-
                                  旅客忠诚度计划的等级。请查看[航空公司信息参考](/zh-hans/reference/airline-information#loyalty-tier)。
                                enum:
                                  - '1'
                                  - '2'
                                  - '3'
                              phone:
                                type: object
                                description: 指定旅客的电话对象。
                            type: object
                        tickets:
                          type: array
                          description: 指定与乘客关联的机票对象数组。
                          items:
                            properties:
                              ticket_number:
                                type: string
                                description: 票号（MAX 14；MIN 1）。
                              e_ticket:
                                type: boolean
                                description: 是否为电子机票？（true）（false）。
                              restricted:
                                type: boolean
                                description: 指示机票是否可退款（true/false）
                              total_fare_amount:
                                type: number
                                description: 以货币最小单位表示的票价总额（0.0001 的倍数）。
                                format: float
                              total_tax_amount:
                                type: number
                                description: 以货币最小单位表示的税费总额（0.0001 的倍数）。
                                format: float
                              total_fee_amount:
                                type: number
                                description: 以货币最小单位表示的手续费总额（0.0001 的倍数）。
                                format: float
                              issue:
                                type: object
                                description: 指定出票对象。
                                properties:
                                  carrier_prefix_code:
                                    type: string
                                    description: >-
                                      出票或验证承运人。即 AWB 前缀（航空运单）3 位数字代码（MAX 3；MIN
                                      3）。
                                  travel_agent_code:
                                    type: string
                                    description: 出票旅行代理人的代码（MAX 9；MIN 8）。
                                  travel_agent_name:
                                    type: string
                                    description: 销售点在代理商列表中显示的名称或特许经营名称（MAX 32；MIN 1）。
                                  date:
                                    type: string
                                    description: 出票日期（MAX 27；MIN 27）。
                                    format: date-time
                                  address:
                                    type: string
                                    description: 售票代理人的地址（MAX 255；MIN 3）。
                                  city:
                                    type: string
                                    description: 售票代理人所在城市名称（MAX 255；MIN 3）。
                                  country:
                                    type: string
                                    description: >-
                                      出票所在国家的 alpha 2 代码（MAX 2；MIN 2；[ISO
                                      3166-1](country-reference)）。
                                    enum:
                                      - AR
                                      - BO
                                      - BR
                                      - CL
                                      - CO
                                      - CR
                                      - EC
                                      - SV
                                      - GT
                                      - HN
                                      - MX
                                      - NI
                                      - PA
                                      - PY
                                      - PE
                                      - US
                                      - UY
                            type: object
                    seller_details:
                      type: object
                      description: 指定卖家详细信息对象。
                      properties:
                        name:
                          type: string
                          description: 卖家的法定名称（MAX 255；MIN 3）。
                        email:
                          type: string
                          description: 卖家的 e-mail（MAX 255；MIN 3）。
                        reference:
                          type: number
                          description: 卖家的识别代码（MAX 255；MIN 3）。
                          format: float
                        website:
                          type: string
                          description: 卖家的网站 URL（MAX 255；MIN 3）。
                        industry:
                          type: string
                          description: >-
                            卖家所属行业（MAX 235；MIN
                            1）。有关详细信息，请访问[行业类别参考页面](/zh-hans/reference/industry-category-list)。
                        merchant_category_code:
                          type: string
                          description: MCC：商户类别代码（MAX 235；MIN 1）。
                        country:
                          type: string
                          description: >-
                            卖家所在国家/地区（MAX 255；MIN 3；[ISO
                            3166-1](/zh-hans/reference/country-reference)）。
                          enum:
                            - AR
                            - BO
                            - BR
                            - CL
                            - CO
                            - CR
                            - EC
                            - SV
                            - GT
                            - HN
                            - MX
                            - NI
                            - PA
                            - PY
                            - PE
                            - US
                            - UY
                            - ''
                        document:
                          type: object
                          description: 指定卖家的证件对象。
                          properties:
                            document_number:
                              type: string
                              description: 卖家的证件号码（MAX 40；MIN 3）。
                            document_type:
                              type: string
                              description: >-
                                卖家的证件类型（MAX 6；MIN
                                2；[证件类型列表](/zh-hans/reference/country-reference)）。
                              enum:
                                - DNI
                                - CI
                                - LC
                                - LE
                                - CUIT
                                - CUIL
                                - PAS
                                - CPF
                                - RG
                                - CNH
                                - CNPJ
                                - RUT
                                - RUN
                                - CC
                                - CE
                                - NIT
                                - DUI
                                - PIC
                                - DPI
                                - IFR
                                - INE
                                - CP
                                - RFC
                                - CURP
                                - CIP
                                - CIC
                                - CUI
                                - RUC
                                - ''
                        phone:
                          type: object
                          description: 指定卖家的电话号码对象。
                          properties:
                            country_code:
                              type: string
                              description: >-
                                卖家电话的国际电话区号（MAX 3；MIN
                                1）。请查看[国家参考](country-reference)了解电话区号。
                            number:
                              type: string
                              description: 卖家的电话号码，不含国家代码（MAX 32；MIN 1）。
                        address:
                          type: object
                          description: 指定卖家的地址对象。
                          properties:
                            address_line_1:
                              type: string
                              description: 卖家的主要地址行（MAX 255；MIN 3）。
                            address_line_2:
                              type: string
                              description: 卖家的次要账单地址行（MAX 255；MIN 3）。
                            city:
                              type: string
                              description: 卖家地址所在城市（MAX 255；MIN 3）。
                            country:
                              type: string
                              description: >-
                                卖家地址所在国家（MAX 2；MIN 2；[ISO
                                3166-1](/zh-hans/reference/country-reference)）。
                              enum:
                                - AR
                                - BO
                                - BR
                                - CL
                                - CO
                                - CR
                                - EC
                                - SV
                                - GT
                                - HN
                                - MX
                                - NI
                                - PA
                                - PY
                                - PE
                                - US
                                - UY
                                - ''
                            state:
                              type: string
                              description: 卖家地址所属的州/省（MAX 255；MIN 3）。
                            zip_code:
                              type: string
                              description: 卖家地址的邮政编码（MAX 11；MIN 4）。
                simplified_mode:
                  type: boolean
                  description: >-
                    决定 Yuno 在首次出现错误或被拒绝后，是否应自动尝试捕获支付。设置为 `true` 时，如果首次尝试失败，Yuno
                    将重试该流程。默认为
                    `false`。更多详情请访问[交易重试](https://docs.y.uno/zh-hans/docs/payment-features/transaction-retries)。
            examples:
              Full Capture:
                value:
                  amount:
                    currency: USD
                    value: 5000
                  description: Confirmed
                  reason: PRODUCT_CONFIRMED
                  merchant_reference: AAB01-432245
              Card Direct (with Airline Data):
                value:
                  merchant_reference: EJEMPLO_DE_REFERENCIA
                  amount:
                    currency: USD
                    value: '2000'
                  reason: PRODUCT_CONFIRMED
                  additional_data:
                    airline:
                      pnr: ABC123
                      legs:
                        - departure_airport: JFK
                          departure_datetime: '2023-10-31T01:30:00.000-05:00'
                          departure_airport_timezone: GMT-05
                          arrival_airport: LAX
                          carrier_code: AA
                          carrier_name: American Airlines
                          flight_number: AA348
                          fare_basis_code: 'Y'
                          fare_class_code: S
                          base_fare: 18000
                          base_fare_currency: USD
                          stopover_code: O
                      passengers:
                        - first_name: JOHN
                          last_name: DOE
                          middle_name: STEPHEN
                          type: A
                          date_of_birth: '1998-01-01'
                          nationality: US
                          document:
                            document_number: '123456789'
                            document_type: PASSPORT
                            country: US
                          loyalty_number: '79250001'
                          loyalty_tier: DIAMOND
                      tickets:
                        - ticket_number: AA0001
                          e_ticket: true
                          restricted: false
                          total_fare_amount: 20000
                          total_tax_amount: 18000
                          total_fee_amount: 1000
                          issue:
                            carrier_prefix_code: AA
                            travel_agent_code: A104121
                            travel_agent_name: TRAVELPRO
                            date: '2023-10-31T01:30:00.000-05:00'
                            address: 123 Main Street
                            city: NEW YORK
                            country: US
                            zip_code: '10001'
              Partial Capture:
                value:
                  amount:
                    currency: USD
                    value: 3000
                  description: Confirmed Partially
                  reason: PRODUCT_CONFIRMED
                  merchant_reference: AAB01-432245
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Full Capture:
                  value:
                    id: 89fd7fd0-951d-4335-ad1b-ef899a79630d
                    type: CAPTURE
                    status: SUCCEEDED
                    category: CARD
                    amount:
                      captured: 0
                      currency: USD
                      refunded: 0
                      value: 5000
                    merchant_reference: AAB01-432245
                    created_at: '2024-06-06T14:26:41.535489Z'
                    updated_at: '2024-06-06T14:26:41.615608Z'
                    provider_data:
                      id: YUNO_TEST_PAYMENT_GW
                      transaction_id: 1173513e-2422-4ba0-ba40-fd568a4904f9
                      account_id: 493e9374-510a-4201-9e09-de669d75f256
                      status: SUCCEEDED
                      status_detail: ''
                      response_message: Transaction successful
                      response_code: ''
                      iso8583_response_code: '00'
                      iso8583_response_message: Approved or completed successfully
                      raw_request:
                        amount:
                          currency: BRL
                          value: 2100
                        reference: '34343434'
                      raw_response: null
                      third_party_transaction_id: null
                      third_party_account_id: null
                    connection_data:
                      id: 58cc35f4-faef-4107-8e09-d18d60121d38
                      name: Connection name
                    response_code: SUCCEEDED
                    response_message: Transaction successful
                    payment:
                      id: af170f9d-e8c1-47e4-a988-25535e0f88a1
                      account_id: ''
                      description: Test
                      country: US
                      status: SUCCEEDED
                      sub_status: CAPTURED
                      merchant_order_id: '0000023'
                      created_at: '2024-06-06T14:26:22.933194Z'
                      updated_at: '2024-06-06T14:26:41.655119Z'
                      amount:
                        captured: 5000
                        authorized: 5000
                        currency: USD
                        refunded: 0
                        value: 5000
                      additional_data:
                        airline: null
                        order: null
                        seller_details: null
                CARD DIRECT (with Airline Data):
                  value:
                    id: 230292dd-b3e9-41e4-ae09-0a54e2f7a6d4
                    type: CAPTURE
                    status: SUCCEEDED
                    category: CARD
                    amount:
                      currency: USD
                      value: 20000
                      refunded: 0
                      captured: 0
                    merchant_reference: EJEMPLO_DE_REFERENCIA
                    created_at: '2023-04-27T02:51:52.213075Z'
                    updated_at: '2023-04-27T02:51:52.284381Z'
                    provider_data:
                      id: YUNO_TEST_PAYMENT_GW
                      transaction_id: a9a47e01-2dc1-4d5f-af23-11ab7164cd03
                      account_id: 493e9374-510a-4201-9e09-de669d75f256
                      status: SUCCEEDED
                      status_detail: ''
                      response_message: Transaction successful
                      response_code: ''
                      iso8583_response_code: '00'
                      iso8583_response_message: Approved or completed successfully
                      raw_response: null
                      third_party_transaction_id: null
                      third_party_account_id: null
                    connection_data:
                      id: 58cc35f4-faef-4107-8e09-d18d60121d38
                      name: Connection name
                    response_code: SUCCEEDED
                    response_message: Transaction successful
                    payment:
                      id: 637dffe9-5d18-4cdc-a5bf-95b8cd12bbd5
                      account_id: ''
                      description: SUCCESSFUL
                      country: US
                      status: SUCCEEDED
                      sub_status: CAPTURED
                      merchant_order_id: Order_id
                      created_at: '2023-04-27T02:51:24.470834Z'
                      updated_at: '2023-04-27T02:51:52.312297Z'
                      amount:
                        value: 20000
                        captured: 20000
                        authorized: 20000
                        refunded: 0
                        currency: USD
                      additional_data:
                        airline:
                          pnr: ABC123
                          legs:
                            - departure_airport: BOG
                              departure_datetime: '2023-10-31T01:30:00.000-05:00'
                              departure_airport_timezone: GMT-05
                              arrival_airport: BOM
                              carrier_code: PR
                              carrier_name: Philippine Airlines
                              flight_number: AV348
                              fare_basis_code: 'Y'
                              fare_class_code: S
                              base_fare: 18000
                              base_fare_currency: USD
                              stopover_code: O
                          passengers:
                            - first_name: JOHN
                              last_name: DOE
                              middle_name: STEPHEN
                              type: A
                              date_of_birth: '1998-01-01'
                              nationality: US
                              document:
                                document_type: SSN
                                document_number: 123-45-6789
                              country: null
                              loyalty_number: '79250001'
                              loyalty_tier: DIAMOND
                          tickets:
                            - ticket_number: BRB0001
                              e_ticket: true
                              restricted: false
                              total_fare_amount: 20000
                              total_tax_amount: 18000
                              total_fee_amount: 1000
                              issue:
                                carrier_prefix_code: '134'
                                travel_agent_code: A104121
                                travel_agent_name: AEROVIAJES
                                date: '2023-10-31T01:30:00.000-05:00'
                                address: 123 Main Street
                                city: New York
                                country: US
                                zip_code: '10001'
                        order: null
                        seller_details: null
                Partial Capture:
                  value:
                    id: c8104f4b-30d6-476f-8e6b-49daa110e31f
                    type: CAPTURE
                    status: SUCCEEDED
                    category: CARD
                    amount:
                      captured: 0
                      currency: USD
                      refunded: 0
                      value: 3000
                    merchant_reference: AAB01-432245
                    created_at: '2024-06-06T14:27:53.594183Z'
                    updated_at: '2024-06-06T14:27:53.705858Z'
                    provider_data:
                      id: YUNO_TEST_PAYMENT_GW
                      transaction_id: a9a47e01-2dc1-4d5f-af23-11ab7164cd03
                      account_id: 493e9374-510a-4201-9e09-de669d75f256
                      status: SUCCEEDED
                      status_detail: ''
                      response_message: Transaction successful
                      response_code: ''
                      iso8583_response_code: '00'
                      iso8583_response_message: Approved or completed successfully
                      raw_response: null
                      third_party_transaction_id: null
                      third_party_account_id: null
                    connection_data:
                      id: 58cc35f4-faef-4107-8e09-d18d60121d38
                      name: Connection name
                    response_code: SUCCEEDED
                    response_message: Transaction successful
                    payment:
                      id: 60915b59-e403-4c00-8404-15ececa9b5dd
                      account_id: ''
                      description: Test
                      country: US
                      status: SUCCEEDED
                      sub_status: PARTIALLY_CAPTURED
                      merchant_order_id: '0000023'
                      created_at: '2024-06-06T14:27:22.8355Z'
                      updated_at: '2024-06-06T14:27:53.74127Z'
                      amount:
                        captured: 3000
                        authorized: 30000
                        currency: USD
                        refunded: 0
                        value: 30000
                      additional_data:
                        airline: null
                        order: null
                        seller_details: null
              schema:
                oneOf:
                  - title: 全额捕获
                    type: object
                    properties:
                      id:
                        type: string
                        example: 89fd7fd0-951d-4335-ad1b-ef899a79630d
                      type:
                        type: string
                        example: CAPTURE
                      status:
                        type: string
                        example: SUCCEEDED
                      category:
                        type: string
                        example: CARD
                      amount:
                        type: object
                        properties:
                          captured:
                            type: integer
                            example: 0
                            default: 0
                          currency:
                            type: string
                            example: USD
                          refunded:
                            type: integer
                            example: 0
                            default: 0
                          value:
                            type: integer
                            example: 30000
                            default: 0
                      merchant_reference:
                        type: string
                        example: AAB01-432245
                      created_at:
                        type: string
                        example: '2024-06-06T14:26:41.535489Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T14:26:41.615608Z'
                      provider_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO_TEST_PAYMENT_GW
                          transaction_id:
                            type: string
                            example: 1173513e-2422-4ba0-ba40-fd568a4904f9
                          account_id:
                            type: string
                            example: 493e9374-510a-4201-9e09-de669d75f256
                          status:
                            type: string
                            example: SUCCEEDED
                          status_detail:
                            type: string
                            example: ''
                          response_message:
                            type: string
                            example: Transaction successful
                          response_code:
                            type: string
                            example: ''
                          iso8583_response_code:
                            type: string
                            example: '00'
                          iso8583_response_message:
                            type: string
                            example: Approved or completed successfully
                          raw_request:
                            type: object
                            description: Yuno 发送给服务提供商的请求的混淆副本。仅对列入允许名单的组织返回。
                          raw_response: {}
                          third_party_transaction_id: {}
                          third_party_account_id: {}
                      connection_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: 58cc35f4-faef-4107-8e09-d18d60121d38
                          name:
                            type: string
                            example: Connection name
                      response_code:
                        type: string
                        example: SUCCEEDED
                      response_message:
                        type: string
                        example: Transaction successful
                      payment:
                        type: object
                        properties:
                          id:
                            type: string
                            example: af170f9d-e8c1-47e4-a988-25535e0f88a1
                          account_id:
                            type: string
                            example: ''
                          description:
                            type: string
                            example: Test
                          country:
                            type: string
                            example: US
                          status:
                            type: string
                            example: SUCCEEDED
                          sub_status:
                            type: string
                            example: CAPTURED
                          merchant_order_id:
                            type: string
                            example: '0000023'
                          created_at:
                            type: string
                            example: '2024-06-06T14:26:22.933194Z'
                          updated_at:
                            type: string
                            example: '2024-06-06T14:26:41.655119Z'
                          amount:
                            type: object
                            properties:
                              captured:
                                type: integer
                                example: 30000
                                default: 0
                              authorized:
                                type: number
                                description: >-
                                  服务提供商已批准的金额（0.0001 的倍数），扣除任何 Yuno 促销（`value`
                                  减去
                                  `discount_amount`），并加上已批准的增量授权。在全额批准时，或服务提供商未返回已批准金额时，它等于该净额。对于发送了
                                  `payment_method.detail.card.partial_approval:
                                  true` 的卡支付，部分批准后支付仍保持全额批准的状态，因此当 `authorized`
                                  小于 `value` 减去 `discount_amount`（无促销时，小于
                                  `value`）时，即为部分批准。对于未获批准的支付，或在引入此字段之前创建的支付，不会返回此字段。
                                example: 30000
                              currency:
                                type: string
                                example: USD
                              refunded:
                                type: integer
                                example: 0
                                default: 0
                              value:
                                type: integer
                                example: 30000
                                default: 0
                          discount_amount:
                            type: object
                            description: >-
                              应用于支付的 Yuno 促销的总折扣：即
                              `additional_data.order.discounts` 中
                              `YUNO_PROMOTION` 行的总和。未应用促销时不存在。实际扣款金额为
                              `amount.value` 减去此值，见 `transactions.amount`。请参阅
                              [Promotions](/zh-hans/docs/payment-features/promotions)。
                            properties:
                              currency:
                                type: string
                                description: 折扣的货币，与 `amount.currency` 相同。
                              value:
                                type: number
                                description: 折扣。
                          additional_data:
                            type: object
                            properties:
                              airline: {}
                              order: {}
                              seller_details: {}
                  - title: CARD DIRECT（含航空数据）
                    type: object
                    properties:
                      id:
                        type: string
                        example: 230292dd-b3e9-41e4-ae09-0a54e2f7a6d4
                      type:
                        type: string
                        example: CAPTURE
                      status:
                        type: string
                        example: SUCCEEDED
                      category:
                        type: string
                        example: CARD
                      amount:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          value:
                            type: integer
                            example: 20000
                            default: 0
                          refunded:
                            type: integer
                            example: 0
                            default: 0
                          captured:
                            type: integer
                            example: 0
                            default: 0
                      merchant_reference:
                        type: string
                        example: EJEMPLO_DE_REFERENCIA
                      created_at:
                        type: string
                        example: '2023-04-27T02:51:52.213075Z'
                      updated_at:
                        type: string
                        example: '2023-04-27T02:51:52.284381Z'
                      provider_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO_TEST_PAYMENT_GW
                          transaction_id:
                            type: string
                            example: a9a47e01-2dc1-4d5f-af23-11ab7164cd03
                          account_id:
                            type: string
                            example: 493e9374-510a-4201-9e09-de669d75f256
                          status:
                            type: string
                            example: SUCCEEDED
                          status_detail:
                            type: string
                            example: ''
                          response_message:
                            type: string
                            example: Transaction successful
                          response_code:
                            type: string
                            example: ''
                          iso8583_response_code:
                            type: string
                            example: '00'
                          iso8583_response_message:
                            type: string
                            example: Approved or completed successfully
                          raw_request:
                            type: object
                            description: Yuno 发送给服务提供商的请求的混淆副本。仅对列入允许名单的组织返回。
                          raw_response: {}
                          third_party_transaction_id: {}
                          third_party_account_id: {}
                      connection_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: 58cc35f4-faef-4107-8e09-d18d60121d38
                          name:
                            type: string
                            example: Connection name
                      response_code:
                        type: string
                        example: SUCCEEDED
                      response_message:
                        type: string
                        example: Transaction successful
                      payment:
                        type: object
                        properties:
                          id:
                            type: string
                            example: 637dffe9-5d18-4cdc-a5bf-95b8cd12bbd5
                          account_id:
                            type: string
                            example: ''
                          description:
                            type: string
                            example: SUCCESSFUL
                          country:
                            type: string
                            example: US
                          status:
                            type: string
                            example: SUCCEEDED
                          sub_status:
                            type: string
                            example: CAPTURED
                          merchant_order_id:
                            type: string
                            example: Order_id
                          created_at:
                            type: string
                            example: '2023-04-27T02:51:24.470834Z'
                          updated_at:
                            type: string
                            example: '2023-04-27T02:51:52.312297Z'
                          amount:
                            type: object
                            properties:
                              value:
                                type: integer
                                example: 20000
                                default: 0
                              captured:
                                type: integer
                                example: 20000
                                default: 0
                              authorized:
                                type: number
                                description: >-
                                  服务提供商已批准的金额（0.0001 的倍数），扣除任何 Yuno 促销（`value`
                                  减去
                                  `discount_amount`），并加上已批准的增量授权。在全额批准时，或服务提供商未返回已批准金额时，它等于该净额。对于发送了
                                  `payment_method.detail.card.partial_approval:
                                  true` 的卡支付，部分批准后支付仍保持全额批准的状态，因此当 `authorized`
                                  小于 `value` 减去 `discount_amount`（无促销时，小于
                                  `value`）时，即为部分批准。对于未获批准的支付，或在引入此字段之前创建的支付，不会返回此字段。
                                example: 20000
                              refunded:
                                type: integer
                                example: 0
                                default: 0
                              currency:
                                type: string
                                example: USD
                          discount_amount:
                            type: object
                            description: >-
                              应用于支付的 Yuno 促销的总折扣：即
                              `additional_data.order.discounts` 中
                              `YUNO_PROMOTION` 行的总和。未应用促销时不存在。实际扣款金额为
                              `amount.value` 减去此值，见 `transactions.amount`。请参阅
                              [Promotions](/zh-hans/docs/payment-features/promotions)。
                            properties:
                              currency:
                                type: string
                                description: 折扣的货币，与 `amount.currency` 相同。
                              value:
                                type: number
                                description: 折扣。
                          additional_data:
                            type: object
                            properties:
                              airline:
                                type: object
                                properties:
                                  pnr:
                                    type: string
                                    example: ABC123
                                  legs:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        departure_airport:
                                          type: string
                                          example: BOG
                                        departure_datetime:
                                          type: string
                                          example: '2023-10-31T01:30:00.000-05:00'
                                        departure_airport_timezone:
                                          type: string
                                          example: GMT-05
                                        arrival_airport:
                                          type: string
                                          example: BOM
                                        carrier_code:
                                          type: string
                                          example: PR
                                        carrier_name:
                                          type: string
                                          example: Philippine Airlines
                                        flight_number:
                                          type: string
                                          example: AV348
                                        fare_basis_code:
                                          type: string
                                          example: 'Y'
                                        fare_class_code:
                                          type: string
                                          example: S
                                        base_fare:
                                          type: integer
                                          example: 18000
                                          default: 0
                                        base_fare_currency:
                                          type: string
                                          example: USD
                                        stopover_code:
                                          type: string
                                          example: O
                                  passengers:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        first_name:
                                          type: string
                                          example: JOHN
                                        last_name:
                                          type: string
                                          example: DOE
                                        middle_name:
                                          type: string
                                          example: STEPHEN
                                        type:
                                          type: string
                                          example: A
                                        date_of_birth:
                                          type: string
                                          example: '1998-01-01'
                                        nationality:
                                          type: string
                                          example: US
                                        document:
                                          type: object
                                          properties:
                                            document_type:
                                              type: string
                                              example: SSN
                                            document_number:
                                              type: string
                                              example: 123-45-6789
                                        country: {}
                                        loyalty_number:
                                          type: string
                                          example: '79250001'
                                        loyalty_tier:
                                          type: string
                                          example: DIAMOND
                                  tickets:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        ticket_number:
                                          type: string
                                          example: BRB0001
                                        e_ticket:
                                          type: boolean
                                          example: true
                                          default: true
                                        restricted:
                                          type: boolean
                                          example: false
                                          default: true
                                        total_fare_amount:
                                          type: integer
                                          example: 20000
                                          default: 0
                                        total_tax_amount:
                                          type: integer
                                          example: 18000
                                          default: 0
                                        total_fee_amount:
                                          type: integer
                                          example: 1000
                                          default: 0
                                        issue:
                                          type: object
                                          properties:
                                            carrier_prefix_code:
                                              type: string
                                              example: '134'
                                            travel_agent_code:
                                              type: string
                                              example: A104121
                                            travel_agent_name:
                                              type: string
                                              example: AEROVIAJES
                                            date:
                                              type: string
                                              example: '2023-10-31T01:30:00.000-05:00'
                                            address:
                                              type: string
                                              example: 123 Main Street
                                            city:
                                              type: string
                                              example: New York
                                            country:
                                              type: string
                                              example: US
                                            zip_code:
                                              type: string
                                              example: '10001'
                              order: {}
                              seller_details: {}
                  - title: 部分捕获
                    type: object
                    properties:
                      id:
                        type: string
                        example: c8104f4b-30d6-476f-8e6b-49daa110e31f
                      type:
                        type: string
                        example: CAPTURE
                      status:
                        type: string
                        example: SUCCEEDED
                      category:
                        type: string
                        example: CARD
                      amount:
                        type: object
                        properties:
                          captured:
                            type: integer
                            example: 0
                            default: 0
                          currency:
                            type: string
                            example: USD
                          refunded:
                            type: integer
                            example: 0
                            default: 0
                          value:
                            type: integer
                            example: 3000
                            default: 0
                      merchant_reference:
                        type: string
                        example: AAB01-432245
                      created_at:
                        type: string
                        example: '2024-06-06T14:27:53.594183Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T14:27:53.705858Z'
                      provider_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO_TEST_PAYMENT_GW
                          transaction_id:
                            type: string
                            example: a9a47e01-2dc1-4d5f-af23-11ab7164cd03
                          account_id:
                            type: string
                            example: 493e9374-510a-4201-9e09-de669d75f256
                          status:
                            type: string
                            example: SUCCEEDED
                          status_detail:
                            type: string
                            example: ''
                          response_message:
                            type: string
                            example: Transaction successful
                          response_code:
                            type: string
                            example: ''
                          iso8583_response_code:
                            type: string
                            example: '00'
                          iso8583_response_message:
                            type: string
                            example: Approved or completed successfully
                          raw_request:
                            type: object
                            description: Yuno 发送给服务提供商的请求的混淆副本。仅对列入允许名单的组织返回。
                          raw_response: {}
                          third_party_transaction_id: {}
                          third_party_account_id: {}
                      connection_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: 58cc35f4-faef-4107-8e09-d18d60121d38
                          name:
                            type: string
                            example: Connection name
                      response_code:
                        type: string
                        example: SUCCEEDED
                      response_message:
                        type: string
                        example: Transaction successful
                      payment:
                        type: object
                        properties:
                          id:
                            type: string
                            example: 60915b59-e403-4c00-8404-15ececa9b5dd
                          account_id:
                            type: string
                            example: ''
                          description:
                            type: string
                            example: Test
                          country:
                            type: string
                            example: US
                          status:
                            type: string
                            example: SUCCEEDED
                          sub_status:
                            type: string
                            example: PARTIALLY_CAPTURED
                          merchant_order_id:
                            type: string
                            example: '0000023'
                          created_at:
                            type: string
                            example: '2024-06-06T14:27:22.8355Z'
                          updated_at:
                            type: string
                            example: '2024-06-06T14:27:53.74127Z'
                          amount:
                            type: object
                            properties:
                              captured:
                                type: integer
                                example: 3000
                                default: 0
                              authorized:
                                type: number
                                description: >-
                                  服务提供商已批准的金额（0.0001 的倍数），扣除任何 Yuno 促销（`value`
                                  减去
                                  `discount_amount`），并加上已批准的增量授权。在全额批准时，或服务提供商未返回已批准金额时，它等于该净额。对于发送了
                                  `payment_method.detail.card.partial_approval:
                                  true` 的卡支付，部分批准后支付仍保持全额批准的状态，因此当 `authorized`
                                  小于 `value` 减去 `discount_amount`（无促销时，小于
                                  `value`）时，即为部分批准。对于未获批准的支付，或在引入此字段之前创建的支付，不会返回此字段。
                                example: 30000
                              currency:
                                type: string
                                example: USD
                              refunded:
                                type: integer
                                example: 0
                                default: 0
                              value:
                                type: integer
                                example: 30000
                                default: 0
                          discount_amount:
                            type: object
                            description: >-
                              应用于支付的 Yuno 促销的总折扣：即
                              `additional_data.order.discounts` 中
                              `YUNO_PROMOTION` 行的总和。未应用促销时不存在。实际扣款金额为
                              `amount.value` 减去此值，见 `transactions.amount`。请参阅
                              [Promotions](/zh-hans/docs/payment-features/promotions)。
                            properties:
                              currency:
                                type: string
                                description: 折扣的货币，与 `amount.currency` 相同。
                              value:
                                type: number
                                description: 折扣。
                          additional_data:
                            type: object
                            properties:
                              airline: {}
                              order: {}
                              seller_details: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
                Invalid status:
                  summary: >-
                    The payment is already in a final state (for example,
                    already captured)
                  value:
                    code: INVALID_STATUS
                    messages:
                      - Invalid transaction status.
                Amount above the authorized amount:
                  summary: >-
                    The payment was partially approved and the capture exceeds
                    `amount.authorized`
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - Amount to capture exceeds the authorized amount.
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_REQUEST
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid request
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    code: INVALID_CREDENTIALS
                    messages:
                      - Invalid credentials
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_CREDENTIALS
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid credentials
        '403':
          description: '403'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: AUTHORIZATION_REQUIRED
                    messages:
                      - The merchant has no authorization to use this API.
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: AUTHORIZATION_REQUIRED
                  messages:
                    type: array
                    items:
                      type: string
                      example: The merchant has no authorization to use this API.
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      x-default: <Your public-api-key>
      name: public-api-key
    sec1:
      type: apiKey
      in: header
      x-default: <Your private-secret-key>
      name: private-secret-key
    sec2:
      type: apiKey
      in: header
      x-default: <Your X-Idempotency-Key>
      name: X-Idempotency-Key

````

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