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

# Retrieve a refund



## OpenAPI

````yaml /openapi/payments.yaml get /refunds/{id}
openapi: 3.0.3
info:
  title: Ionic Payments API
  version: '2026-05-01'
  description: |
    Payment intents, charges, and refunds — the money-movement core.

    A payment intent (`pi_…`) tracks one payment. Create it with an amount and
    currency, then confirm it with a payment method or one-time payment token.
    Each confirmation creates a Charge; after a decline, confirm the same
    PaymentIntent again with a different payment method. With
    `capture_method: automatic` (the default) a successful
    confirmation captures immediately; with `manual` it authorizes, and you
    capture later. A Charge (`ch_…`) records one confirmation attempt, and
    `latest_charge_id` points to the most recent one. A Refund (`rf_…`) returns
    captured funds from a Charge.

    All monetary amounts are integers in the currency's minor unit (for example
    cents for USD). Timestamps are Unix epoch seconds. Identifiers are opaque,
    prefixed strings.

    Authentication uses a merchant secret key (`sk_…`) as a bearer token. Read
    endpoints require the `payments:read` permission; write endpoints require
    `payments:write`. The mode of the key (test or live) scopes which resources
    it can see and mutate, and is reflected by each resource's `livemode` field.
    Confirming and retrieving an intent additionally accept a publishable key
    (`pk_…`) together with the intent's `client_secret`, for client-side flows;
    every other endpoint is secret-key only. Send an `Idempotency-Key` header on
    create, confirm, capture, and cancel so retries do not duplicate an
    operation.

    Errors are returned as `{ "error": { "code": "...", "message": "..." } }`.
    Payment-specific failures carry extra fields: a card decline returns `402`
    with `type: card_error`, a `decline_code`, a `decline_type`, and a
    `retryable` flag, and embeds the current payment intent so you can inspect
    its status without a second call.
servers:
  - url: '{baseUrl}/v1'
    variables:
      baseUrl:
        default: https://api.ionicfi.com
        description: API base URL for your environment.
security:
  - secretKey: []
tags:
  - name: Payment Intents
    description: Create, confirm, capture, and cancel attempts to collect money.
  - name: Charges
    description: Records of individual PaymentIntent confirmation attempts.
  - name: Refunds
    description: Reversals of captured funds on a charge.
paths:
  /refunds/{id}:
    parameters:
      - $ref: '#/components/parameters/RefundId'
    get:
      tags:
        - Refunds
      summary: Retrieve a refund
      operationId: refunds_retrieve
      responses:
        '200':
          description: The refund.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/RefundNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - secretKey:
            - payments:read
components:
  parameters:
    RefundId:
      name: id
      in: path
      required: true
      description: The refund id (`rf_…`).
      schema:
        type: string
  schemas:
    Refund:
      type: object
      required:
        - amount
        - charge_id
        - created_at
        - currency
        - failure_message
        - id
        - livemode
        - object
        - payment_intent_id
        - reason
        - settled_at
        - settlement_batch_id
        - status
        - terminal_id
        - updated_at
      properties:
        id:
          type: string
          description: The refund id (`rf_…`).
        object:
          type: string
          enum:
            - refund
          description: Always `refund`.
        livemode:
          type: boolean
          description: Mirrors the mode of the underlying charge.
        charge_id:
          type: string
          description: The refunded charge (`ch_…`).
        payment_intent_id:
          type: string
          description: The parent payment intent (`pi_…`).
        terminal_id:
          type: string
          nullable: true
          description: >-
            Terminal (`tmr_…`) selected for the Refund request, or null when no
            terminal was supplied.
        amount:
          type: integer
          description: The refunded amount, in minor units. Full or partial.
        currency:
          type: string
          description: The refund's currency, matching `amount`'s currency.
        status:
          type: string
          enum:
            - pending
            - succeeded
            - failed
            - uncertain
          description: >-
            `pending` while the Refund is being processed; `uncertain` when its
            final outcome is not known yet. Retrieve the Refund again before
            retrying.
        reason:
          type: string
          nullable: true
          enum:
            - requested_by_customer
            - duplicate
            - fraudulent
          description: >-
            An optional audit/reporting category — one of
            `requested_by_customer`, `duplicate`, or `fraudulent`. Null when not
            supplied; has no effect on refund behavior.
        settlement_batch_id:
          type: string
          nullable: true
          description: >-
            Terminal batch (`tmb_…`) containing this Refund. Null until the
            Refund is settled in a batch.
        settled_at:
          type: integer
          nullable: true
          description: >-
            Unix epoch seconds when the Refund settled. Null until settlement
            completes.
        failure_message:
          type: string
          nullable: true
          description: >-
            A human-readable failure detail. Nullable; present when the refund
            failed.
        created_at:
          type: integer
          description: Unix epoch seconds when the refund was created.
        updated_at:
          type: integer
          description: Unix epoch seconds when the refund was last updated.
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        type:
          type: string
          enum:
            - card_error
            - invalid_request_error
            - api_error
        decline_code:
          type: string
        decline_type:
          type: string
          enum:
            - authorization
            - authentication
            - infrastructure
        retryable:
          type: boolean
          description: >-
            Whether the underlying condition may resolve on its own over time —
            for example available funds being deposited or a velocity window
            resetting. `true` does not mean the request is safe to retry
            immediately.
        doc_url:
          type: string
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_REQUEST
              message: invalid currency
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key lacks the required permission, or the merchant is not active.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RefundNotFound:
      description: No refund with that id is visible to this key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: REFUND_NOT_FOUND
              message: refund not found
    RateLimited:
      description: Too many requests. Honour the `Retry-After` header before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: |
        The API could not return a successful response. For a mutating request,
        retrieve the resource before retrying because the operation may have
        completed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: 'A merchant secret key (`sk_…`) sent as `Authorization: Bearer <key>`.'

````