> ## 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 en/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.
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Pix Lerian — Collections
  version: release-candidate
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 immediate Pix collections.
    name: Immediate Collections
  - description: Create, retrieve, list, and cancel due-date Pix collections.
    name: Due-Date 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'
            examples:
              fictitiousExample:
                summary: Fictitious example
                value:
                  emvPayload: >-
                    00020101021126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano
                    de Tal6008BRASILIA62070503***630448CD
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecodeQRCodeOutput'
              examples:
                fictitiousExample:
                  summary: Fictitious example
                  value:
                    amount: '100.50'
                    currency: BRL
                    description: Pagamento do pedido 12345
                    expiresAt: '2026-05-06T11:30:00Z'
                    isReusable: true
                    keyType: EVP
                    keyValue: 123e4567-e12b-12d1-a456-426655440000
                    merchantCity: Goiania
                    merchantName: Loja Teste
                    txId: TX12345
                    type: STATIC
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      x-codeSamples:
        - lang: bash
          label: cURL with fictitious data
          source: |-
            curl --request POST \
              --url https://api.example.com/cob-hub/v1/brcodes/decode \
              --header 'Authorization: Bearer demo-access-token' \
              --header 'Content-Type: application/json' \
              --data '{
              "emvPayload": "00020101021126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630448CD"
            }'
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
            BCB'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

````