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

# Cancel a Refund Request

> Use this endpoint to cancel a refund request before it is processed.


**Notes:**

- Cancellation is only allowed for requests in OPEN status.

- Cancelled requests cannot be reopened or modified.

- This operation notifies BACEN and the contested participant.



## OpenAPI

````yaml /en/openapi/v3-current/indirect-pix.yaml post /v1/dict/refund-requests/{refund_id}/cancel
openapi: 3.0.3
info:
  title: Plugin BR Pix Indirect - Complete API
  description: |
    Complete API for Brazilian Pix instant payment system including
    Pix key dictionary operations, QR code generation/decoding, transactions and
    transaction limits.
  version: 1.0.0
servers:
  - url: https://plugin-pix-indirect.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/dict/refund-requests/{refund_id}/cancel:
    post:
      tags:
        - MED API
      summary: Cancel a Refund Request
      description: |-
        Use this endpoint to cancel a refund request before it is processed.


        **Notes:**

        - Cancellation is only allowed for requests in OPEN status.

        - Cancelled requests cannot be reopened or modified.

        - This operation notifies BACEN and the contested participant.
      parameters:
        - $ref: '#/components/parameters/RefundId'
      responses:
        '200':
          description: Refund request cancelled successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundRequestObject'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0001:
                  $ref: '#/components/examples/ErrorPIX0001'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0234:
                  $ref: '#/components/examples/ErrorPIX0234'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0239:
                  $ref: '#/components/examples/ErrorPIX0239'
                ErrorPIX0244:
                  $ref: '#/components/examples/ErrorPIX0244'
                ErrorPIX1069:
                  $ref: '#/components/examples/ErrorPIX1069'
        '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:
    RefundId:
      name: refund_id
      in: path
      description: Unique identifier of the refund request (UUID format).
      required: true
      example: 019c96a0-0c6b-7166-8510-b262039b4838
      schema:
        type: string
  schemas:
    RefundRequestObject:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier.
          example: 019c96a0-0c6b-7166-8510-b262039b4838
        transactionId:
          type: string
          description: Original transaction ID.
          example: E12345678202411241430ABCDEFGHIJK
        amount:
          type: string
          description: Refund amount.
          example: '150.00'
        status:
          type: string
          description: Current status.
          enum:
            - OPEN
            - CLOSED
            - CANCELLED
          example: OPEN
        analysisResult:
          type: string
          description: Analysis result.
          example: TOTALLY_ACCEPTED
        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: The response message error.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
  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.
    ErrorPIX0234:
      summary: Refund Request Not Found
      value:
        code: PIX-0234
        title: Refund Request Not Found
        message: The specified refund request was not found.
    ErrorPIX0239:
      summary: Cannot Cancel Request
      value:
        code: PIX-0239
        title: Cannot Cancel Request
        message: >-
          The request cannot be cancelled because it is already in CLOSED or
          CANCELLED status.
    ErrorPIX0244:
      summary: Refund Request Already Cancelled
      value:
        code: PIX-0244
        title: Refund Request Already Cancelled
        message: The refund request is already cancelled.
    ErrorPIX1069:
      summary: Cannot Cancel Request
      value:
        code: PIX-1069
        title: Cannot Cancel Request
        message: >-
          The provider reports that the request cannot be cancelled due to its
          current state.
    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

````