> ## 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 un reembolso Pix

> Usa este endpoint para desbloquear un reembolso atascado en estado
PROCESSING. El plugin obtiene el estado de la reversión en BTG y activa la
liquidación si la reversión ya se completó o falló en BTG.



## OpenAPI

````yaml es/openapi/v3-current/indirect-pix.yaml POST /v1/refunds/{refund_id}/unblock
openapi: 3.0.3
info:
  title: Plugin BR Pix Indirect - API completa
  description: |
    API completa para el sistema de pagos instantáneos Pix de Brasil, que
    incluye operaciones del diccionario de claves Pix, generación/decodificación
    de códigos QR, transacciones y límites transaccionales.
  version: 1.0.0
servers:
  - url: https://plugin-pix-indirect.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/refunds/{refund_id}/unblock:
    post:
      tags:
        - Transactions API
      summary: Desbloquear un reembolso Pix
      description: >-
        Usa este endpoint para desbloquear un reembolso atascado en estado

        PROCESSING. El plugin obtiene el estado de la reversión en BTG y activa
        la

        liquidación si la reversión ya se completó o falló en BTG.
      parameters:
        - $ref: '#/components/parameters/RefundId'
        - $ref: '#/components/parameters/XAccountId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnblockRefundInput'
            example:
              allowNotFoundUnblock: false
      responses:
        '200':
          description: Desbloqueo del reembolso procesado correctamente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnblockRefundOutput'
        '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:
                ErrorPIX0427:
                  $ref: '#/components/examples/ErrorPIX0427'
        '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:
    RefundId:
      name: refund_id
      in: path
      description: Identificador único de la solicitud de devolución (formato UUID).
      required: true
      example: 019c96a0-0c6b-7166-8510-b262039b4838
      schema:
        type: string
    XAccountId:
      name: X-Account-Id
      in: header
      description: Identificador único de la cuenta del Ledger de Midaz (formato UUID).
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
  schemas:
    UnblockRefundInput:
      type: object
      properties:
        allowNotFoundUnblock:
          type: boolean
          default: false
          description: >-
            Habilita la vía de resolución de no encontrado para devoluciones
            CASHOUT. Cuando es

            true y BTG reporta la reversión como ausente (404), la devolución se

            resuelve como FAILED (con reversión idempotente de Midaz y webhook
            al cliente)

            en lugar de devolver un error del proveedor.
    UnblockRefundOutput:
      type: object
      required:
        - refund
      properties:
        btgStatus:
          type: string
          description: Estado recuperado de BTG (por transparencia).
          example: CONFIRMED
        message:
          type: string
          description: Contexto adicional sobre el resultado del desbloqueo.
          example: Reversal successfully unblocked.
        refund:
          $ref: '#/components/schemas/RefundObject'
    ErrorFormat:
      type: object
      description: El mensaje de error de la respuesta.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Un identificador único y estable para el error.
        title:
          type: string
          description: Un breve resumen del problema.
        message:
          type: string
          description: Orientación detallada para resolver el error.
    RefundObject:
      type: object
      properties:
        id:
          type: string
          description: Identificador único de la devolución.
          example: 019c96a0-0c53-7a8d-8e29-67971d96d0e3
        originalEndToEndId:
          type: string
          description: ID E2E de la transferencia original.
          example: E123456789BR1234567890123456789
        returnEndToEndId:
          type: string
          description: ID E2E de la transferencia de retorno.
          example: D123456789BR1234567890123456789
        amount:
          type: string
          description: Monto de la devolución.
          example: '100.00'
        status:
          type: string
          description: Estado de la devolución.
          example: COMPLETED
        reason:
          type: string
          description: Código del motivo de la devolución.
          example: FR01
        createdAt:
          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.
    ErrorPIX0427:
      summary: Refund Not Found
      value:
        code: PIX-0427
        title: Refund Not Found
        message: The refund 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

````