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

# Processar e confirmar uma transferência Pix iniciada (etapa 2)

> Confirma uma transferência iniciada anteriormente, debita a conta de origem e envia o pagamento Pix para processamento.



## 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: API pública para transferências Pix de saída e devoluções.
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Pix Lerian — Pagamentos
  version: release-candidate
servers:
  - url: https://api.example.com/spi/v1
    description: Substitua o host de exemplo pela URL fornecida no onboarding do ambiente.
security:
  - BearerAuth: []
tags:
  - description: >-
      Iniciação, processamento, listagem e consulta de transferências Pix de
      saída.
    name: Transfers
  - description: Criação, listagem e consulta de devoluções Pix.
    name: Refunds
paths:
  /transfers/cashout/process:
    post:
      tags:
        - Transfers
      summary: Processar e confirmar uma transferência Pix iniciada (etapa 2)
      description: >-
        Confirma uma transferência iniciada anteriormente, debita a conta de
        origem e envia o pagamento Pix para processamento.
      operationId: processTransfer
      parameters:
        - description: >-
            Chave criada pelo cliente para repetir com segurança exatamente a
            mesma requisição.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
            description: >-
              Chave criada pelo cliente para repetir com segurança exatamente a
              mesma requisição.
          example: pix-demo-20260903-000001
        - description: UUID da conta associada à operação.
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: UUID da conta associada à operação.
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
          example: 019606a1-3b4c-7d8e-9f01-234567890abc
        - description: >-
            Idempotency key — caller-supplied 32-char BCB endToEndId. Omit to
            let SPI generate one.
          in: header
          name: X-End-To-End-Id
          schema:
            description: >-
              Idempotency key — caller-supplied 32-char BCB endToEndId. Omit to
              let SPI generate one.
            examples:
              - E12345678202605061030abcdef12345
            type: string
          example: E12345678202605061030abcdef12345
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessTransferBody'
            examples:
              exemploFicticio:
                summary: Exemplo fictício
                value:
                  amount: '100.00'
                  initiationId: 019606a1-3b4c-7d8e-9f01-234567890abc
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferResponse'
              examples:
                exemploFicticio:
                  summary: Exemplo fictício
                  value:
                    accountId: 019606a0-1a2b-7c3d-8e4f-567890123abc
                    aliasId: 019606a1-3b4c-7d8e-9f01-234567890abc
                    amount: '100.00'
                    createdAt: '2026-05-06T10:30:00Z'
                    currency: BRL
                    description: Pagamento de aluguel
                    destination:
                      account:
                        branch: '0001'
                        number: '0007654321'
                        participant: '87654321'
                        type: CACC
                      key: '+5511999998888'
                      owner:
                        document: '12345678901'
                        name: João da Silva
                        tradeName: Empresa Exemplo LTDA
                        type: NATURAL_PERSON
                    endToEndId: E12345678202605061030abcdef12345
                    feeCharge:
                      applied: true
                      calculationType: FIXED
                      fees:
                        - amount: '1.50'
                          calculationType: FIXED
                          calculationValue: '1.50'
                          creditAccount: 019606a3-5d6e-7f80-1a2b-345678901bcd
                          feeLabel: PIX_TRANSFER_FEE
                      netAmount: '98.50'
                      totalAmount: '1.50'
                    id: 019606a2-4c5d-7e8f-90a1-345678901bcd
                    initiatedAt: '2026-05-06T10:30:00Z'
                    initiationType: DICT
                    ledger:
                      destinationOperationId: 019606a5-7f80-7182-3c4d-56789012cdf1
                      revert:
                        destinationOperationId: 019606a5-7f80-7182-3c4d-56789012cdf1
                        sourceOperationId: 019606a5-7f80-7182-3c4d-56789012cdf0
                        transactionId: 019606a5-7f80-7182-3c4d-56789012cdef
                      sourceOperationId: 019606a5-7f80-7182-3c4d-56789012cdf0
                      transactionId: 019606a5-7f80-7182-3c4d-56789012cdef
                    metadata:
                      field: field-example
                    paymentType: PIX
                    purpose: IACT
                    source:
                      account:
                        branch: '0001'
                        number: '0007654321'
                        participant: '87654321'
                        type: CACC
                      key: '+5511999998888'
                      owner:
                        document: '12345678901'
                        name: João da Silva
                        tradeName: Empresa Exemplo LTDA
                        type: NATURAL_PERSON
                    status: COMPLETED
                    type: OUTBOUND
                    updatedAt: '2026-05-06T10:30:05Z'
                    urgency: HIGH
          description: Created
        '400':
          content:
            application/json:
              example:
                code: PIX-0030
                title: Idempotency Key Required
                message: >-
                  O cabeçalho Idempotency-Key é obrigatório nesta operação e
                  deve respeitar o tamanho aceito.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Idempotency-Key ausente ou maior que 64 bytes (PIX-0030). Envelope
            legado {code,title,message}; não é problem+json.
        '412':
          content:
            application/json:
              example:
                code: PIX-0031
                title: Idempotency Key Conflict
                message: A Idempotency-Key já foi usada com uma requisição diferente.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Idempotency-Key reutilizada com uma requisição divergente — método,
            URL, incluindo o parâmetro de caminho, ou corpo diferente
            (PIX-0031). Envelope legado {code,title,message}; não é
            problem+json.
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      x-codeSamples:
        - lang: bash
          label: cURL com dados fictícios
          source: |-
            curl --request POST \
              --url https://api.example.com/spi/v1/transfers/cashout/process \
              --header 'Authorization: Bearer demo-access-token' \
              --header 'Content-Type: application/json' \
              --header 'Idempotency-Key: pix-demo-20260903-000001' \
              --header 'X-Account-Id: 019606a1-3b4c-7d8e-9f01-234567890abc' \
              --header 'X-End-To-End-Id: E12345678202605061030abcdef12345' \
              --data '{
              "amount": "100.00",
              "initiationId": "019606a1-3b4c-7d8e-9f01-234567890abc"
            }'
components:
  schemas:
    ProcessTransferBody:
      additionalProperties: false
      properties:
        amount:
          description: Confirmed amount (required unless locked by a static QR)
          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'
        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
      required:
        - code
        - title
        - message
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          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
        calculationType:
          examples:
            - FIXED
          type: string
        fees:
          items:
            $ref: '#/components/schemas/FeeEntryResponse'
          type:
            - array
            - 'null'
        netAmount:
          examples:
            - '98.50'
          type: string
        totalAmount:
          examples:
            - '1.50'
          type: string
      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
        calculationType:
          examples:
            - FIXED
          type: string
        calculationValue:
          examples:
            - '1.50'
          type: string
        creditAccount:
          examples:
            - 019606a3-5d6e-7f80-1a2b-345678901bcd
          type: string
        feeLabel:
          examples:
            - PIX_TRANSFER_FEE
          type: string
      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

````