Decode QR Code

Decodes a QR Code from a base64 image or EMV BR Code payload string. Returns structured information including QR Code type (STATIC/DYNAMIC), PIX key, amount, merchant info, txid, and location URL. Automatically detects if input is a base64 image or EMV payload (starting with '0002'). For dynamic QR Codes, resolves the location URL to fetch charge details. Requires Idempotency-Key header; payerDocument is provided in the request body and is forwarded to the keys service when resolving the PIX key for static QR Codes.

Headers
  • Idempotency-Key
    Type: string
    required

    Unique idempotency key

Body·
required
application/json

Request to decode a QR Code from base64 image or EMV payload

  • payerDocument
    Type: string
    min length:  
    1
    Pattern: \d{11}|\d{14}
    required

    Payer document (CPF or CNPJ digits only); forwarded to keys API on static QR key lookup.

  • qrCode
    Type: string
    min length:  
    1
    required

    QR Code image in base64 format (with or without data URI prefix).

  • codMun
    Type: string Pattern: \d{7}

    IBGE municipality code of the payer (7 digits); forwarded on COBV location fetch.

  • dataPagamento
    Type: string Format: date

    Intended payment date (DPP). For dynamic COBV, forwarded to the receiver when fetching the location URL so the final amount reflects discounts/interest/fines on that date.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/api/v1/charges/decode
curl http://localhost:8080/api/v1/charges/decode \
  --request POST \
  --header 'Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "qrCode": "",
  "payerDocument": "",
  "dataPagamento": "",
  "codMun": ""
}'
{
  "type": "STATIC",
  "emv": "string",
  "key": "string",
  "value": "string",
  "merchant": {
    "name": "string",
    "city": "string",
    "taxId": "string"
  },
  "txid": "string",
  "locationUrl": "string",
  "additionalInfo": "string",
  "status": "ACTIVE",
  "revision": 1,
  "calendar": {
    "createdAt": "2026-07-29T19:28:46.582Z",
    "expiresAt": "2026-07-29T19:28:46.582Z",
    "expiration": 1,
    "dueDate": "2026-07-29T19:28:46.582Z"
  },
  "debtor": {
    "cpf": "string",
    "cnpj": "string",
    "name": "string"
  },
  "receiver": {
    "taxId": "string",
    "name": "string",
    "tradeName": "string",
    "uf": "string",
    "accountIspb": "string",
    "accountType": "string",
    "accountBranch": "string",
    "accountNumber": "string"
  },
  "additionalInfoList": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "cobvFinalAmountBreakdown": {
    "dataPagamento": "string",
    "codMun": "string",
    "valorOriginal": "string",
    "abatimentoAplicado": "string",
    "descontoAplicado": "string",
    "jurosAplicado": "string",
    "multaAplicada": "string",
    "valorFinal": "string"
  },
  "ispb": "string",
  "endToEndId": "string"
}