> ## 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.

# Get a refund

> A single refund. Answers 404 when the id belongs to another organization.



## OpenAPI

````yaml GET /developer/v1/refund/{id}
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, holding and
      capturing funds, and processing refunds
  - name: PaymentIntent
    description: >-
      Endpoints for creating and managing card-present payment intents for POS
      terminal integrations
  - name: Payments
    description: Read the payments your organization has taken
  - name: Subscriptions
    description: Read and manage recurring billing agreements
  - name: PaymentLinks
    description: Create, edit and retire hosted checkout links
  - name: Products
    description: Manage the catalogue behind product-based payment links
  - name: Promotions
    description: Read the promotions your organization funds or benefits from
  - name: Salespeople
    description: Read the point-of-sale operators in your organization
  - name: Organization
    description: Read your organization profile and its members
  - name: SavedCards
    description: Read saved payment methods and their payments
  - name: Payouts
    description: >-
      Read the transfers Compago sent to your bank accounts and what each one
      paid
  - name: Events
    description: >-
      Read the webhook events of the last 30 days, to reconcile after your
      endpoint was down
  - name: ApiKeys
    description: Manage your organization's API keys with a key that holds `apiKey:write`.
paths:
  /developer/v1/refund/{id}:
    get:
      tags:
        - Refunds
      summary: Get a refund
      description: >-
        A single refund. Answers 404 when the id belongs to another
        organization.
      operationId: getPublicRefund
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1Refund'
        '401':
          description: Unauthorized. The `x-api-key` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '403':
          description: >-
            Forbidden. The key is not bound to an organization, or the
            organization is not a merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '404':
          description: Not found, or the refund belongs to another organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '429':
          description: Too many requests. See Rate limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    V1Refund:
      type: object
      description: >-
        A refund of a sale. Today a refund always gives back the whole charge
        (the sale and its tip).
      required:
        - id
        - object
        - paymentId
        - amount
        - currency
        - status
        - failureReason
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
        object:
          type: string
          enum:
            - refund
        paymentId:
          type: string
          format: uuid
          description: The sale refunded, as `GET /developer/v1/payment/{id}` reads it.
        amount:
          type: number
          example: 1150
          description: What went back to the customer, in MXN.
        currency:
          type: string
          example: MXN
          enum:
            - MXN
        status:
          type: string
          enum:
            - PENDING
            - SUCCEEDED
            - FAILED
          description: >-
            `SUCCEEDED` once the bank accepted it. `PENDING` while a bank
            transfer refund (SPEI) is on its way, `FAILED` if the bank refused
            it.
        failureReason:
          type:
            - string
            - 'null'
          enum:
            - DECLINED
            - RETURN_FAILED
            - null
          description: >-
            Why the refund failed: `DECLINED` when the bank declined the card
            refund, `RETURN_FAILED` when a transfer could not be sent back to
            the account it came from. `null` otherwise.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PublicError:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description.
        code:
          type: string
          description: Stable machine-readable code. Branch on this, not on `message`.
      required:
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.