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

# Refund Charge



## OpenAPI

````yaml POST /payment-method/{id}/payment/{paymentId}/refund
openapi: 3.1.0
info:
  title: Compago API
  version: 1.0.0
  description: >-
    Public and private API endpoints for Compago's payment infrastructure. This
    specification currently includes endpoints for one-time payments. More
    endpoints will be added as the platform evolves.
servers:
  - url: https://demo.api.harmony.compago.com/api
  - url: https://api.harmony.compago.com/api
security: []
tags:
  - name: OneTimePayment
    description: Endpoints for creating and processing one-time payment links
  - name: PaymentMethod
    description: >-
      Endpoints for saving cards, charging saved payment methods, and processing
      refunds
  - name: PaymentIntent
    description: >-
      Endpoints for creating and managing card-present payment intents for POS
      terminal integrations
paths:
  /payment-method/{id}/payment/{paymentId}/refund:
    post:
      tags:
        - PaymentMethod
      summary: Refund a payment
      operationId: refundPaymentMethodPayment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique identifier of the payment method
        - name: paymentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique identifier of the payment to refund
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundPaymentRequest'
      responses:
        '200':
          description: Payment refunded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundPaymentResponse'
        '400':
          description: Cannot refund payment (not CONFIRMED)
        '401':
          description: Unauthorized – missing or invalid API key
        '404':
          description: Payment method or payment not found
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RefundPaymentRequest:
      type: object
      description: >-
        Request body for refunding a payment. Refunds are always for the full
        charge amount.
      properties:
        reason:
          type: string
          example: Customer requested cancellation
          description: Reason for the refund. Useful for accounting and auditing purposes.
    RefundPaymentResponse:
      type: object
      description: Response after refunding a payment
      properties:
        id:
          type: string
          format: uuid
          example: 11111111-2222-3333-4444-555555555555
          description: Unique identifier of the payment
        status:
          type: string
          enum:
            - REFUNDED
          description: Payment status after refund
        amount:
          type: number
          format: decimal
          description: The refunded amount
        currency:
          type: string
          example: MXN
      required:
        - id
        - status
        - amount
        - currency
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````