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

# Create a Refund Request

> Use this endpoint to open a refund request for a Pix transaction.


**Notes:**

- Refund requests must be associated with a valid Pix transaction.

- Requests can optionally be linked to an infraction report.

- The contested participant must respond within the specified timeframe.



## OpenAPI

````yaml /en/openapi/v3-current/indirect-pix.yaml post /v1/dict/refund-requests
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:
    post:
      tags:
        - MED API
      summary: Create a Refund Request
      description: |-
        Use this endpoint to open a refund request for a Pix transaction.


        **Notes:**

        - Refund requests must be associated with a valid Pix transaction.

        - Requests can optionally be linked to an infraction report.

        - The contested participant must respond within the specified timeframe.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRefundRequestInput'
            example:
              transactionId: E12345678202411241430ABCDEFGHIJK
              amount: '150.00'
              infractionId: 019c96a0-0c98-799e-9135-4613ca469ad8
      responses:
        '201':
          description: Refund request created 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'
                ErrorPIX0003:
                  $ref: '#/components/examples/ErrorPIX0003'
                ErrorPIX0004:
                  $ref: '#/components/examples/ErrorPIX0004'
                ErrorPIX0230:
                  $ref: '#/components/examples/ErrorPIX0230'
                ErrorPIX0231:
                  $ref: '#/components/examples/ErrorPIX0231'
                ErrorPIX0232:
                  $ref: '#/components/examples/ErrorPIX0232'
                ErrorPIX0233:
                  $ref: '#/components/examples/ErrorPIX0233'
                ErrorPIX0240:
                  $ref: '#/components/examples/ErrorPIX0240'
                ErrorPIX0241:
                  $ref: '#/components/examples/ErrorPIX0241'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0242:
                  $ref: '#/components/examples/ErrorPIX0242'
                ErrorPIX1065:
                  $ref: '#/components/examples/ErrorPIX1065'
        '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:
  schemas:
    CreateRefundRequestInput:
      type: object
      required:
        - transactionId
        - amount
      properties:
        transactionId:
          type: string
          description: Original Pix transaction ID.
          example: E12345678202411241430ABCDEFGHIJK
        amount:
          type: string
          description: Refund amount.
          example: '150.00'
        infractionId:
          type: string
          description: Related infraction report ID.
          example: 019c96a0-0c98-799e-9135-4613ca469ad8
    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.
    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.
    ErrorPIX0230:
      summary: Invalid Refund Amount Format
      value:
        code: PIX-0230
        title: Invalid Refund Amount Format
        message: >-
          The refund amount must be in decimal format with exactly 2 decimal
          places (e.g., 100.50).
    ErrorPIX0231:
      summary: Refund Details Too Long
      value:
        code: PIX-0231
        title: Refund Details Too Long
        message: >-
          The refund details exceed the maximum allowed length of 2000
          characters.
    ErrorPIX0232:
      summary: Refund Amount Exceeds Transaction
      value:
        code: PIX-0232
        title: Refund Amount Exceeds Transaction
        message: The refund amount cannot exceed the original transaction amount.
    ErrorPIX0233:
      summary: Missing Refund Details
      value:
        code: PIX-0233
        title: Missing Refund Details
        message: >-
          The refundDetails field is required when refundReason is
          OPERATIONAL_FLAW.
    ErrorPIX0240:
      summary: Missing Infraction Report
      value:
        code: PIX-0240
        title: Missing Infraction Report
        message: >-
          A refund request with reason FRAUD requires a prior infraction report
          that has been closed with AGREED result.
    ErrorPIX0241:
      summary: Infraction Report Expired
      value:
        code: PIX-0241
        title: Infraction Report Expired
        message: >-
          The infraction report was closed more than 72 hours ago. Refund
          requests must be created within 72 hours of infraction report closure.
    ErrorPIX0242:
      summary: Duplicate Refund Request
      value:
        code: PIX-0242
        title: Duplicate Refund Request
        message: A refund request already exists for this transaction.
    ErrorPIX1065:
      summary: Duplicate Refund Request
      value:
        code: PIX-1065
        title: Duplicate Refund Request
        message: >-
          The provider reports that a refund request already exists for this
          transaction.
    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

````