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

# Create Refund

> Create a new refund for a previously successful payment.



## OpenAPI

````yaml POST /pg/refunds/
openapi: 3.0.0
info:
  title: Eximpe Payment Gateway API
  description: >-
    API for payment processing and order management through Eximpe payment
    gateway. This specification includes v1, v2, and v3 API versions.
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api-pacb-uat.eximpe.com
    description: Payment Gateway Sandbox URL
security:
  - clientAuth: []
    clientSecretAuth: []
    apiVersionHeader: []
tags:
  - name: Card Tokens
  - name: Merchants
  - name: Orders
  - name: Payment Links
  - name: Payments
  - name: Refunds
  - name: Settlements
  - name: Subscriptions
paths:
  /pg/refunds/:
    post:
      tags:
        - Refunds
      summary: Create Refund
      description: Create a new refund for a previously successful payment.
      operationId: v1_post_pg_refunds_
      requestBody:
        description: Refund creation request
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1_CreateRefundRequest'
            example:
              payment_id: PR2024120567891
              refund_amount: '2250.00'
      responses:
        '200':
          description: Refund created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_GetRefundResponse'
              example:
                success: true
                message: Refund request processed successfully
                data:
                  refund_id: RF5622596094
                  payment_id: PR2099558561
                  refund_status: initiated
                  message: Refund Request Queued
                  transaction_id: '138605980'
                  bank_ref_num: null
                  refund_amount: '1000'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1_ErrorResponse'
      security:
        - clientAuth: []
          clientSecretAuth: []
          apiVersionHeader: []
components:
  schemas:
    v1_CreateRefundRequest:
      type: object
      required:
        - payment_id
        - refund_amount
      properties:
        payment_id:
          type: string
          description: The ID of the payment to refund.
        refund_amount:
          type: string
          description: The amount to be refunded. Can be a partial amount.
    v1_GetRefundResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
        message:
          type: string
          description: Response message
        data:
          $ref: '#/components/schemas/v1_Refund'
    v1_ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
          description: >-
            Indicates if the request was successful. Always false for error
            responses.
        error:
          $ref: '#/components/schemas/v1_ErrorDetails'
    v1_Refund:
      type: object
      properties:
        refund_id:
          type: string
          description: Unique identifier for the refund.
        payment_id:
          type: string
          description: The ID of the payment that was refunded.
        refund_status:
          type: string
          description: The status of the refund.
        message:
          type: string
          nullable: true
          description: A message providing more detail about the refund status.
        bank_ref_num:
          type: string
          nullable: true
          description: The bank reference number for the refund.
        refund_amount:
          type: number
          format: float
          description: The refunded amount.
        refunded_at:
          type: string
          format: date-time
          nullable: true
          description: The timestamp of when the refund was completed.
    v1_ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code (e.g., ERR_ORDER_002)
        message:
          type: string
          description: Error message
        details:
          type: object
          description: Detailed validation error information with field-specific errors
          additionalProperties:
            type: string
            description: Error message for the specific field
  securitySchemes:
    clientAuth:
      type: apiKey
      name: X-Client-ID
      in: header
      description: >-
        **Client Application ID** - Your unique application identifier used to
        authenticate API requests. You can find your Client ID in the Developer
        Settings section of the merchant dashboard.
      x-displayName: Client ID
      x-example: your-client-id
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: >-
        **Client Secret Key** - Your secret key used alongside the Client ID for
        secure authentication. Keep this confidential and never expose it in
        client-side code. Available in the Developer Settings section of the
        merchant dashboard.
      x-displayName: Client Secret
      x-example: your-client-secret
    apiVersionHeader:
      type: apiKey
      name: X-API-Version
      in: header
      description: >-
        **API Version** - Specifies which version of the API to use (e.g.,
        '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which
        API version your integration uses. Default version information is
        available in the Developer Settings.
      x-displayName: API Version
      x-example: 3.0.0

````