Skip to content

/cashin/pix/decode-qrcode-partner Decode PIX QR Code ​

Background ​

Parses the code value string of a PIX payment QR code to obtain the QR code type, amount, whether the amount can be modified, and the receiver's account information. The API only performs decoding; it does not create a payment or payout order and does not initiate any debit. A successful decode does not mean the payment has been made or will definitely succeed.

Endpoint ​

ItemValue
MethodPOST
Path/cashin/pix/decode-qrcode-partner
Content-Typeapplication/json
PurposeDecode a PIX payment QR code

Access Requirements ​

Authentication uses the partner's primary merchant ID and its corresponding credentials. This API does not require a merchant order number or subMerchantNo.

Request Fields ​

FieldLocationTypeLengthRequiredDescription
X-Merchant-IdHeaderstring64YesPrimary merchant ID, read from the request header.
X-TimestampHeaderint19YesUnix request timestamp in seconds.
X-NonceHeaderstring64YesAnti-replay random string for the request.
DigestHeaderstring52YesDigest computed over the request body actually sent, in the format SHA-256=<Base64 digest>.
AuthorizationHeaderstringVariableYesES256 request signature information, where keyId is the partner key version.
qrcodeBodystringUp to 16384 bytesYesThe complete PIX Copy and Paste code value; must not be empty or contain only whitespace. Pass the QR code text, not an image, image URL, or image Base64.
payDateBodystring10NoPayment date in YYYY-MM-DD format, for example 2026-09-07; must be a valid calendar date. If omitted or passed as an empty string, no payment date is specified.

Request Example ​

http
POST /cashin/pix/decode-qrcode-partner HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1788768000
X-Nonce: 550e8400-e29b-41d4-a716-446655440000
Digest: SHA-256=<Base64 digest>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"

Request body example:

json
{
  "qrcode": "00020126580014br.gov.bcb.pix01361234567890123456789012345678901234520400005303986540550.005802BR5925Example Company Name6014CIDADE EXEMPLO62070503***63045ABC",
  "payDate": "2026-09-07"
}

Response Fields ​

The API uses the standard status, msg, and data response structure. The decoded fields in the table below are valid only in a success response; if the request fails, any returned data must not be used as a valid decode result.

FieldTypeDescription
statusintResponse code
msgstringMessage corresponding to status
dataobjectDecode result; may be omitted when the request fails at the authentication or protocol parsing stage.
data.typestringQR code type; see the table below.
data.amountdecimal or nullQR code amount in BRL; null when no amount information is provided.
data.allowsChangeAmountboolean or nullWhether the amount can be modified: true means allowed, false means not allowed, and null means not provided.
data.toPixstringReceiver's Pix key; empty string when not provided.
data.toPixTypestringReceiver's Pix key type; empty string when not provided.
data.toIspbstringISPB code of the receiving institution; treated as a string to preserve leading zeros, empty string when not provided.
data.toNamestringReceiver's name; empty string when not provided.
data.toCpfCnpjstringReceiver's CPF or CNPJ; may be masked, empty string when not provided.
data.agencystringReceiving bank branch number; empty string when not provided.
data.toAccountstringReceiving account number; empty string when not provided.

QR Code Types and Amount ​

typeMeaning
STATICStatic QR code
DYNAMIC_IMMEDIATEDynamic QR code for immediate payment
DYNAMIC_CHARGEDynamic QR code for bills

When amount or allowsChangeAmount is null, do not interpret it as a zero amount or as allowing amount changes. If the returned type is not in the list above, amount and allowsChangeAmount are null; treat it as an unrecognized type.

Response Example ​

The following is an illustrative response for a static QR code; all account and identity information is sample data.

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "type": "STATIC",
    "amount": 125.50,
    "allowsChangeAmount": false,
    "toPix": "receiver@example.com",
    "toPixType": "EMAIL",
    "toIspb": "01234567",
    "toName": "Example Receiver",
    "toCpfCnpj": "123******01",
    "agency": "0001",
    "toAccount": "123456"
  }
}

Failure Handling ​

  • If qrcode is missing, blank, or exceeds the length limit, or payDate is not a valid date, correct the request and call again.
  • When decoding fails or the result is invalid, the API returns a failure response; do not continue the payment using empty fields from a failure response.
  • For specific failure codes, refer to Response Status and the actual response.