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

# Refund API

> The Refund API is used to return funds to the customer after a successful purchase or capture transaction.

<Warning>Note: Refunds are not supported for the following payment methods: PayPay, Pay-Easy, and Konbini.</Warning>

### Key Points

<Info>
  * The Refund API allows the merchant to reverse a transaction, sending the funds back to the customer’s payment method.

  * This API is typically used in scenarios such as order cancellations, product returns, or when a customer disputes a charge.

  * Refunds can be partial or full, depending on the amount specified in the refund request. If a partial amount is refunded, the remaining balance of the original transaction is still valid.
</Info>

## Flow diagram

<img src="https://mintcdn.com/dasdoc/kfo25CLU3J6KbVVp/images/timeline-diagram/flows-API-refund.svg?fit=max&auto=format&n=kfo25CLU3J6KbVVp&q=85&s=72426062fc5200bb88aec9f200e21824" alt="Flow diagram image" width="1997" height="868" data-path="images/timeline-diagram/flows-API-refund.svg" />

## Api Parameters


## OpenAPI

````yaml api-reference/en/open-api-config/server-to-server/refund.json POST /api/v1/server-to-server-interface/refund
openapi: 3.0.1
info:
  title: Payment Options API
  description: API for generating Hosted Payment Page (HPP) links and processing payments.
  version: 1.0.0
servers:
  - url: https://api-dev.paymentoptions.com
security:
  - apiKeyAuth: []
    xApiKeyAuth: []
paths:
  /api/v1/server-to-server-interface/refund:
    post:
      summary: Refund a Transaction
      description: >-
        This endpoint allows merchants to refund a captured or purchased
        transaction amount.
      operationId: refundTransaction
      requestBody:
        description: The request payload to refund a transaction.
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                transactionId:
                  type: string
                  description: The original transaction ID of the authorized transaction.
                  example: 9dfd39ec-eb4a-4f8b-a526-17abf140a717
                  maxLength: 36
                amount:
                  type: integer
                  description: >-
                    The amount to be refunded. This should not exceed the amount
                    captured or purchased. Amount limit depends on the bank.
                  example: 1000
                merchant_id:
                  type: string
                  description: The merchant ID (DASMID).
                  example: < Merchant ID >
                  maxLength: 10
                notes:
                  type: string
                  description: The reference of the refund transaction (optional).
                  example: Refund amount captured/purchased
                  maxLength: 128
              required:
                - transactionId
                - amount
                - merchant_id
      responses:
        '201':
          description: Transaction refunded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: True on successful transaction, false on failure.
                    example: true
                  status_code:
                    type: integer
                    description: The status code of the transaction.
                    example: 201
                  is_live:
                    type: boolean
                    description: True if live transaction, false if test transaction.
                    example: false
                  transaction_type:
                    type: string
                    description: The transaction type (e.g., REFUND).
                    example: REFUND
                  gateway_response:
                    type: object
                    description: A JSON object containing the response from the gateway.
                    properties:
                      version:
                        type: string
                        description: The version of the gateway.
                        example: '1'
                      type:
                        type: string
                        description: Type of response (e.g., INFO).
                        example: INFO
                      message:
                        type: string
                        description: The message response from the gateway.
                        example: Amount successfully refunded.
                      code:
                        type: string
                        description: Message code of the response.
                        example: INFO0002
                  merchant_details:
                    type: object
                    description: A JSON object containing the details of the merchant.
                    properties:
                      legal_name:
                        type: string
                        description: The merchant’s legal name.
                        example: Tink15 Factory
                      mid:
                        type: string
                        description: The merchant ID (DASMID).
                        example: < Merchant ID >
                      merchant_txn_ref:
                        type: string
                        description: The merchant transaction reference.
                        example: qwe
                  payment_details:
                    type: object
                    description: >-
                      A JSON object containing the payment details of the
                      transaction.
                    properties:
                      amount:
                        type: number
                        description: The amount value of the transaction.
                        example: 1000
                      response_code:
                        type: integer
                        description: The acquirer response code.
                        example: 0
                      auth_code:
                        type: string
                        description: The acquirer authorization code.
                        example: '264302'
                      currency:
                        type: string
                        description: The currency of the transaction.
                        example: JPY
                      payment_method:
                        type: string
                        description: >-
                          The payment card type (e.g., Credit Card or Debit
                          Card).
                        example: ECMC-SSL
                      scheme:
                        type: string
                        description: The card brand scheme (e.g., MASTERCARD).
                        example: MASTERCARD
                      card:
                        type: object
                        description: A JSON object containing details of the card.
                        properties:
                          name:
                            type: string
                            description: The cardholder’s name on the card.
                            example: John Doe
                          number:
                            type: string
                            description: The card number (masked).
                            example: '5200000000001005'
                          exp_month:
                            type: string
                            description: The expiry month of the card.
                            example: '12'
                          exp_year:
                            type: string
                            description: The expiry year of the card.
                            example: '29'
                      additional_data:
                        type: object
                        description: A JSON object containing additional data.
                        properties:
                          payment_data_source:
                            type: object
                            description: A JSON object containing payment data source.
                            properties:
                              type:
                                type: string
                                description: >-
                                  The type of payment data source (e.g., Card,
                                  GooglePay, ApplePay).
                                example: card
                  transaction_details:
                    type: object
                    description: A JSON object containing details of the transaction.
                    properties:
                      id:
                        type: string
                        description: The transaction ID of the transaction.
                        example: 626fa81d-9819-4947-bb9b-b0f11e00a50e
                      ref:
                        type: integer
                        description: The authorization code of the transaction.
                        example: 74824
                      timestamp:
                        type: string
                        description: Date and time of the transaction.
                        example: '2024-11-25T08:51:52.000Z'
                      merchant_txn_ref:
                        type: string
                        description: The merchant transaction reference ID.
                        example: qwe
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
      description: 'API Key for Authorization. Format: ''Basic YOUR_API_KEY_HERE'''
    xApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: API Key specific to x-api-key.

````