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

# Refund a completed collection



## OpenAPI

````yaml POST /v1/collections/{id}/refund
openapi: 3.0.0
info:
  title: EQXPay API
  description: >-
    EQX v2.5 staging API for admin, liquidity-provider, and integrator
    operations.
  version: 2.5.0
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/collections/{id}/refund:
    post:
      tags:
        - Collections
      summary: Refund a completed collection
      operationId: CollectionsRefundController_refundCollection
      parameters:
        - name: id
          required: true
          in: path
          description: Collection UUID
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: Required; prevents duplicate refunds on retry
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRefundRequestDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundResponseDto'
        '401':
          description: Unauthorized
        '404':
          description: Collection not found
        '422':
          description: >-
            Refund not allowed — wrong collection state, rail does not support
            refunds, insufficient balance, or partial refund attempted
      security:
        - bearer: []
components:
  schemas:
    CreateRefundRequestDto:
      type: object
      properties:
        amount:
          type: number
          description: >-
            Refund amount in minor units; must equal the original collection
            amount (v1 full refunds only)
          example: 5000
      required:
        - amount
    RefundResponseDto:
      type: object
      properties:
        refund_id:
          type: string
          example: a1b2c3d4-...
        collection_id:
          type: string
          example: e5f6g7h8-...
        amount:
          type: number
          example: 5000
          description: Amount in minor units
        currency:
          type: string
          example: MWK
        status:
          type: string
          example: requested
          description: 'Refund status: requested | pending | successful | failed'
        requested_at:
          format: date-time
          type: string
        resolved_at:
          type: object
          nullable: true
          description: Set on successful or failed transition
      required:
        - refund_id
        - collection_id
        - amount
        - currency
        - status
        - requested_at
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````