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

# Decode a Pix QR Code

> Use this endpoint to decode a Pix BR Code payload and extract the
payment data it contains. This service supports all Pix QR Code types:
static, immediate collections, and due date collections.



## OpenAPI

````yaml /en/openapi/v3-current/indirect-pix.yaml post /v1/qrcodes/decode
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/qrcodes/decode:
    post:
      tags:
        - QR Codes API
      summary: Decode a Pix QR Code
      description: |-
        Use this endpoint to decode a Pix BR Code payload and extract the
        payment data it contains. This service supports all Pix QR Code types:
        static, immediate collections, and due date collections.
      parameters:
        - $ref: '#/components/parameters/XAccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecodeInput'
            example:
              emv: 00020126580014br.gov.bcb.pix...
      responses:
        '200':
          description: |-
            Successfully decoded the Pix BR Code payload. Response type varies
            based on QR code type (STATIC, IMMEDIATE, or DUE_DATE).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecodeOutput'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0001:
                  $ref: '#/components/examples/ErrorPIX0001'
                ErrorPIX0003:
                  $ref: '#/components/examples/ErrorPIX0003'
                ErrorPIX0300:
                  $ref: '#/components/examples/ErrorPIX0300'
                ErrorPIX0301:
                  $ref: '#/components/examples/ErrorPIX0301'
                ErrorPIX0302:
                  $ref: '#/components/examples/ErrorPIX0302'
                ErrorPIX0303:
                  $ref: '#/components/examples/ErrorPIX0303'
                ErrorPIX0304:
                  $ref: '#/components/examples/ErrorPIX0304'
                ErrorPIX0314:
                  $ref: '#/components/examples/ErrorPIX0314'
                ErrorPIX0315:
                  $ref: '#/components/examples/ErrorPIX0315'
                ErrorPIX0317:
                  $ref: '#/components/examples/ErrorPIX0317'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0316:
                  $ref: '#/components/examples/ErrorPIX0316'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0000:
                  $ref: '#/components/examples/ErrorPIX0000'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorPIX0330:
                  $ref: '#/components/examples/ErrorPIX0330'
      deprecated: false
      security:
        - bearerAuth: []
components:
  parameters:
    XAccountId:
      name: X-Account-Id
      in: header
      description: Unique identifier of the Midaz Ledger Account (UUID format).
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
  schemas:
    DecodeInput:
      type: object
      required:
        - emv
      properties:
        emv:
          type: string
          description: EMV QR Code payload string to decode.
          example: 00020126580014br.gov.bcb.pix...
        paymentDate:
          type: string
          description: Payment date in ISO8601 format (optional, used for COBV).
          example: '2024-12-31'
        cityCode:
          type: string
          description: City code for the payment context (optional, used for COBV).
          example: '3550308'
    DecodeOutput:
      type: object
      properties:
        type:
          type: string
          description: QR Code type.
          enum:
            - STATIC
            - IMMEDIATE
            - DUE_DATE
          example: STATIC
        receiverKey:
          type: string
          description: Pix key that will receive the payment.
          example: '+5511999999999'
        amount:
          type: string
          description: Payment amount.
          example: '100.00'
        description:
          type: string
          description: Payment description.
        txId:
          type: string
          description: Transaction identifier.
    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.
    ErrorPIX0300:
      summary: Invalid EMV Format
      value:
        code: PIX-0300
        title: Invalid EMV Format
        message: >-
          The EMV payload does not follow the valid EMV QCO format
          specification.
    ErrorPIX0301:
      summary: Corrupted QR Code
      value:
        code: PIX-0301
        title: Corrupted QR Code
        message: The QR Code data is corrupted and cannot be decoded.
    ErrorPIX0302:
      summary: Unsupported QR Code Version
      value:
        code: PIX-0302
        title: Unsupported QR Code Version
        message: The QR Code version or format is not supported.
    ErrorPIX0303:
      summary: Invalid Payment Date
      value:
        code: PIX-0303
        title: Invalid Payment Date
        message: The payment date exceeds the valid payment period.
    ErrorPIX0304:
      summary: Invalid Amount
      value:
        code: PIX-0304
        title: Invalid Amount
        message: >-
          The amount must be greater than zero and follow the 0.00 format with
          two decimals.
    ErrorPIX0314:
      summary: EMV Required
      value:
        code: PIX-0314
        title: EMV Required
        message: The EMV is required.
    ErrorPIX0315:
      summary: Empty EMV Payload
      value:
        code: PIX-0315
        title: Empty EMV Payload
        message: The EMV payload cannot be empty.
    ErrorPIX0317:
      summary: Invalid City Code
      value:
        code: PIX-0317
        title: Invalid City Code
        message: The city code is invalid.
    ErrorPIX0316:
      summary: EMV Not Found
      value:
        code: PIX-0316
        title: EMV Not Found
        message: The EMV QR Code 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.
    ErrorPIX0330:
      summary: Service Unavailable
      value:
        code: PIX-0330
        title: Service Unavailable
        message: The decode service is temporarily unavailable.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````