Skip to main content

Decode Pix QR Code

Decodes a Pix QR Code returning the data contained in the payload. It does not perform a DICT lookup on the destination account and does not persist the consulted QR Code — suitable for preview flows prior to a payment decision.

Request

ENDPOINT
/pix/decode_qrcode_payload
METHOD
POST
Request Body
{
"qr_code_payload": "00020126580014br.gov.bcb.pix0136a23bf0e9-5175-4829-bf89-e8fe6ac09aa1520400005303986540530.005802BR5914TywinLannister6008saopaulo62070503***6304D4FD"
}

Body Params

FieldTypeDescriptionCharacters
qr_code_payload *stringPix Copy and Paste-

Response

STATUS
200
Response Body: Static QR Code
{
"qr_code_type": "static",
"qr_code_payload": "00020126580014br.gov.bcb.pix0136a23bf0e9-5175-4829-bf89-e8fe6ac09aa1520400005303986540530.005802BR5914TywinLannister6008saopaulo62070503***6304D4FD",
"pix_key": "a23bf0e9-5175-4829-bf89-e8fe6ac09aa1",
"transfer_amount": "30.00",
"additional_data": null,
"qr_code_data": {
"target_pix_key": "a23bf0e9-5175-4829-bf89-e8fe6ac09aa1",
"amount": "30.00",
"receiver_conciliation_id": "***",
"additional_data": [],
"category_code": "0000",
"city": "saopaulo",
"postal_code": null,
"reusable_qrcode": "no"
}
}
STATUS
200
Response Body: Dynamic QR Code — immediate payment
{
"qr_code_type": "dynamic_instant",
"qr_code_payload": "00020101021226850014br.gov.bcb.pix2563qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a9b8285204000053039865802BR5925TESTE62070503***63047B7D",
"pix_key": "teste.cobrancapix@gmail.com.br",
"receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
"amount": "9367.61",
"status": "ATIVA",
"qr_code_data": {
"target_pix_key": "teste.cobrancapix@gmail.com.br",
"receiver_conciliation_id": "fgnb4NTt7pOUBGfrcporERwVVqr0f8PWRfK",
"amount": "9367.61",
"can_change": "no",
"expiration_seconds": 201574,
"created_at": "2023-03-13T19:00:28.440Z",
"presented_at": "2023-03-14T19:07:48.729Z",
"question_to_payer": "Liquidacao de Parcelas",
"status": "ATIVA",
"revision": 0,
"category_code": "0000",
"city": "RIO DE JANEIRO",
"postal_code": null,
"reusable_qrcode": "no",
"receiver_url": "qrcodepix.bb.com.br/pix/v2/d373e385-dfe7-49f6-b9ec-14ba60a90000",
"additional_data": [],
"payer_name": "ISMAEL FATIMA AMARAL",
"payer_document_number": "10003550206",
"payer_person_type": "natural",
"target_name": "TESTE LTDA.",
"target_trading_name": null,
"address": "Rua Tapajos, 941",
"state": "RJ"
}
}
STATUS
200
Response Body: Dynamic QR Code — with due date
{
"qr_code_type": "dynamic_term",
"qr_code_payload": "00020101021226840014br.gov.bcb.pix2562invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae35cc123456000053039865802BR5925Oncred Sociedade de Credi6015TESTE 62070503***6304D008",
"pix_key": "e623e7b0-d00a-400e-aee6-79632430e817",
"receiver_conciliation_id": "8b434df48c30482a81f7c936ae35cc87",
"amount": "55.59",
"status": "ATIVA",
"qr_code_data": {
"target_pix_key": "e623e7b0-d00a-400e-aee6-79632430e817",
"receiver_conciliation_id": "8b434df48c30482a81f7c936ae35cc87",
"original_amount": "55.59",
"reduction_amount": null,
"discount_amount": null,
"fee_amount": null,
"fine_amount": null,
"amount": "55.59",
"due_date": "2023-03-27",
"days_after_due_accepted": 16,
"created_at": "2023-01-10T19:49:58.30Z",
"presented_at": "2023-03-10T15:32:15.87Z",
"question_to_payer": null,
"status": "ATIVA",
"revision": 0,
"category_code": "0000",
"reusable_qrcode": "no",
"receiver_url": "invoice.starkbank.com/v2/cobv/8b434df48c30482a81f7c936ae351234",
"additional_data": [],
"payer_name": "Willian Rocha",
"payer_document_number": "00000000000",
"payer_person_type": "natural",
"target_name": "TESTE LTDA.",
"target_trading_name": null,
"address": "Rua Tapajos, 941",
"state": "SP",
"city": "Sao Caetano do Sul",
"postal_code": "09551230"
}
}

Response fields

