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

# Process and confirm a Pix transfer (step 2)

> Confirms a previously initiated transfer, debits the source account, and submits the Pix payment for processing. When the submission fails without proof that the order never left (a timeout or a 5xx), the debit is kept and the call answers 201 with status PROCESSING: read the transfer for the outcome. A 502 PIX-0325 answers only an order that provably was not sent, once the reversal of the debit is recorded. When the reversal is not recorded, the call answers 500.



## OpenAPI

````yaml /pt/openapi/v3-current/pix-lerian-spi.yaml post /transfers/cashout/process
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:
  /transfers/cashout/process:
    post:
      tags:
        - Transfers
      summary: Process and confirm a Pix transfer (step 2)
      description: >-
        Confirms a previously initiated transfer, debits the source account, and
        submits the Pix payment for processing. When the submission fails
        without proof that the order never left (a timeout or a 5xx), the debit
        is kept and the call answers 201 with status PROCESSING: read the
        transfer for the outcome. A 502 PIX-0325 answers only an order that
        provably was not sent, once the reversal of the debit is recorded. When
        the reversal is not recorded, the call answers 500.
      operationId: processTransfer
      parameters:
        - description: >-
            REQUIRED. Client-supplied replay key, at most 64 bytes. A request
            without it is refused with PIX-0030 @ 400 before the handler runs.
            An identical resend within 1 hour returns the original response,
            status included, with X-Idempotency-Replayed: true. Reusing the key
            with a divergent method, URL or body is PIX-0031 @ 412.
          in: header
          name: X-Idempotency
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
        - description: Source account UUID
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: Source account UUID
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
        - description: >-
            Optional caller-supplied 32-char BACEN endToEndId, accepted for
            MANUAL initiations only (omit it to let SPI generate one). It is not
            the idempotency key -- that is X-Idempotency. A DICT or QR_CODE
            initiation already fixed its endToEndId at initiate (returned as
            endToEndId) and process reuses it automatically: for those, omit
            this header; sending it, even with the same value, is refused
            (PIX-0300) while the initiation is pending -- a retry of a process
            that already concluded (initiation CONFIRMED) returns the existing
            transfer, without the header or with a well-formed one.
          in: header
          name: X-End-To-End-Id
          schema:
            description: >-
              Optional caller-supplied 32-char BACEN endToEndId, accepted for
              MANUAL initiations only (omit it to let SPI generate one). It is
              not the idempotency key -- that is X-Idempotency. A DICT or
              QR_CODE initiation already fixed its endToEndId at initiate
              (returned as endToEndId) and process reuses it automatically: for
              those, omit this header; sending it, even with the same value, is
              refused (PIX-0300) while the initiation is pending -- a retry of a
              process that already concluded (initiation CONFIRMED) returns the
              existing transfer, without the header or with a well-formed one.
            examples:
              - E12345678202605061030abcdef12345
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessTransferBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferResponse'
          description: Created
        '400':
          content:
            application/json:
              example:
                code: PIX-0030
                title: Idempotency Key Required
                message: >-
                  The X-Idempotency header is required for this operation and
                  must be within the accepted length.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0300
                title: Bad Request
                status: 400
                detail: Missing or malformed required fields for transfer initiation.
                code: PIX-0300
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Missing, duplicated, or malformed request headers/body fields, an
            invalid end-to-end ID, an X-End-To-End-Id sent for a still-pending
            DICT or QR_CODE initiation (whose id was fixed at initiate), or a
            missing/invalid deferred amount (PIX-0001-0003, PIX-0010, PIX-0017,
            PIX-0300). X-Idempotency absent or longer than 64 bytes (PIX-0030).
            Legacy {code,title,message} envelope, NOT problem+json. Route-guard
            refusals (PIX-0001, PIX-0010) answer in the legacy
            {code,title,message} envelope too.
        '404':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0320
                title: Not Found
                status: 404
                detail: Initiation ID does not exist.
                code: PIX-0320
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            No initiation exists for the supplied initiationId in the calling
            account scope (PIX-0320).
        '409':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0322
                title: Conflict
                status: 409
                detail: Initiation was already confirmed.
                code: PIX-0322
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The initiation was already confirmed or cancelled, or a concurrent
            transfer write won the race (PIX-0322, PIX-0326, PIX-0327,
            PIX-0704).
        '412':
          content:
            application/json:
              example:
                code: PIX-0031
                title: Idempotency Key Conflict
                message: >-
                  The X-Idempotency header is held by a request still running or
                  whose receipt could not be stored, or was already used with a
                  different request.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Refused under this X-Idempotency (PIX-0031): the first request under
            it is still running (with Retry-After: 1), its receipt could not be
            stored and the key is held for the hour, or the request differs from
            the first (method, URL, body or identity header). An earlier request
            under this key may already have executed. Legacy
            {code,title,message} envelope, NOT problem+json.
        '415':
          content:
            application/json:
              example:
                code: PIX-0016
                title: Unsupported Media Type
                message: >-
                  The request body must be sent with Content-Type:
                  application/json.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            The non-empty request body is missing an accepted JSON Content-Type
            (PIX-0016), answered in the legacy {code,title,message} envelope
            over application/json, NOT problem+json.
        '422':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0321
                title: Unprocessable Entity
                status: 422
                detail: Initiation has expired.
                code: PIX-0321
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The initiation expired (PIX-0321), the debit has insufficient funds
            (PIX-0323), the ledger refused the debit for another reason
            (PIX-0332) or because another write moved the balance, which a new
            attempt can clear (PIX-0333), the ledger account/balance cannot be
            used (PIX-0328, PIX-0329), or more than one ledger fee package
            matches the transaction (PIX-0331); none of these debited anything.
            The ledger answer does not show the transfer amount moved to the
            rail (a different, unreadable or missing rail leg), so the order was
            not sent and the debit revert was attempted -- the transfer ends
            REJECTED with ledger.revert when it completes; when it does not, it
            ends FAILED, if the state write fails it stays PENDING with no
            ledger.revert. Do not start a new initiation until the transfer
            shows ledger.revert (PIX-0330). PIX-0334: the provider or the rail
            rejected the payment after the debit, and the debit was reversed;
            the order will not settle, and a new attempt needs a new end-to-end
            id.
        '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).
        '502':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0324
                title: Bad Gateway
                status: 502
                detail: >-
                  The server could not complete the request. Please try again
                  later.
                code: PIX-0324
              schema:
                $ref: '#/components/schemas/Detail'
          description: A required upstream service failed (PIX-0324, PIX-0325, PIX-0705).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    ProcessTransferBody:
      additionalProperties: false
      properties:
        amount:
          description: >-
            Confirmed amount (required unless locked by a fixed QR amount; a
            dynamic charge the payer may change only suggests one)
          examples:
            - '100.00'
          type: string
        initiationId:
          description: Initiation UUID returned by step 1
          examples:
            - 019606a1-3b4c-7d8e-9f01-234567890abc
          type: string
      required:
        - initiationId
      type: object
    TransferResponse:
      additionalProperties: false
      properties:
        accountId:
          examples:
            - 019606a0-1a2b-7c3d-8e4f-567890123abc
          type: string
        aliasId:
          type: string
        alreadyRefundedAmount:
          description: >-
            Cross-mechanism settled and reserved refund amount. Returned only
            for INBOUND transfers.
          examples:
            - '60.00'
          type: string
        amount:
          examples:
            - '100.00'
          type: string
        createdAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
        currency:
          examples:
            - BRL
          type: string
        deletedAt:
          format: date-time
          type: string
        description:
          examples:
            - Pagamento de aluguel
          type: string
        destination:
          $ref: '#/components/schemas/SourceDestination'
        endToEndId:
          examples:
            - E12345678202605061030abcdef12345
          type: string
        feeCharge:
          $ref: '#/components/schemas/FeeChargeResponse'
          description: >-
            Fee the ledger reported on the transfer. Absent when the ledger's
            fee answer was not recorded for this transfer (an error logged at
            the time, or a transfer created before fees were read back);
            {"applied": false} when the ledger reported that no fee was charged;
            the full object when it charged one.
        id:
          examples:
            - 019606a2-4c5d-7e8f-90a1-345678901bcd
          type: string
        initiatedAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
        initiationType:
          examples:
            - DICT
          type: string
        ledger:
          $ref: '#/components/schemas/LedgerInfo'
        metadata:
          additionalProperties: {}
          type: object
        paymentType:
          examples:
            - PIX
          type: string
        purpose:
          examples:
            - IACT
          type: string
        remainingRefundableAmount:
          description: >-
            Amount minus alreadyRefundedAmount. Returned only for INBOUND
            transfers and can be negative.
          examples:
            - '40.00'
          type: string
        source:
          $ref: '#/components/schemas/SourceDestination'
        status:
          examples:
            - COMPLETED
          type: string
        type:
          examples:
            - OUTBOUND
          type: string
        updatedAt:
          examples:
            - '2026-05-06T10:30:05Z'
          format: date-time
          type: string
        urgency:
          examples:
            - HIGH
          type: string
      required:
        - id
        - endToEndId
        - status
        - type
        - amount
        - createdAt
        - updatedAt
      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
    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
    SourceDestination:
      additionalProperties: false
      properties:
        account:
          $ref: '#/components/schemas/AccountDetails'
        key:
          examples:
            - '+5511999998888'
          type: string
        owner:
          $ref: '#/components/schemas/OwnerDetails'
      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
    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
    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
    AccountDetails:
      additionalProperties: false
      properties:
        branch:
          examples:
            - '0001'
          type: string
        number:
          examples:
            - '0007654321'
          type: string
        participant:
          examples:
            - '87654321'
          type: string
        type:
          examples:
            - CACC
          type: string
      required:
        - branch
        - number
        - participant
        - type
      type: object
    OwnerDetails:
      additionalProperties: false
      properties:
        document:
          examples:
            - '12345678901'
          type: string
        name:
          examples:
            - João da Silva
          type: string
        tradeName:
          examples:
            - Empresa Exemplo LTDA
          type: string
        type:
          examples:
            - NATURAL_PERSON
          type: string
      required:
        - document
        - name
      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
    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
  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.