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

# Get a Pix refund by ID

> Returns a single refund scoped to the calling account.



## OpenAPI

````yaml /pt/openapi/v3-current/pix-lerian-spi.yaml get /refunds/{id}
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: Public API for outbound Pix transfers, refunds, and scheduled payments.
  license:
    name: Lerian Studio General License
  title: Pix Lerian — Payments
  version: 1.2.0
servers:
  - url: https://api.example.com/spi/v1
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: Create, list, and retrieve Pix refunds.
    name: Refunds
  - name: Scheduled Payments
    description: Register, list, retrieve, and cancel scheduled Pix payments.
  - description: Initiate, process, list, and retrieve outbound Pix transfers.
    name: Transfers
  - description: >-
      Register, list, retrieve, and cancel recurring series of scheduled Pix
      payments.
    name: Scheduled Payment Recurrences
  - description: >-
      Hold the funds of a received Pix in a cautionary block (MED 2.0), return
      them to the payer, or give them back to the account holder.
    name: Balance Locks
paths:
  /refunds/{id}:
    get:
      tags:
        - Refunds
      summary: Get a Pix refund by ID
      description: Returns a single refund scoped to the calling account.
      operationId: getRefund
      parameters:
        - description: Account UUID
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: Account UUID
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
        - description: Refund UUID
          in: path
          name: id
          required: true
          schema:
            description: Refund UUID
            examples:
              - 0196080a-1234-7890-abcd-ef0123456789
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundCashoutOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0403
                title: Bad Request
                status: 400
                detail: Missing or malformed required fields for refund.
                code: PIX-0403
              schema:
                $ref: '#/components/schemas/Detail'
            application/json:
              example:
                code: PIX-0001
                title: Missing Headers in Request
                message: Your request is missing one or more required header params.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Missing, duplicated, or malformed X-Account-Id or refund UUID
            (PIX-0001, PIX-0015, PIX-0017, PIX-0403). Route-guard refusals
            (PIX-0001) answer in the legacy {code,title,message} envelope over
            application/json, NOT problem+json.
        '404':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0420
                title: Not Found
                status: 404
                detail: Refund ID does not exist for this organization.
                code: PIX-0420
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            No refund exists for the supplied UUID in the calling account scope
            (PIX-0420).
        '500':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0000
                title: Internal Server Error
                status: 500
                detail: >-
                  The server could not complete the request. Please try again
                  later.
                code: PIX-0000
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unexpected server error (PIX-0000).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    RefundCashoutOutput:
      additionalProperties: false
      properties:
        accountId:
          examples:
            - 019606a0-1a2b-7c3d-8e4f-567890123abc
          type: string
        amount:
          examples:
            - '100.00'
          type: string
        createdAt:
          examples:
            - '2026-05-06T10:45:00Z'
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
        description:
          examples:
            - Estorno solicitado pelo pagador
          type: string
        id:
          examples:
            - 019606b1-3b4c-7d8e-9f01-234567890dee
          type: string
        ledger:
          $ref: '#/components/schemas/LedgerInfo'
        metadata:
          additionalProperties: {}
          type: object
        originalEndToEndId:
          examples:
            - E12345678202605061030abcdef12345
          type: string
        reasonCode:
          examples:
            - MD06
          type: string
        returnEndToEndId:
          examples:
            - D12345678202605061045fedcba54321
          type: string
        status:
          examples:
            - COMPLETED
          type: string
        type:
          examples:
            - OUTBOUND
          type: string
        updatedAt:
          examples:
            - '2026-05-06T10:45:30Z'
          format: date-time
          type: string
        feeCharge:
          $ref: '#/components/schemas/FeeChargeResponse'
          description: >-
            Fee the ledger reported on the create that moved the refund's money.
            Absent when no fee answer was recorded for this refund (its ledger
            create never landed, an error was logged at the time, or the refund
            was created before fees were read back); {"applied": false} when the
            ledger reported that no fee was charged; the full object when it
            charged one. A refund carries no ledger.revert field and needs none
            here: a FAILED refund that carries feeCharge was reverted first --
            every path that writes a refund FAILED after its ledger create
            landed reverts the debit before marking it (a revert that does not
            complete leaves the refund PROCESSING), and every other path fails
            before any create -- so the fee was returned with the amount;
            applied reports what the create did and the object records the
            create.
      required:
        - id
        - originalEndToEndId
        - status
        - type
        - amount
        - reasonCode
        - createdAt
        - updatedAt
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    LegacyErrorEnvelope:
      additionalProperties: false
      properties:
        code:
          description: PIX-XXXX error code
          type: string
        message:
          description: Human-readable error message
          type: string
        title:
          description: Short error title
          type: string
        fields:
          additionalProperties:
            type: string
          description: Per-field detail, keyed by the field or header the refusal names
          type: object
        headers:
          additionalProperties:
            type: string
          description: Per-header detail, keyed by the request header the refusal names
          type: object
      required:
        - code
        - title
        - message
      type: object
    LedgerInfo:
      additionalProperties: false
      properties:
        destinationOperationId:
          examples:
            - 019606a5-7f80-7182-3c4d-56789012cdf1
          type: string
        revert:
          $ref: '#/components/schemas/LedgerRevertInfo'
        sourceOperationId:
          examples:
            - 019606a5-7f80-7182-3c4d-56789012cdf0
          type: string
        transactionId:
          examples:
            - 019606a5-7f80-7182-3c4d-56789012cdef
          type: string
      type: object
    FeeChargeResponse:
      additionalProperties: false
      properties:
        applied:
          examples:
            - true
          type: boolean
          description: >-
            Whether the ledger charged a fee on the create that moved the
            operation's money. When false, no other field is present. applied
            reports what the create did and the object is kept as its record.
            Where the operation carries ledger.revert (transfers only: REJECTED,
            or FAILED after the debit was reverted), the revert inverted the fee
            legs with the amount, so the fee was returned; on a transfer without
            ledger.revert, feeCharge says nothing about the fee's final
            position.
        calculationType:
          examples:
            - LEDGER
          type: string
          description: >-
            How the total fee was calculated. LEDGER when the ledger's fee
            package computed it.
        fees:
          items:
            $ref: '#/components/schemas/FeeEntryResponse'
          type:
            - array
            - 'null'
          description: >-
            Individual fee entries that make up the total, one per ledger fee
            leg.
        netAmount:
          examples:
            - '100.00'
          type: string
          description: >-
            Amount that reached the destination: on an outbound operation what
            the ledger moved to the rail, on an inbound one what it credited to
            the receiving account (the operation's amount when the ledger
            reported no such leg; on an outbound operation a deductible fee
            package, a misconfiguration on a Pix ledger, makes it lower than the
            amount).
        totalAmount:
          examples:
            - '1.50'
          type: string
          description: Sum of every fee entry the ledger charged on the operation.
      required:
        - applied
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
    LedgerRevertInfo:
      additionalProperties: false
      properties:
        destinationOperationId:
          examples:
            - 019606a5-7f80-7182-3c4d-56789012cdf1
          type: string
        sourceOperationId:
          examples:
            - 019606a5-7f80-7182-3c4d-56789012cdf0
          type: string
        transactionId:
          examples:
            - 019606a5-7f80-7182-3c4d-56789012cdef
          type: string
      type: object
    FeeEntryResponse:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '1.50'
          type: string
          description: Amount of this fee entry.
        calculationType:
          examples:
            - LEDGER
          type: string
          description: >-
            How this entry was calculated. LEDGER when the ledger's fee package
            computed it.
        calculationValue:
          type: string
          description: >-
            Raw value the calculation was parameterised with. Absent when
            calculationType is LEDGER.
        creditAccount:
          examples:
            - '@fees-pix'
          type: string
          description: Ledger account credited with this fee entry.
        feeLabel:
          examples:
            - LEDGER_FEE
          type: string
          description: >-
            Label of this fee entry. LEDGER_FEE on every entry the ledger
            reported: its answer names no fee, so creditAccount is what
            distinguishes one entry from another.
      required:
        - feeLabel
        - amount
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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