> ## 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 EMV payload

> Parses a Pix EMV payload and returns the structured payment details. Third-party payloads are accepted, so decoding is more permissive than BR Code creation: a payload without a Point of Initiation method is decoded as `STATIC`. `keyType` is inferred from the key value and omitted when no key type defined by the BCB both matches the value and passes validation. See the response schema for the rules that apply to each field.



## OpenAPI

````yaml /es/openapi/v3-current/pix-lerian-cob.yaml post /brcodes/decode
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Public API for Pix BR Codes and immediate and due-date collections. This
    release provides a mock-provider integration for testing; live BACEN
    connectivity is not included.
  license:
    name: Lerian Studio General License
  title: Pix Lerian — Collections
  version: 1.0.0
servers:
  - url: https://api.example.com/cob-hub/v1
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: Create, retrieve, list, and decode static Pix BR Codes.
    name: BR Codes
  - description: Create, retrieve, list, and cancel due-date Pix collections.
    name: Due-Date Collections
  - description: Create, retrieve, list, and cancel immediate Pix collections.
    name: Immediate Collections
paths:
  /brcodes/decode:
    post:
      tags:
        - BR Codes
      summary: Decode a Pix EMV payload
      description: >-
        Parses a Pix EMV payload and returns the structured payment details.
        Third-party payloads are accepted, so decoding is more permissive than
        BR Code creation: a payload without a Point of Initiation method is
        decoded as `STATIC`. `keyType` is inferred from the key value and
        omitted when no key type defined by the BCB both matches the value and
        passes validation. See the response schema for the rules that apply to
        each field.
      operationId: decodeQRCode
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecodeQRCodeBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecodeQRCodeOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0221
                title: Bad Request
                status: 400
                detail: QR code could not be parsed.
                code: PIX-0221
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Missing or malformed request data, or an EMV payload that cannot be
            decoded as a valid Pix QR Code (PIX-0002, PIX-0003, PIX-0010,
            PIX-0200, PIX-0221).
        '415':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0016
                title: Unsupported Media Type
                status: 415
                detail: >-
                  The request body must be sent with Content-Type:
                  application/json.
                code: PIX-0016
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The non-empty request body is missing an accepted JSON Content-Type
            (PIX-0016).
        '500':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0000
                title: Internal Server Error
                status: 500
                detail: >-
                  The server encountered an unexpected error. Please try again
                  later.
                code: PIX-0000
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unexpected server error (PIX-0000).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    DecodeQRCodeBody:
      additionalProperties: false
      properties:
        emvPayload:
          description: EMV BR Code payload to decode
          examples:
            - >-
              00020101021126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano
              de Tal6008BRASILIA62070503***630448CD
          type: string
      required:
        - emvPayload
      type: object
    DecodeQRCodeOutput:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '100.50'
          type: string
        currency:
          enum:
            - BRL
          examples:
            - BRL
          type: string
        description:
          examples:
            - Pagamento do pedido 12345
          type: string
        expiresAt:
          examples:
            - '2026-05-06T11:30:00Z'
          format: date-time
          type: string
        isReusable:
          description: >-
            Whether the BR Code may be paid more than once. True for every
            STATIC payload, including one whose Point of Initiation method is
            absent.
          examples:
            - true
          type: boolean
        keyType:
          description: >-
            Pix key type inferred from keyValue, ABSENT when no type both
            matches and validates. A CPF/CNPJ must satisfy its Modulo 11 check
            digits — a document that does not is unregistrable at DICT, so no
            type is reported. A masked document ("529.982.247-25") IS
            recognised. A phone is any E.164 number, not only "+55".
          enum:
            - CPF
            - CNPJ
            - PHONE
            - EMAIL
            - EVP
          examples:
            - EVP
          type: string
        keyValue:
          description: >-
            Pix key exactly as the payload carries it, punctuation included. It
            is never normalized: this endpoint reports what was scanned.
          examples:
            - 123e4567-e12b-12d1-a456-426655440000
          type: string
        merchantCity:
          examples:
            - Goiania
          type: string
        merchantName:
          examples:
            - Loja Teste
          type: string
        txId:
          examples:
            - TX12345
          type: string
        type:
          description: >-
            Type embedded in the payload. A payload that names NO Point of
            Initiation method (EMV tag 01 absent) is reported as STATIC: EMVCo
            makes the element optional and defines its absence as static, and
            BACEN's own composed QR Code examples omit it. Such a payload was
            previously rejected as malformed.
          enum:
            - STATIC
            - DYNAMIC_IMMEDIATE
            - DYNAMIC_DUEDATE
          examples:
            - STATIC
          type: string
      required:
        - type
        - merchantName
        - merchantCity
        - isReusable
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````