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

> Read only. Tells you what refunding the sale now would cost the business (the fee Compago keeps, with IVA), where that fee would come from, and whether the refund would be accepted, without refunding anything.



## OpenAPI

````yaml GET /developer/v1/one-time-payment/{id}/refund-quote
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/one-time-payment/{id}/refund-quote:
    get:
      tags:
        - OneTimePayment
      summary: Quote a one-time payment refund
      description: >-
        Read only. Tells you what refunding the sale now would cost the business
        (the fee Compago keeps, with IVA), where that fee would come from, and
        whether the refund would be accepted, without refunding anything.
      operationId: quoteOneTimePaymentRefund
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique identifier of the one-time payment
      responses:
        '200':
          description: The refund quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundQuoteResponse'
        '400':
          description: '`NOT_REFUNDABLE`: the one-time payment has no approved sale.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundError'
        '401':
          description: Unauthorized – missing or invalid API key
        '404':
          description: >-
            `ONE_TIME_PAYMENT_NOT_FOUND`: no such one-time payment in your
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RefundQuoteResponse:
      type: object
      description: >-
        What refunding this sale now would cost the business, and whether it
        would be accepted. Read only: nothing is reserved, so the answer can
        change if other sales settle or are refunded before you call the refund
        endpoint.
      properties:
        enabled:
          type: boolean
          example: true
          description: >-
            Whether Compago keeps its fee on this business's refunds. When false
            the fee fields are 0 and the refund is never refused for the fee.
        refundAmount:
          type: number
          format: decimal
          example: 100
          description: 'What would go back to the customer: the full charge.'
        saleTake:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            What the sale was going to deposit before the refund. Always `null`
            through an API key: a net amount is shown only in the dashboard, to
            users who can see fees.
        fee:
          type: number
          format: decimal
          example: 3
          description: The fee Compago would keep, before IVA.
        iva:
          type: number
          format: decimal
          example: 0.48
          description: IVA on the fee.
        feeTotal:
          type: number
          format: decimal
          example: 3.48
          description: '`fee + iva`.'
        pendingSettlement:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            What the business has pending to settle from its other sales right
            now. Always `null` through an API key: it is shown only in the
            dashboard, to users who can see settlements.
        pendingAfter:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            What would remain pending to settle after deducting the fee. Always
            `null` through an API key: it is shown only in the dashboard, to
            users who can see settlements.
        balance:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            The business's outstanding balance with Compago: 0, or negative for
            what it owes. Always `null` through an API key: it is shown only in
            the dashboard, to users who can see settlements.
        allowance:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            The refund allowance Compago granted the business: the most it may
            owe. 0 when it has none. Always `null` through an API key: it is
            shown only in the dashboard, to users who can see settlements.
        allowanceAvailable:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            The part of the allowance not yet used. Always `null` through an API
            key: it is shown only in the dashboard, to users who can see
            settlements.
        allowed:
          type: boolean
          example: true
          description: >-
            Whether the refund would be accepted. When false, the refund
            endpoint answers 409 `REFUND_FEE_NOT_COVERED`.
        missing:
          type: number
          format: decimal
          example: 0
          description: >-
            How much of `deducted` exceeds what can cover it. 0 when `allowed`
            is true.
        kind:
          type: string
          enum:
            - SAME_DAY
            - LATE
          example: SAME_DAY
          description: >-
            `SAME_DAY`: the sale was not settled yet, so only the fee is
            deducted from the business's pending settlement. `LATE`: the sale
            was already deposited, so the whole refund is deducted from its next
            settlements. Through an API key a refund is always same-day, so the
            quote answers `SAME_DAY` for any sale the API can still refund.
        deducted:
          type: number
          format: decimal
          example: 3.48
          description: >-
            What the refund takes out of the business's next settlements:
            `feeTotal` for a `SAME_DAY` refund (0 when no fee is kept), the
            whole `refundAmount` for a `LATE` one. It is what the refund is
            refused for when nothing covers it.
        chargedFrom:
          type:
            - string
            - 'null'
          enum:
            - PENDING_SETTLEMENT
            - REFUND_ALLOWANCE
            - null
          description: >-
            Where the fee would come from, as in the refund's response. Null
            when no fee would be kept or the refund would be refused.
        balanceAfter:
          type:
            - number
            - 'null'
          format: decimal
          example: null
          description: >-
            The outstanding balance after the refund: 0, or negative for what
            the business would owe. Always `null` through an API key: it is
            shown only in the dashboard, to users who can see settlements.
      required:
        - enabled
        - refundAmount
        - saleTake
        - fee
        - iva
        - feeTotal
        - pendingSettlement
        - pendingAfter
        - balance
        - allowance
        - allowanceAvailable
        - allowed
        - missing
        - kind
        - deducted
        - chargedFrom
        - balanceAfter
    RefundError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable machine-readable code. Branch on this, not on `message`.
            message:
              type: string
              description: Human-readable description.
          required:
            - code
            - message
      required:
        - error
  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.