Pay a Pix QR code
Let users pay a company's Pix QR code from their balance, with the payee shown before they confirm.
Your users scan a company's Pix QR code at a shop or on an invoice, see who gets paid and how much before confirming, and pay it from their balance in digital reais (BRLA) or digital dollars (USDC or USDT). It works like a Pix withdrawal whose destination is the QR code instead of a Pix key.
A user scans a company's Pix QR code at a shop or on an invoice, sees who they are paying and how much, and pays it from their stablecoins. It is a Pix withdrawal whose destination is the QR code instead of a Pix key.
1. Quote the code
Send the code's text (the "Pix copia e cola" string) as brCode, with no amount:
const quote = await notus.fiat.createFiatQuote({
brCode: '00020101021226...6304ABCD',
from: { currency: 'BRLA' },
to: { currency: 'BRL' },
chainId: 137,
identityId: '<identity-id>',
walletAddress,
})Money in a user's account lives on a network, like a bank system. Pix QR payments use the Polygon network (chainId: 137). Pass the currency the user is paying from in from.currency (BRLA, USDC or USDT), the user's verified identity in identityId, and their account address in walletAddress.
The quote reads the code and answers three things to show the user before they confirm:
brCode: what the code itself says (the receiver name written in it and the amount);pixReceiver: who the Pix network says actually receives the money (name,documentId,institution);from.amount: how much comes out of the user's balance, fees included.
brCode: what the code itself says (the receiver name written in it and the amount);pixReceiver: who the Pix network says actually receives the money (name,documentId,institution);from.amount: how much of the user's stablecoin pays it, fees included.
Show pixReceiver, not the name written in the code: a QR code's own text can say anything.
A code without an amount (a static code) needs the amount from the user: send it as to.amount in reais.
2. Create and approve the order
Create the payment order from the quote, have the user approve the operation with their login key (producing signature for userOperationHash), and submit the approval with executeUserOperation. Only the user can move money out of their account.
Create the withdrawal order from the quote, sign order.withdrawalInstructions.userOperationHash with the account's signer, and submit it to executeUserOperation.
const order = await notus.fiat.createFiatWithdrawalOrder({
quoteId: quote.quoteId,
paymentMethod: { type: 'PIX_QR_CODE', brCode: '00020101021226...6304ABCD' },
})
const { userOperationHash } = order.withdrawalInstructions
await notus.userOperations.executeUserOperation({
userOperationHash,
signature: await signer.signMessage({ message: { raw: userOperationHash } }),
})Follow the payment like any withdrawal, using the ramp.withdraw notification your server receives.
Follow it like any withdrawal, with the ramp.withdraw webhook.
Rules
| Error | When |
|---|---|
PIX_QR_CODE_RECEIVER_NOT_COMPANY | The code pays a person (CPF). Only codes that pay a company (CNPJ) can be paid. |
PIX_QR_CODE_RECEIVER_UNKNOWN | The payee could not be identified. |
BR_CODE_AMOUNT_REQUIRED | The code has no amount and none was sent. |
BR_CODE_NOT_PAYABLE | The charge was already paid or has expired. |
Errors on a quote made with a code carry what was read in extra.brCode and extra.pixReceiver, so you can still show the user what they scanned.
Pix QR payments have their own limits (by default 2,000 reais a day and 500 per payment). Read a user's limits with Get Identity Financial Limits as PIX_QR_CODE.
Provider and version notes
- QR payments go through Pods, the provider that looks up the payee: pay with BRLA, USDC or USDT on Polygon.
- The old
GET /fiat/brcode/previewendpoint is removed in API version2026-11-27; the quote replaces it.