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

# Desbloquear uma Transferência Pix

> Use este endpoint para desbloquear uma transferência presa no status
PROCESSING. O plugin obtém o status atual do BTG e dispara a liquidação
se a transação já tiver sido concluída ou falhado no BTG.



## OpenAPI

````yaml pt/openapi/v3-current/indirect-pix.yaml POST /v1/transfers/{transfer_id}/unblock
openapi: 3.0.3
info:
  title: Plugin BR Pix Indireto - API Completa
  description: |
    API completa para o sistema brasileiro de pagamentos instantâneos Pix,
    incluindo operações de dicionário de chaves Pix, geração/decodificação de
    QR Code, transações e limites de transações.
  version: 1.0.0
servers:
  - url: https://plugin-pix-indirect.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/transfers/{transfer_id}/unblock:
    post:
      tags:
        - Transactions API
      summary: Desbloquear uma Transferência Pix
      description: |-
        Use este endpoint para desbloquear uma transferência presa no status
        PROCESSING. O plugin obtém o status atual do BTG e dispara a liquidação
        se a transação já tiver sido concluída ou falhado no BTG.
      parameters:
        - $ref: '#/components/parameters/TransferId'
        - $ref: '#/components/parameters/XAccountId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnblockTransferInput'
            example:
              allowNotFoundUnblock: false
      responses:
        '200':
          description: Desbloqueio da transferência processado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnblockTransferOutput'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0001:
                  $ref: '#/components/examples/ErrorPIX0001'
                ErrorPIX0008:
                  $ref: '#/components/examples/ErrorPIX0008'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0426:
                  $ref: '#/components/examples/ErrorPIX0426'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0000:
                  $ref: '#/components/examples/ErrorPIX0000'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX1000:
                  $ref: '#/components/examples/ErrorPIX1000'
      deprecated: false
      security:
        - bearerAuth: []
components:
  parameters:
    TransferId:
      name: transfer_id
      in: path
      description: Identificador único da transferência Pix (formato UUID).
      required: true
      example: 019c96a0-0c21-71f9-a487-66a1258278a1
      schema:
        type: string
    XAccountId:
      name: X-Account-Id
      in: header
      description: Identificador único da Conta do Ledger Midaz (formato UUID).
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
  schemas:
    UnblockTransferInput:
      type: object
      properties:
        allowNotFoundUnblock:
          type: boolean
          default: false
          description: >-
            Habilita o caminho de resolução não-encontrado. Quando true e o BTG
            retorna

            HTTP 404 para o EndToEndID da transferência, o fluxo de desbloqueio
            reverte o

            bloqueio (hold) no Midaz (se houver) e marca o cashout como FAILED
            com

            failedReason=BTG_NOT_FOUND, em vez de retornar um erro do provedor.

            Aplica-se apenas a transferências CASHOUT no status PENDING ou
            PROCESSING.
    UnblockTransferOutput:
      type: object
      required:
        - transfer
      properties:
        btgStatus:
          type: string
          description: Status obtido do BTG (para transparência).
          example: CONFIRMED
        message:
          type: string
          description: Contexto adicional sobre o resultado do desbloqueio.
          example: Transação desbloqueada e concluída com sucesso
        transfer:
          $ref: '#/components/schemas/TransferObject'
    ErrorFormat:
      type: object
      description: A mensagem de erro da resposta.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Um identificador único e estável para o erro.
        title:
          type: string
          description: Um breve resumo do problema.
        message:
          type: string
          description: Orientação detalhada para resolver o erro.
    TransferObject:
      type: object
      properties:
        id:
          type: string
          description: Identificador único da transferência.
          example: 019c96a0-0c21-71f9-a487-66a1258278a1
        endToEndId:
          type: string
          description: Identificador end-to-end.
          example: E123456789BR1234567890123456789
        amount:
          type: string
          description: Valor da transferência.
          example: '100.00'
        status:
          type: string
          description: Status da transferência.
          enum:
            - PENDING
            - PROCESSING
            - COMPLETED
            - FAILED
            - CANCELLED
          example: COMPLETED
        type:
          type: string
          description: Tipo de transferência.
          enum:
            - CASHOUT
            - CASHIN
          example: CASHOUT
        createdAt:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
  examples:
    ErrorPIX0001:
      summary: Missing Headers in Request
      value:
        code: PIX-0001
        title: Missing Headers in Request
        message: >-
          Your request is missing one or more required header params. Please
          refer to the documentation to ensure all necessary header params are
          included in your request.
    ErrorPIX0008:
      summary: Invalid Path Parameter in Request
      value:
        code: PIX-0008
        title: Invalid Path Parameter in Request
        message: >-
          One or more path parameters are invalid. Please refer to the
          documentation to verify the expected format and allowed values for
          each path parameter.
    ErrorPIX0426:
      summary: Transfer Not Found
      value:
        code: PIX-0426
        title: Transfer Not Found
        message: The transfer was not found.
    ErrorPIX0000:
      summary: Internal Server Error
      value:
        code: PIX-0000
        title: Internal Server Error
        message: The server encountered an unexpected error. Please try again later.
    ErrorPIX1000:
      summary: Provider Connection Error
      value:
        code: PIX-1000
        title: Provider Connection Error
        message: Failed to connect to provider.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````