FieldTypeDescriptionPresent in
qr_code_typestringQR Code type: static, dynamic_instant or dynamic_termAll
qr_code_payloadstringOriginal EMV payload sent in the requestAll
qr_code_data.target_pix_keystringRecipient's Pix keyAll
qr_code_data.amountstring/decimalCharge amount. For dynamic_term, represents the final amount (after fine/interest/discount)All
qr_code_data.receiver_conciliation_idstringRecipient's conciliation identifier (txid)All
qr_code_data.additional_dataarrayList of additional info {name, value}All
qr_code_data.category_codestringMerchant category code (MCC)All
qr_code_data.citystringRecipient's cityAll
qr_code_data.postal_codestringRecipient's ZIP codeAll
qr_code_data.reusable_qrcodestringyes if the QR Code can be paid multiple times, no otherwiseAll
qr_code_data.receiver_urlstringRecipient PSP URL (loc field of BR Code)dynamic_*
qr_code_data.statusstringCharge status (see enumerators below)dynamic_*
qr_code_data.revisionintegerCurrent revision of the chargedynamic_*
qr_code_data.created_atstring (ISO)Charge creation timestamp at the recipient's PSPdynamic_*
qr_code_data.presented_atstring (ISO)Timestamp when the charge was presented to the payerdynamic_*
qr_code_data.question_to_payerstringMessage from the recipient to the payer (solicitacaoPagador)dynamic_*
qr_code_data.payer_namestringExpected payer's name, when informed by the recipientdynamic_*
qr_code_data.payer_document_numberstringExpected payer's CPF/CNPJdynamic_*
qr_code_data.payer_person_typestringnatural or legaldynamic_*
qr_code_data.target_namestringRecipient's namedynamic_*
qr_code_data.expiration_secondsintegerCharge validity in seconds, counted from created_atdynamic_instant
qr_code_data.can_changestringyes if the payer can change the amount, no otherwisedynamic_instant
qr_code_data.original_amountstring/decimalOriginal charge amount before fine/interest/discountdynamic_term
qr_code_data.due_datestring (date)Charge due datedynamic_term
qr_code_data.days_after_due_acceptedintegerDays after the due date during which payment is still accepteddynamic_term
qr_code_data.fine_amountstring/decimalFine applied after the due datedynamic_term
qr_code_data.fee_amountstring/decimalInterest applied after the due datedynamic_term
qr_code_data.discount_amountstring/decimalDiscount granted before the due datedynamic_term
qr_code_data.reduction_amountstring/decimalRebate applied to the chargedynamic_term
qr_code_data.target_trading_namestringRecipient's trading namedynamic_*
qr_code_data.addressstringRecipient's street addressdynamic_*
qr_code_data.statestringRecipient's statedynamic_*
Deprecated root-level fields

The fields below are returned at the root of the response for backward compatibility only and will be removed in a future version. Use the equivalents inside qr_code_data.

FieldEquivalentPresent in
pix_keyqr_code_data.target_pix_keyAll
transfer_amountqr_code_data.amountstatic
additional_dataqr_code_data.additional_datastatic
amountqr_code_data.amountdynamic_*
receiver_conciliation_idqr_code_data.receiver_conciliation_iddynamic_*
statusqr_code_data.statusdynamic_*
Static QR Code

By the BR Code specification, static QR Codes do not contain expected payer data, expiration date, fine, interest, discount nor rebate. Those fields only exist on dynamic QR Codes.

Status

For the dynamic QR Code type, the status of the QR Code is returned according to the enumerator table below.

Dynamic QR Code Status Enumerators

EnumeratorDescription
ATIVACharge available, no payment made
CONCLUIDACharge paid and finalized
REMOVIDA_PELO_USUARIO_RECEBEDORReceiving user requested the charge removal
REMOVIDA_PELO_PSPReceiving bank requested the charge removal

Errors

STATUS
400
Invalid QR Code format
{
"data": "{\"title\": \"Invalid Qr Code Format\", \"description\": \"The Qr Code format is invalid, please enter a valid Qr Code\", \"translation\": \"O formato do Qr Code é inválido, por favor insira um Qr Code válido\", \"extra_fields\": {}, \"code\": \"PXT000070\"}"
}

QR Code type not identified in payload
{
"data": "{\"title\": \"Invalid Qr Code Type\", \"description\": \"The Qr Code payload given did not provide a propper Qr Code type\", \"translation\": \"O payload de QR Code fornecido não contêm um tipo de Qr Code Válido\", \"extra_fields\": {}, \"code\": \"PXT000071\"}"
}

Error processing dynamic QR Code
{
"data": "{\"title\": \"Error in Qr Code Payload Request\", \"description\": \"An error occurred while requesting the qr code payload to the registry institution\", \"translation\": \"Um erro ocorreu durante a requisição do payload do qr code para a instituição de registro\", \"extra_fields\": {}, \"code\": \"PXT000069\"}"
}