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

# Refund a Payment

<Warning>
  The Authorization needs to be in the following format:

  `Authorization: Token <YOUR_API_KEY>`
</Warning>

Use this endpoint to refund a payment, either partially or in full.


## OpenAPI

````yaml POST /business/{business}/payments/{transaction_reference}/refunds
openapi: 3.0.3
info:
  title: Tonder
  description: Tonder API
  termsOfService: https://www.google.com/policies/terms/
  contact:
    email: hello@tonder.io
  version: v1
servers:
  - url: https://api-stage.tonder.io/api/v1
    description: Staging
  - url: https://api.tonder.io/api/v1
    description: Production
security: []
paths:
  /business/{business}/payments/{transaction_reference}/refunds:
    post:
      summary: Create a refund for a transaction.
      parameters:
        - in: path
          name: business
          description: The unique identifier of the business.
          required: true
          schema:
            type: string
        - in: path
          name: transaction_reference
          description: The unique reference of the transaction to be refunded.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  format: float
                  example: 10.5
                  description: The monetary value to be refunded.
              required:
                - amount
      responses:
        '200':
          description: Refund processed successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: The unique identifier of the refund transaction.
                      example: 17
                    provider:
                      type: string
                      description: The payment service provider for the transaction.
                      example: tonder
                    country:
                      type: string
                      description: The country associated with the refund.
                      example: N/A
                    currency_code:
                      type: string
                      description: The currency code used for the transaction.
                      example: MXN
                    created:
                      type: string
                      format: date-time
                      description: The timestamp when the refund was created.
                      example: '2024-06-28T08:15:24.600617-05:00'
                    modified:
                      type: string
                      format: date-time
                      description: The timestamp when the refund was last modified.
                      example: '2024-06-28T08:15:24.600654-05:00'
                    operation_date:
                      type: string
                      format: date-time
                      description: >-
                        The date and time when the refund operation was
                        performed.
                      example: '2024-06-28T13:15:23-05:00'
                    transaction_reference:
                      type: string
                      description: The reference identifier of the original transaction.
                      example: '16566015'
                    response:
                      type: object
                      description: The response details of the refund operation.
                      properties:
                        card_account:
                          type: object
                          description: >-
                            Details about the card account used in the
                            transaction.
                          properties:
                            issuing_country_code:
                              type: string
                              description: The country code of the card issuer.
                              example: IL
                            masked_pan:
                              type: string
                              description: >-
                                The masked primary account number (PAN) of the
                                card.
                              example: 458000...0059
                        customer:
                          type: object
                          description: Customer details associated with the transaction.
                          properties:
                            email:
                              type: string
                              description: The email address of the customer.
                              example: test@email.com
                        payment_data:
                          type: object
                          description: Details about the payment data.
                          properties:
                            id:
                              type: string
                              description: The unique identifier of the payment data.
                              example: '16563893'
                            remaining_amount:
                              type: number
                              format: float
                              description: The remaining amount after the refund.
                              example: 40
                        refund_data:
                          type: object
                          description: Details about the refund data.
                          properties:
                            amount:
                              type: number
                              format: float
                              description: The amount refunded.
                              example: 5
                            auth_code:
                              type: string
                              description: The authorization code for the refund.
                              example: gUuMXr
                            created:
                              type: string
                              format: date-time
                              description: The timestamp when the refund was created.
                              example: '2024-06-28T13:15:23Z'
                            currency:
                              type: string
                              description: The currency used for the refund.
                              example: MXN
                            id:
                              type: string
                              description: The unique identifier of the refund transaction.
                              example: '16566015'
                            is_3d:
                              type: boolean
                              description: >-
                                Indicates if the refund was processed through 3D
                                Secure.
                              example: false
                            status:
                              type: string
                              description: The status of the refund.
                              example: COMPLETED
                        payment_method:
                          type: string
                          description: The payment method used for the refund.
                          example: BANKCARD
                        merchant_order:
                          type: object
                          description: Details about the merchant order.
                          properties:
                            description:
                              type: string
                              description: A description of the merchant order.
                              example: Requested by the client
                            id:
                              type: string
                              description: The unique identifier of the merchant order.
                              example: TNDR-76b9de76-eeee-42e9-b4bf-255943831ee9
                    transaction_type:
                      type: string
                      description: The type of transaction (e.g., REFUND).
                      example: REFUND
                    status:
                      type: string
                      description: The status of the transaction.
                      example: Success
                    amount:
                      type: string
                      description: The amount refunded.
                      example: '5.0000'
                    related_transaction_reference:
                      type: string
                      description: The reference identifier of the related transaction.
                      example: '16563893'
                    reason:
                      type: string
                      nullable: true
                      description: The reason for the refund, if provided.
                      example: null
                    is_refunded:
                      type: boolean
                      nullable: true
                      description: Indicates if the transaction has been refunded.
                      example: null
                    is_disputed:
                      type: boolean
                      nullable: true
                      description: Indicates if the transaction is disputed.
                      example: null
                    number_of_payment_attempts:
                      type: integer
                      nullable: true
                      description: The number of payment attempts made for the transaction.
                      example: null
                    payment_method_old:
                      type: string
                      nullable: true
                      description: The previous payment method, if applicable.
                      example: null
                    is_card_international:
                      type: boolean
                      description: Indicates if the card used is international.
                      example: false
                    card_brand:
                      type: string
                      nullable: true
                      description: The brand of the card used.
                      example: null
                    number_of_installments:
                      type: integer
                      description: The number of installments for the transaction.
                      example: 1
                    incoming_request:
                      type: string
                      nullable: true
                      description: Details of the incoming request, if any.
                      example: null
                    metadata:
                      type: string
                      nullable: true
                      description: Additional metadata associated with the transaction.
                      example: null
                    tonder_intra_transaction_rate:
                      type: number
                      format: float
                      nullable: true
                      description: The intra-transaction rate for Tonder.
                      example: null
                    tonder_inter_transaction_rate:
                      type: number
                      format: float
                      nullable: true
                      description: The inter-transaction rate for Tonder.
                      example: null
                    tonder_transaction_fee:
                      type: number
                      format: float
                      nullable: true
                      description: The transaction fee charged by Tonder.
                      example: null
                    is_fees_computed:
                      type: boolean
                      description: Indicates if the fees have been computed.
                      example: false
                    fee_amount:
                      type: number
                      format: float
                      nullable: true
                      description: The fee amount charged.
                      example: null
                    net_amount:
                      type: number
                      format: float
                      nullable: true
                      description: The net amount after fees.
                      example: null
                    rolling_reserve_amount:
                      type: number
                      format: float
                      nullable: true
                      description: The rolling reserve amount, if any.
                      example: null
                    has_balance_transaction:
                      type: boolean
                      description: Indicates if there is a balance transaction.
                      example: false
                    business:
                      type: object
                      description: >-
                        Details about the business associated with the
                        transaction.
                      properties:
                        id:
                          type: integer
                          description: The unique identifier of the business.
                          example: 97
                        created:
                          type: string
                          format: date-time
                          description: The timestamp when the business was created.
                          example: '2024-02-13T13:34:54.796510-06:00'
                        modified:
                          type: string
                          format: date-time
                          description: The timestamp when the business was last modified.
                          example: '2024-06-26T19:12:49.988659-05:00'
                        name:
                          type: string
                          description: The name of the business.
                          example: Demo 7
                        web:
                          type: string
                          description: The website URL of the business.
                          example: www.google.com
                        logo:
                          type: string
                          description: The logo URL of the business.
                          example: >-
                            https://zplit-stage.s3.amazonaws.com/media/business_logos/Web_1920__13dsjcejd2x.png
                        checkout_logo:
                          type: string
                          description: The checkout logo URL of the business.
                          example: >-
                            https://zplit-stage.s3.amazonaws.com/media/business_checkout_logos/Web_1920__13dsjcejd2x.png
                        background_color:
                          type: string
                          description: The background color used by the business.
                          example: '#f2f2f2'
                        primary_color:
                          type: string
                          description: The primary color used by the business.
                          example: '#1c202b'
                        textCheckoutColor:
                          type: string
                          description: The text color used for checkout by the business.
                          example: '#ffffff'
                        textDetailsColor:
                          type: string
                          description: The text color used for details by the business.
                          example: '#1c202b'
                        checkout_mode:
                          type: boolean
                          description: Indicates if the business is in checkout mode.
                          example: false
                        total_annual_sales:
                          type: string
                          description: The total annual sales of the business.
                          example: L
                        average_order_sale:
                          type: string
                          description: The average order sale amount of the business.
                          example: '0.00'
                        comission:
                          type: string
                          description: The commission percentage charged by the business.
                          example: '5.00'
                        status:
                          type: string
                          description: The status of the business.
                          example: A
                        first_time_filled:
                          type: boolean
                          description: >-
                            Indicates if the business information was filled for
                            the first time.
                          example: true
                        business_info:
                          type: boolean
                          description: Indicates if the business information is provided.
                          example: false
                        business_legal_representation:
                          type: boolean
                          description: >-
                            Indicates if the legal representation details of the
                            business are provided.
                          example: false
                        business_bank_details:
                          type: boolean
                          description: >-
                            Indicates if the bank details of the business are
                            provided.
                          example: false
                        show_presentation_data:
                          type: boolean
                          description: Indicates if the presentation data is shown.
                          example: false
                        enabled_smart_routing:
                          type: boolean
                          description: >-
                            Indicates if smart routing is enabled for the
                            business.
                          example: true
                        enabled_finances:
                          type: boolean
                          description: Indicates if finances are enabled for the business.
                          example: true
                        risk_level:
                          type: string
                          description: The risk level of the business.
                          example: Low
                        timezone:
                          type: string
                          description: The timezone of the business.
                          example: America/Mexico_City
                        can_change_tonder_psp:
                          type: boolean
                          description: >-
                            Indicates if the business can change the Tonder
                            payment service provider (PSP).
                          example: false
                        enabled_orchestration:
                          type: boolean
                          description: >-
                            Indicates if orchestration is enabled for the
                            business.
                          example: true
                        user:
                          type: integer
                          description: >-
                            The unique identifier of the user associated with
                            the business.
                          example: 792
                        e_commerce_platform:
                          type: string
                          nullable: true
                          description: >-
                            The e-commerce platform used by the business, if
                            any.
                          example: null
                        country:
                          type: integer
                          description: The country ID associated with the business.
                          example: 1
                        currency:
                          type: integer
                          description: The currency ID associated with the business.
                          example: 5
                        categories:
                          type: array
                          description: The categories associated with the business.
                          items:
                            type: integer
                            description: The category ID.
                            example: 1
                    payment:
                      type: object
                      description: Details about the payment.
                      properties:
                        id:
                          type: integer
                          description: The unique identifier of the payment.
                          example: 24943
                        created:
                          type: string
                          format: date-time
                          description: The timestamp when the payment was created.
                          example: '2024-06-27T18:43:37.519849-05:00'
                        modified:
                          type: string
                          format: date-time
                          description: The timestamp when the payment was last modified.
                          example: '2024-06-27T18:43:38.523950-05:00'
                        amount:
                          type: string
                          description: The amount of the payment.
                          example: '45.0000'
                        status:
                          type: string
                          description: The status of the payment.
                          example: PENDING
                        date:
                          type: string
                          format: date-time
                          description: The date of the payment.
                          example: '2024-06-27T18:43:37.519966-05:00'
                        paid_date:
                          type: string
                          format: date-time
                          nullable: true
                          description: The date when the payment was paid, if applicable.
                          example: null
                        source:
                          type: string
                          nullable: true
                          description: The source of the payment.
                          example: null
                        customer_order_reference:
                          type: string
                          description: The customer order reference ID.
                          example: TNDR-76b9de76-eeee-42e9-b4bf-255943831ee9
                        client:
                          type: integer
                          description: >-
                            The unique identifier of the client associated with
                            the payment.
                          example: 846
                        business:
                          type: integer
                          description: >-
                            The unique identifier of the business associated
                            with the payment.
                          example: 97
                        shipping_address:
                          type: string
                          nullable: true
                          description: The shipping address for the payment.
                          example: null
                        billing_address:
                          type: string
                          nullable: true
                          description: The billing address for the payment.
                          example: null
                        order:
                          type: integer
                          description: The order ID associated with the payment.
                          example: 28579
                    currency:
                      type: object
                      description: Details about the currency used.
                      properties:
                        id:
                          type: integer
                          description: The unique identifier of the currency.
                          example: 5
                        name:
                          type: string
                          description: The name of the currency.
                          example: Mexican Peso
                        code:
                          type: string
                          description: The code of the currency.
                          example: MXN
                        symbol:
                          type: string
                          description: The symbol of the currency.
                          example: $
                        country:
                          type: string
                          nullable: true
                          description: The country associated with the currency.
                          example: null
                    payment_method:
                      type: string
                      nullable: true
                      description: The payment method used.
                      example: null
                    issuing_country:
                      type: string
                      nullable: true
                      description: The issuing country of the payment method.
                      example: null

````