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

# Encerrar um relato de infração

> Use este endpoint para enviar a análise de encerramento de um relato de
infração recebido. Este endpoint deve ser usado para responder a
infrações relatadas ao seu PSP, ou seja, quando a conta foi a receptora
da transação relatada como fraude, dentro de 7 dias, com o resultado da
análise.


**Notas:**

- Encerrar um relato define seu status como CLOSED e registra o
resultado da análise.

- Uma vez encerrado, o relato não pode ser modificado.

- Para infrações de `REFUND_REQUEST`, o relato deve ser encerrado pelo
PSP do recebedor.

- Para infrações de `REFUND_CANCELLED`, o relato deve ser encerrado pelo
PSP do pagador.



## OpenAPI

````yaml pt/openapi/v3-current/indirect-pix.yaml POST /v1/dict/infraction-reports/{infraction_id}/close
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/dict/infraction-reports/{infraction_id}/close:
    post:
      tags:
        - MED API
      summary: Encerrar um relato de infração
      description: |-
        Use este endpoint para enviar a análise de encerramento de um relato de
        infração recebido. Este endpoint deve ser usado para responder a
        infrações relatadas ao seu PSP, ou seja, quando a conta foi a receptora
        da transação relatada como fraude, dentro de 7 dias, com o resultado da
        análise.


        **Notas:**

        - Encerrar um relato define seu status como CLOSED e registra o
        resultado da análise.

        - Uma vez encerrado, o relato não pode ser modificado.

        - Para infrações de `REFUND_REQUEST`, o relato deve ser encerrado pelo
        PSP do recebedor.

        - Para infrações de `REFUND_CANCELLED`, o relato deve ser encerrado pelo
        PSP do pagador.
      parameters:
        - $ref: '#/components/parameters/InfractionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseInfractionReportInput'
            example:
              analysisResult: AGREED
              analysisDetails: A análise confirma um padrão de atividade fraudulenta
      responses:
        '200':
          description: Relato de infração encerrado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InfractionReportObject'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0001:
                  $ref: '#/components/examples/ErrorPIX0001'
                ErrorPIX0003:
                  $ref: '#/components/examples/ErrorPIX0003'
                ErrorPIX0004:
                  $ref: '#/components/examples/ErrorPIX0004'
                ErrorPIX0208:
                  $ref: '#/components/examples/ErrorPIX0208'
                ErrorPIX0209:
                  $ref: '#/components/examples/ErrorPIX0209'
                ErrorPIX0210:
                  $ref: '#/components/examples/ErrorPIX0210'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0216:
                  $ref: '#/components/examples/ErrorPIX0216'
                ErrorPIX0217:
                  $ref: '#/components/examples/ErrorPIX0217'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0200:
                  $ref: '#/components/examples/ErrorPIX0200'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0207:
                  $ref: '#/components/examples/ErrorPIX0207'
                ErrorPIX0223:
                  $ref: '#/components/examples/ErrorPIX0223'
        '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'
                ErrorPIX1007:
                  $ref: '#/components/examples/ErrorPIX1007'
                ErrorPIX1099:
                  $ref: '#/components/examples/ErrorPIX1099'
      deprecated: false
      security:
        - bearerAuth: []
components:
  parameters:
    InfractionId:
      name: infraction_id
      in: path
      description: Identificador único do relatório de infração (formato UUID).
      required: true
      example: 019c96a0-0c98-799e-9135-4613ca469ad8
      schema:
        type: string
  schemas:
    CloseInfractionReportInput:
      type: object
      required:
        - analysisResult
      properties:
        analysisResult:
          type: string
          description: Resultado da análise.
          enum:
            - AGREED
            - DISAGREED
          example: AGREED
        analysisDetails:
          type: string
          description: Comentários detalhados da análise.
          example: A análise confirma padrão de atividade fraudulenta
    InfractionReportObject:
      type: object
      properties:
        id:
          type: string
          description: Identificador único.
          example: 019c96a0-0c98-799e-9135-4613ca469ad8
        transactionId:
          type: string
          description: Identificador da transação SPI.
          example: E12345678202411241430ABCDEFGHIJK
        status:
          type: string
          description: Status atual.
          enum:
            - OPEN
            - ACKNOWLEDGED
            - CLOSED
            - CANCELLED
          example: OPEN
        reason:
          type: string
          description: Motivo da infração.
          example: REFUND_REQUEST
        reporterParticipant:
          type: string
          description: ISPB do participante reportador.
          example: '12345678'
        counterpartyParticipant:
          type: string
          description: ISPB da contraparte.
          example: '87654321'
        analysisResult:
          type: string
          description: Resultado da análise do BACEN.
          example: AGREED
        createdAt:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
    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.
  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.
    ErrorPIX0003:
      summary: Missing Fields in Request
      value:
        code: PIX-0003
        title: Missing Fields in Request
        message: >-
          Your request is missing one or more required fields. Please refer to
          the documentation to ensure all necessary fields are included in your
          request.
    ErrorPIX0004:
      summary: Invalid Field Values in Request
      value:
        code: PIX-0004
        title: Invalid Field Values in Request
        message: >-
          Your request contains one or more fields with invalid values. Please
          refer to the documentation to verify that all fields have the correct
          values.
    ErrorPIX0208:
      summary: Infraction Fraud Type Required
      value:
        code: PIX-0208
        title: Infraction Fraud Type Required
        message: The fraud type is required when analysis result is AGREED.
    ErrorPIX0209:
      summary: Infraction Analysis Details Required
      value:
        code: PIX-0209
        title: Infraction Analysis Details Required
        message: The analysis details are required when fraud type is OTHER.
    ErrorPIX0210:
      summary: Infraction Analysis Details Too Long
      value:
        code: PIX-0210
        title: Infraction Analysis Details Too Long
        message: >-
          The analysis details exceed the maximum allowed length of 2000
          characters.
    ErrorPIX0216:
      summary: Unauthorized to Close Refund Request
      value:
        code: PIX-0216
        title: Unauthorized to Close Refund Request
        message: A refund request infraction report must be closed by the payee's PSP.
    ErrorPIX0217:
      summary: Unauthorized to Close Cancellation Report
      value:
        code: PIX-0217
        title: Unauthorized to Close Cancellation Report
        message: >-
          A cancellation of refund infraction report must be closed by the
          payer's PSP.
    ErrorPIX0200:
      summary: Infraction Report Not Found
      value:
        code: PIX-0200
        title: Infraction Report Not Found
        message: The infraction report was not found.
    ErrorPIX0207:
      summary: Infraction Report Cannot Be Closed
      value:
        code: PIX-0207
        title: Infraction Report Cannot Be Closed
        message: The infraction report cannot be closed in current status.
    ErrorPIX0223:
      summary: Infraction Report Cannot Be Acknowledged
      value:
        code: PIX-0223
        title: Infraction Report Cannot Be Acknowledged
        message: The infraction report cannot be acknowledged in current status.
    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.
    ErrorPIX1007:
      summary: Provider Internal Error
      value:
        code: PIX-1007
        title: Provider Internal Error
        message: Provider returned an internal error.
    ErrorPIX1099:
      summary: Provider Unmapped Error
      value:
        code: PIX-1099
        title: Provider Unmapped Error
        message: Provider returned an unmapped error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````