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

# Cancel or Refund a Payment

<Warning>
  Do not execute a refund while another is in progress. Wait for the current operation to complete before starting a new one.
</Warning>

This service allows you to cancel or refund an existing payment. Our system will identify if a cancellation or a refund is necessary based on the payment, no `transaction_id` is needed in this case. This service performs the following functions based on the status of the transaction:

* **Cancels** the payment if it has not been captured.
* **Refunds** the payment if it has been captured.

<Note>
  **Refunds**

  If you fill out the amount field, the refund will be partial. Otherwise, it will create a complete refund. The funds will be refunded to the payment method that was originally charged.
</Note>

Note that this request requires an `X-Idempotency-Key`. Check the [Authentication](/reference/authentication#idempotency) page for more information.


## OpenAPI

````yaml openapi/payments/cancel-or-refund-a-payment.json POST /payments/{payment_id}/cancel-or-refund
openapi: 3.1.0
info:
  title: payment-api-refundcancel-payment
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
security:
  - sec0: []
    sec1: []
    sec2: []
paths:
  /payments/{payment_id}/cancel-or-refund:
    post:
      summary: Cancel or Refund a Payment
      operationId: cancel-or-refund-a-payment
      parameters:
        - name: payment_id
          in: path
          description: The unique identifier of the payment (UUID, 36 chars).
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  description: Description of the cancellation or refund. (MAX 255; MIN 3).
                reason:
                  type: string
                  description: >-
                    Indicating the reason for the cancellation or refund. If
                    set, possible values are `DUPLICATE`, `FRAUDULENT`,
                    `REQUESTED_BY_CUSTOMER`, and `REVERSE`. Use `REVERSE` to
                    request an automatic reverse of the recipient funds when a
                    recipient is involved in the transaction.
                  enum:
                    - DUPLICATE
                    - FRAUDULENT
                    - REQUESTED_BY_CUSTOMER
                    - REVERSE
                merchant_reference:
                  type: string
                  description: >-
                    Identification of the payment transaction defined by the
                    merchant. If no merchant_reference is defined, the
                    merchant_order_id of the payment will be associated to the
                    transaction. (MAX 255; MIN 3).
                amount:
                  type: object
                  description: Specifies the amount object for refund.
                  properties:
                    currency:
                      type: string
                      description: >-
                        The currency used to make the payment. For a full list
                        of currency codes, see [Country
                        reference](/reference/country-reference) (MAX 3; MIN 3;
                        ISO 4217).
                    value:
                      type: number
                      format: float
                      description: The payment amount (multiple of 0.0001).
                split_marketplace:
                  type: array
                  description: Split marketplace array of objects
                  items:
                    properties:
                      recipient_id:
                        type: string
                        description: >-
                          The unique identifier of the recipient in the Yuno
                          system. <br/> You must provide the
                          [`recipient_id`](/reference/create-recipient-1)
                          (Yuno-generated) or the `provider_recipient_id`
                          (external provider's ID) when creating a payment.
                      provider_recipient_id:
                        type: string
                        description: >-
                          The recipient ID provided by the external payment
                          provider, if applicable. <br/> You must provide the
                          `provider_recipient_id` or the
                          [`recipient_id`](/reference/create-recipients)
                          (Yuno-generated) when creating a payment.
                      description:
                        type: string
                        description: Description for the split. (MAX 255; MIN 3).
                      type:
                        type: string
                        description: >-
                          The type of split. `recipient_id` is mandatory for
                          `PURCHASE` and `MARKETPLACE`.
                        enum:
                          - PURCHASE
                          - PAYMENTFEE
                          - VAT
                          - COMMISSION
                          - MARKETPLACE
                          - SHIPPING
                      merchant_reference:
                        type: string
                        description: >-
                          Optional unique identifier for the split transaction
                          (MAX 255; MIN 3).
                      recipient_type:
                        type: string
                        description: The type of recipient for the provider.
                        enum:
                          - MEAL
                          - FOOD
                          - MULTI_BENEFITS
                          - FLEET
                        example: MEAL
                      amount:
                        type: object
                        description: Defines the amount of the split.
                        required:
                          - value
                          - currency
                        properties:
                          value:
                            type: number
                            description: The split amount (multiple of 0.0001).
                            format: float
                          currency:
                            type: string
                            description: >-
                              The currency used to make the payment. For a full
                              list of currency codes, see [Country
                              reference](/reference/country-reference) (MAX 3;
                              MIN 3; ISO 4217).
                      liability:
                        type: object
                        description: >-
                          Optional information regarding the recipient's
                          liability for fees and chargebacks.
                        properties:
                          processing_fee:
                            type: string
                            description: Indicates who will be charged the transaction fee.
                            enum:
                              - MERCHANT
                              - RECIPIENT
                              - SHARED
                          chargebacks:
                            type: boolean
                            description: >-
                              The recipient is responsible in case of a
                              chargeback.
                    required:
                      - type
                    type: object
                simplified_mode:
                  type: boolean
                  description: >-
                    Indicates if we should try to refund a payment after an
                    error/declined on the first try. It is `false` by default.
                    For more information, access the
                    [guide](transaction-retries).
                  default: false
                response_additional_data:
                  type: object
                  description: >-
                    Specifies additional data for required the transaction
                    response
                  properties:
                    receipt:
                      type: boolean
                      description: >-
                        Indicates if a receipt is necessary for the transaction
                        response
                    receipt_language:
                      type: string
                      description: Indicates the language of the receipt to be generated
                      enum:
                        - ES
                        - EN
                        - PT
                customer_payer:
                  type: object
                  description: Specifies customer object for payments.
                  properties:
                    first_name:
                      type: string
                      description: The customer's first name (MAX 255; MIN 3).
                    last_name:
                      type: string
                      description: The customer's last name (MAX 255; MIN 3).
                    gender:
                      type: string
                      description: >-
                        The customer's gender (MAX 2; MIN 1). <br/>- M=Male
                        <br/>- F=Female <br/>- NB=Non Binary <br/>- NA=Not
                        applicable <br/>- NK=Not Known <br/>- U=Undefined.
                      enum:
                        - M
                        - F
                        - NB
                        - NA
                        - NK
                        - U
                    date_of_birth:
                      type: string
                      description: >-
                        The customer's date of birth in the `YYYY-MM-DD` format
                        (Length: 10).
                    email:
                      type: string
                      description: The customer's e-mail (MAX 255; MIN 3).
                    nationality:
                      type: string
                      description: >-
                        The customer's nationality (MAX 2; MIN 2; [ISO
                        3166-1](/reference/country-reference)).
                    document:
                      type: object
                      description: >-
                        Specifies the customer's document object, including its
                        number and type.
                      properties:
                        document_number:
                          type: string
                          description: Document number for customer (MAX 40; MIN 3)
                        document_type:
                          type: string
                          description: >-
                            The customer's document type (MAX 6, MIN 2). Access
                            [Document Type List](/reference/country-reference)
                            for more details.
                          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: Specifies the customer's phone object.
                      properties:
                        country_code:
                          type: string
                          description: >-
                            The country code of the customer's phone (MAX 3; MIN
                            1).
                        number:
                          type: string
                          description: >-
                            The customer's phone number, without the country
                            code (MAX 32; MIN 1).
                    billing_address:
                      type: object
                      description: Specifies the customer's billing address object.
                      properties:
                        address_line_1:
                          type: string
                          description: >-
                            The primary billing address line of the customer
                            (MAX 255; MIN 3).
                        address_line_2:
                          type: string
                          description: >-
                            The secondary billing address line of the customer
                            (MAX 255; MIN 3).
                        city:
                          type: string
                          description: >-
                            The city considered for the billing address (MAX
                            255; MIN 3).
                        country:
                          type: string
                          description: >-
                            The country considered for the billing address (MAX
                            2; MIN 2; [ISO
                            3166-1](https://docs.y.uno/reference/customer-object#country-code-list-iso-3166-1)).
                          enum:
                            - AR
                            - BO
                            - BR
                            - CL
                            - CO
                            - CR
                            - EC
                            - SV
                            - GT
                            - HN
                            - MX
                            - NI
                            - PA
                            - PY
                            - PE
                            - US
                            - UY
                        state:
                          type: string
                          description: >-
                            The state considered for the billing address (MAX
                            255; MIN 3).
                        zip_code:
                          type: string
                          description: >-
                            The zipcode considered for the billing address (MAX
                            10; MIN 5).
                    shipping_address:
                      type: object
                      description: Specifies the customer's shipping address object.
                      properties:
                        address_line_1:
                          type: string
                          description: >-
                            The primary shipping address line of the customer
                            (MAX 255; MIN 3).
                        address_line_2:
                          type: string
                          description: >-
                            The secondary shipping address line of the customer
                            (MAX 255; MIN 3).
                        city:
                          type: string
                          description: >-
                            The city considered for the shipping address (MAX
                            255; MIN 3).
                        country:
                          type: string
                          description: >-
                            The country considered for the shipping address (MAX
                            2; MIN 2; [ISO
                            3166-1](https://docs.y.uno/reference/customer-object#country-code-list-iso-3166-1)).
                          enum:
                            - AR
                            - BO
                            - BR
                            - CL
                            - CO
                            - CR
                            - EC
                            - SV
                            - GT
                            - HN
                            - MX
                            - NI
                            - PA
                            - PY
                            - PE
                            - US
                            - UY
                        state:
                          type: string
                          description: >-
                            The state considered for the shipping address (MAX
                            255; MIN 3).
                        zip_code:
                          type: string
                          description: >-
                            The zipcode considered for the shipping address (MAX
                            10; MIN 5).
                payment_method:
                  type: object
                  description: Specifies payment method object for payments.
                  properties:
                    detail:
                      type: object
                      description: Specifies the payment method detail object.
                      properties:
                        bank_transfer:
                          type: object
                          description: Specifies bank transfer payment method details.
                          properties:
                            account_type:
                              type: string
                              description: Type of bank account (MAX 255; MIN 3)
                              enum:
                                - CHECKINGS
                                - SAVINGS
                            bank_name:
                              type: string
                              description: Name of the bank (MAX 255; MIN 3)
                            bank_id:
                              type: string
                              description: ID of the bank (MAX 255; MIN 3)
                            beneficiary_name:
                              type: string
                              description: Name of the account holder (MAX 255; MIN 3)
                            bank_account:
                              type: string
                              description: Bank account number (MAX 255; MIN 3)
                            beneficiary_document_type:
                              type: string
                              description: >-
                                Document type of the account holder (MAX 255;
                                MIN 3)
                            beneficiary_document:
                              type: string
                              description: >-
                                Document number of the account holder (MAX 255;
                                MIN 3)
                            reference:
                              type: string
                              description: Reference code for the user (MAX 255; MIN 1)
              required:
                - reason
            examples:
              Full Refund:
                value:
                  description: Duplicate
                  reason: REQUESTED_BY_CUSTOMER
                  merchant_reference: AAB01-432245
              Partial Refund:
                value:
                  amount:
                    currency: COP
                    value: 500
                  description: Duplicate
                  reason: REQUESTED_BY_CUSTOMER
                  merchant_reference: AAB01-432245
              Cancel:
                value:
                  description: Duplicate
                  reason: REQUESTED_BY_CUSTOMER
                  merchant_reference: AAB01-432245
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Full Refund:
                  value:
                    id: 7fd485f3-bd72-45eb-a3fb-774daa3d79b6
                    type: REFUND
                    status: REFUNDED
                    category: CARD
                    amount:
                      captured: 0
                      currency: USD
                      refunded: 0
                      value: 30000
                    merchant_reference: '0000023'
                    created_at: '2024-06-06T14:06:06.284443Z'
                    updated_at: '2024-06-06T14:06:37.984065Z'
                    provider_data:
                      id: YUNO_TEST_PAYMENT_GW
                      transaction_id: ''
                      account_id: 493e9374-510a-4201-9e09-de669d75f256
                      status: ''
                      status_detail: ''
                      response_message: null
                      response_code: SUCCEEDED
                      iso8583_response_code: '00'
                      iso8583_response_message: Approved or completed successfully
                      raw_response: null
                      third_party_transaction_id: null
                      third_party_account_id: null
                    response_code: SUCCEEDED
                    response_message: Transaction successful
                    payment:
                      id: c3583c27-0478-4e02-8827-4d8f2121c670
                      account_id: ''
                      description: Test Bank of America
                      country: US
                      status: REFUNDED
                      sub_status: REFUNDED
                      merchant_order_id: '0000023'
                      created_at: '2024-06-06T14:06:06.284443Z'
                      updated_at: '2024-06-06T14:06:06.284443Z'
                      amount:
                        captured: 0
                        currency: USD
                        refunded: 30000
                        value: 30000
                      additional_data:
                        airline:
                          pnr: 1P-2UUGJW
                          legs:
                            - departure_airport: EWR
                              departure_datetime: '2014-05-12 13:05:00'
                              departure_airport_timezone: '-05:00'
                              arrival_airport: SFO
                              arrival_airport_timezone: '-08:00'
                              arrival_datetime: ''
                              carrier_code: UA
                              flight_number: '842'
                              fare_basis_code: HL7LNR
                              fare_class_code: FR
                              base_fare: 200
                              base_fare_currency: USD
                              stopover_code: s
                          passengers:
                            - first_name: John
                              last_name: Doe
                              middle_name: A
                              type: adult
                              date_of_birth: '1980-01-01'
                              nationality: US
                              document:
                                document_type: SSN
                                document_number: 123-45-6789
                              country: US
                              loyalty_number: UA123456
                              loyalty_tier: Gold
                              email: johndoe@example.com
                              phone: '+15555555555'
                          ticket: null
                          tickets:
                            - ticket_number: '123456'
                              e_ticket: false
                              restricted: false
                              total_fare_amount: 80
                              total_tax_amount: 22
                              total_fee_amount: 14
                              issue: null
                        order:
                          fee_amount: 100
                          shipping_amount: 100
                          tip_amount: null
                          items:
                            - id: 123AD
                              name: Skirt
                              quantity: 1
                              unit_amount: 29800
                              category: Clothes
                              brand: XYZ
                              sku_code: '8765432109'
                              manufacture_part_number: XYZ123456
                        seller_details: null
                Partial Refund:
                  value:
                    id: e44cdc8e-01e7-4767-a1b6-3a646a609dc5
                    type: REFUND
                    status: SUCCEEDED
                    category: CARD
                    amount:
                      captured: 0
                      currency: USD
                      refunded: 0
                      value: 30000
                    merchant_reference: '0000023'
                    created_at: '2024-06-06T14:07:53.881239Z'
                    updated_at: '2024-06-06T14:08:17.438878Z'
                    provider_data:
                      id: YUNO_TEST_PAYMENT_GW
                      transaction_id: ''
                      account_id: 493e9374-510a-4201-9e09-de669d75f256
                      status: ''
                      sub_status: ''
                      status_detail: ''
                      response_message: null
                      response_code: SUCCEEDED
                      iso8583_response_code: '00'
                      iso8583_response_message: Approved or completed successfully
                      raw_response: null
                      third_party_transaction_id: null
                      third_party_account_id: null
                    response_code: SUCCEEDED
                    response_message: Transaction successful
                    payment:
                      id: eee7daeb-5ed7-41bd-8fee-7a440ca2ab86
                      account_id: ''
                      description: Test
                      country: US
                      status: SUCCEEDED
                      sub_status: PARTIALLY_REFUNDED
                      merchant_order_id: '0000023'
                      created_at: '2024-06-06T14:07:53.881239Z'
                      updated_at: '2024-06-06T14:07:53.881239Z'
                      amount:
                        captured: 0
                        currency: USD
                        refunded: 1000
                        value: 30000
                      additional_data:
                        airline:
                          pnr: 1P-2UUGJW
                          legs:
                            - departure_airport: EZE
                              departure_datetime: '2014-05-12 13:05:00'
                              departure_airport_timezone: '-03:00'
                              arrival_airport: AMS
                              arrival_airport_timezone: '+00:00'
                              arrival_datetime: ''
                              carrier_code: KL
                              flight_number: '842'
                              fare_basis_code: HL7LNR
                              fare_class_code: FR
                              base_fare: 200
                              base_fare_currency: USD
                              stopover_code: s
                          passengers:
                            - first_name: John
                              last_name: Doe
                              middle_name: A.
                              type: adult
                              date_of_birth: '1980-01-01'
                              nationality: US
                              document:
                                document_type: SSN
                                document_number: 123-45-6789
                              country: US
                              loyalty_number: JD123456
                              loyalty_tier: Gold
                              email: johndoe@example.com
                              phone: '5551234567'
                          ticket: null
                          tickets:
                            - ticket_number: '123456'
                              e_ticket: false
                              restricted: false
                              total_fare_amount: 80
                              total_tax_amount: 22
                              total_fee_amount: 14
                              issue: null
                        order:
                          fee_amount: 100
                          shipping_amount: 100
                          tip_amount: null
                          items:
                            - id: 123AD
                              name: Skirt
                              quantity: 1
                              unit_amount: 29800
                              category: Clothes
                              brand: XYZ
                              sku_code: '8765432109'
                              manufacture_part_number: XYZ123456
                        seller_details: null
                Cancel:
                  value:
                    id: 2fbc6db6-718b-4554-b03f-826e552f1b9f
                    type: CANCEL
                    status: SUCCEEDED
                    category: CARD
                    amount:
                      captured: 0
                      currency: USD
                      refunded: 0
                      value: 30000
                    merchant_reference: ''
                    created_at: '2024-06-06T14:05:31.651012Z'
                    updated_at: '2024-06-06T14:05:31.742355Z'
                    provider_data:
                      id: YUNO_TEST_PAYMENT_GW
                      transaction_id: ''
                      account_id: ''
                      status: SUCCEEDED
                      sub_status: ''
                      status_detail: SUCCEEDED
                      response_message: null
                      response_code: SUCCEEDED
                      iso8583_response_code: '00'
                      iso8583_response_message: Approved or completed successfully
                      raw_response: null
                      third_party_transaction_id: null
                      third_party_account_id: null
                    response_code: SUCCEEDED
                    response_message: Transaction successful
                    payment:
                      id: cddba02c-e47d-4330-9cac-afcd9c0194b1
                      account_id: ''
                      description: Test
                      country: US
                      status: CANCELED
                      sub_status: CANCELED
                      merchant_order_id: '0000023'
                      created_at: '2024-06-06T14:04:44.768364Z'
                      updated_at: '2024-06-06T14:05:31.79539Z'
                      amount:
                        captured: 0
                        currency: USD
                        refunded: 0
                        value: 30000
              schema:
                oneOf:
                  - title: Full Refund
                    type: object
                    properties:
                      id:
                        type: string
                        example: 7fd485f3-bd72-45eb-a3fb-774daa3d79b6
                      type:
                        type: string
                        example: REFUND
                      status:
                        type: string
                        example: REFUNDED
                      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: '0000023'
                      created_at:
                        type: string
                        example: '2024-06-06T14:06:06.284443Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T14:06:37.984065Z'
                      provider_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO_TEST_PAYMENT_GW
                          transaction_id:
                            type: string
                            example: ''
                          account_id:
                            type: string
                            example: 493e9374-510a-4201-9e09-de669d75f256
                          status:
                            type: string
                            example: ''
                          status_detail:
                            type: string
                            example: ''
                          response_message: {}
                          response_code:
                            type: string
                            example: SUCCEEDED
                          iso8583_response_code:
                            type: string
                            example: '00'
                          iso8583_response_message:
                            type: string
                            example: Approved or completed successfully
                          raw_response: {}
                          third_party_transaction_id: {}
                          third_party_account_id: {}
                      response_code:
                        type: string
                        example: SUCCEEDED
                      response_message:
                        type: string
                        example: Transaction successful
                      payment:
                        type: object
                        properties:
                          id:
                            type: string
                            example: c3583c27-0478-4e02-8827-4d8f2121c670
                          account_id:
                            type: string
                            example: ''
                          description:
                            type: string
                            example: Test Bank of America
                          country:
                            type: string
                            example: US
                          status:
                            type: string
                            example: REFUNDED
                          sub_status:
                            type: string
                            example: REFUNDED
                          merchant_order_id:
                            type: string
                            example: '0000023'
                          created_at:
                            type: string
                            example: '2024-06-06T14:06:06.284443Z'
                          updated_at:
                            type: string
                            example: '2024-06-06T14:06:06.284443Z'
                          amount:
                            type: object
                            properties:
                              captured:
                                type: integer
                                example: 0
                                default: 0
                              currency:
                                type: string
                                example: USD
                              refunded:
                                type: integer
                                example: 30000
                                default: 0
                              value:
                                type: integer
                                example: 30000
                                default: 0
                          additional_data:
                            type: object
                            properties:
                              airline:
                                type: object
                                properties:
                                  pnr:
                                    type: string
                                    example: 1P-2UUGJW
                                  legs:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        departure_airport:
                                          type: string
                                          example: EWR
                                        departure_datetime:
                                          type: string
                                          example: '2014-05-12 13:05:00'
                                        departure_airport_timezone:
                                          type: string
                                          example: '-05:00'
                                        arrival_airport:
                                          type: string
                                          example: SFO
                                        arrival_airport_timezone:
                                          type: string
                                          example: '-08:00'
                                        arrival_datetime:
                                          type: string
                                          example: ''
                                        carrier_code:
                                          type: string
                                          example: UA
                                        flight_number:
                                          type: string
                                          example: '842'
                                        fare_basis_code:
                                          type: string
                                          example: HL7LNR
                                        fare_class_code:
                                          type: string
                                          example: FR
                                        base_fare:
                                          type: integer
                                          example: 200
                                          default: 0
                                        base_fare_currency:
                                          type: string
                                          example: USD
                                        stopover_code:
                                          type: string
                                          example: s
                                  passengers:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        first_name:
                                          type: string
                                          example: John
                                        last_name:
                                          type: string
                                          example: Doe
                                        middle_name:
                                          type: string
                                          example: A
                                        type:
                                          type: string
                                          example: adult
                                        date_of_birth:
                                          type: string
                                          example: '1980-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:
                                          type: string
                                          example: US
                                        loyalty_number:
                                          type: string
                                          example: UA123456
                                        loyalty_tier:
                                          type: string
                                          example: Gold
                                        email:
                                          type: string
                                          example: johndoe@example.com
                                        phone:
                                          type: string
                                          example: '+15555555555'
                                  ticket: {}
                                  tickets:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        ticket_number:
                                          type: string
                                          example: '123456'
                                        e_ticket:
                                          type: boolean
                                          example: false
                                          default: true
                                        restricted:
                                          type: boolean
                                          example: false
                                          default: true
                                        total_fare_amount:
                                          type: integer
                                          example: 80
                                          default: 0
                                        total_tax_amount:
                                          type: integer
                                          example: 22
                                          default: 0
                                        total_fee_amount:
                                          type: integer
                                          example: 14
                                          default: 0
                                        issue: {}
                              order:
                                type: object
                                properties:
                                  fee_amount:
                                    type: integer
                                    example: 100
                                    default: 0
                                  shipping_amount:
                                    type: integer
                                    example: 100
                                    default: 0
                                  tip_amount: {}
                                  items:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          example: 123AD
                                        name:
                                          type: string
                                          example: Skirt
                                        quantity:
                                          type: integer
                                          example: 1
                                          default: 0
                                        unit_amount:
                                          type: integer
                                          example: 29800
                                          default: 0
                                        category:
                                          type: string
                                          example: Clothes
                                        brand:
                                          type: string
                                          example: XYZ
                                        sku_code:
                                          type: string
                                          example: '8765432109'
                                        manufacture_part_number:
                                          type: string
                                          example: XYZ123456
                              seller_details: {}
                  - title: Partial Refund
                    type: object
                    properties:
                      id:
                        type: string
                        example: e44cdc8e-01e7-4767-a1b6-3a646a609dc5
                      type:
                        type: string
                        example: REFUND
                      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: '0000023'
                      created_at:
                        type: string
                        example: '2024-06-06T14:07:53.881239Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T14:08:17.438878Z'
                      provider_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO_TEST_PAYMENT_GW
                          transaction_id:
                            type: string
                            example: ''
                          account_id:
                            type: string
                            example: 493e9374-510a-4201-9e09-de669d75f256
                          status:
                            type: string
                            example: ''
                          sub_status:
                            type: string
                            example: ''
                          status_detail:
                            type: string
                            example: ''
                          response_message: {}
                          response_code:
                            type: string
                            example: SUCCEEDED
                          iso8583_response_code:
                            type: string
                            example: '00'
                          iso8583_response_message:
                            type: string
                            example: Approved or completed successfully
                          raw_response: {}
                          third_party_transaction_id: {}
                          third_party_account_id: {}
                      response_code:
                        type: string
                        example: SUCCEEDED
                      response_message:
                        type: string
                        example: Transaction successful
                      payment:
                        type: object
                        properties:
                          id:
                            type: string
                            example: eee7daeb-5ed7-41bd-8fee-7a440ca2ab86
                          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_REFUNDED
                          merchant_order_id:
                            type: string
                            example: '0000023'
                          created_at:
                            type: string
                            example: '2024-06-06T14:07:53.881239Z'
                          updated_at:
                            type: string
                            example: '2024-06-06T14:07:53.881239Z'
                          amount:
                            type: object
                            properties:
                              captured:
                                type: integer
                                example: 0
                                default: 0
                              currency:
                                type: string
                                example: USD
                              refunded:
                                type: integer
                                example: 1000
                                default: 0
                              value:
                                type: integer
                                example: 30000
                                default: 0
                          additional_data:
                            type: object
                            properties:
                              airline:
                                type: object
                                properties:
                                  pnr:
                                    type: string
                                    example: 1P-2UUGJW
                                  legs:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        departure_airport:
                                          type: string
                                          example: EZE
                                        departure_datetime:
                                          type: string
                                          example: '2014-05-12 13:05:00'
                                        departure_airport_timezone:
                                          type: string
                                          example: '-03:00'
                                        arrival_airport:
                                          type: string
                                          example: AMS
                                        arrival_airport_timezone:
                                          type: string
                                          example: '+00:00'
                                        arrival_datetime:
                                          type: string
                                          example: ''
                                        carrier_code:
                                          type: string
                                          example: KL
                                        flight_number:
                                          type: string
                                          example: '842'
                                        fare_basis_code:
                                          type: string
                                          example: HL7LNR
                                        fare_class_code:
                                          type: string
                                          example: FR
                                        base_fare:
                                          type: integer
                                          example: 200
                                          default: 0
                                        base_fare_currency:
                                          type: string
                                          example: USD
                                        stopover_code:
                                          type: string
                                          example: s
                                  passengers:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        first_name:
                                          type: string
                                          example: John
                                        last_name:
                                          type: string
                                          example: Doe
                                        middle_name:
                                          type: string
                                          example: A.
                                        type:
                                          type: string
                                          example: adult
                                        date_of_birth:
                                          type: string
                                          example: '1980-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:
                                          type: string
                                          example: US
                                        loyalty_number:
                                          type: string
                                          example: JD123456
                                        loyalty_tier:
                                          type: string
                                          example: Gold
                                        email:
                                          type: string
                                          example: johndoe@example.com
                                        phone:
                                          type: string
                                          example: '5551234567'
                                  ticket: {}
                                  tickets:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        ticket_number:
                                          type: string
                                          example: '123456'
                                        e_ticket:
                                          type: boolean
                                          example: false
                                          default: true
                                        restricted:
                                          type: boolean
                                          example: false
                                          default: true
                                        total_fare_amount:
                                          type: integer
                                          example: 80
                                          default: 0
                                        total_tax_amount:
                                          type: integer
                                          example: 22
                                          default: 0
                                        total_fee_amount:
                                          type: integer
                                          example: 14
                                          default: 0
                                        issue: {}
                              order:
                                type: object
                                properties:
                                  fee_amount:
                                    type: integer
                                    example: 100
                                    default: 0
                                  shipping_amount:
                                    type: integer
                                    example: 100
                                    default: 0
                                  tip_amount: {}
                                  items:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          example: 123AD
                                        name:
                                          type: string
                                          example: Skirt
                                        quantity:
                                          type: integer
                                          example: 1
                                          default: 0
                                        unit_amount:
                                          type: integer
                                          example: 29800
                                          default: 0
                                        category:
                                          type: string
                                          example: Clothes
                                        brand:
                                          type: string
                                          example: XYZ
                                        sku_code:
                                          type: string
                                          example: '8765432109'
                                        manufacture_part_number:
                                          type: string
                                          example: XYZ123456
                              seller_details: {}
                  - title: Cancel
                    type: object
                    properties:
                      id:
                        type: string
                        example: 2fbc6db6-718b-4554-b03f-826e552f1b9f
                      type:
                        type: string
                        example: CANCEL
                      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: ''
                      created_at:
                        type: string
                        example: '2024-06-06T14:05:31.651012Z'
                      updated_at:
                        type: string
                        example: '2024-06-06T14:05:31.742355Z'
                      provider_data:
                        type: object
                        properties:
                          id:
                            type: string
                            example: YUNO_TEST_PAYMENT_GW
                          transaction_id:
                            type: string
                            example: ''
                          account_id:
                            type: string
                            example: ''
                          status:
                            type: string
                            example: SUCCEEDED
                          sub_status:
                            type: string
                            example: ''
                          status_detail:
                            type: string
                            example: SUCCEEDED
                          response_message: {}
                          response_code:
                            type: string
                            example: SUCCEEDED
                          iso8583_response_code:
                            type: string
                            example: '00'
                          iso8583_response_message:
                            type: string
                            example: Approved or completed successfully
                          raw_response: {}
                          third_party_transaction_id: {}
                          third_party_account_id: {}
                      response_code:
                        type: string
                        example: SUCCEEDED
                      response_message:
                        type: string
                        example: Transaction successful
                      payment:
                        type: object
                        properties:
                          id:
                            type: string
                            example: cddba02c-e47d-4330-9cac-afcd9c0194b1
                          account_id:
                            type: string
                            example: ''
                          description:
                            type: string
                            example: Test
                          country:
                            type: string
                            example: US
                          status:
                            type: string
                            example: CANCELED
                          sub_status:
                            type: string
                            example: CANCELED
                          merchant_order_id:
                            type: string
                            example: '0000023'
                          created_at:
                            type: string
                            example: '2024-06-06T14:04:44.768364Z'
                          updated_at:
                            type: string
                            example: '2024-06-06T14:05:31.79539Z'
                          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
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Bad Request:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
              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:
                Forbidden:
                  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

````