If your website sells to customers in Brazil, offering Pix at checkout is close to mandatory: it's how most Brazilians prefer to pay online, it settles in seconds, and there are no card numbers to protect. For a developer used to Stripe Checkout or Square's Web Payments SDK, the flow is different but simpler — no card form, no 3-D Secure, no authorization and capture. You create a charge, show a QR code, and wait for a webhook.
This guide builds that checkout end to end, with charges issued from the business's own Brazilian bank account through the Intopays API. The architecture applies to any Pix API integration.
What the checkout looks like
- The customer completes the cart and picks Pay with Pix.
- Your backend creates a charge for that order and stores its ID.
- The page shows the QR code (for desktop shoppers), a copy code button (for mobile shoppers) and a countdown.
- The customer pays in their banking app. The business's bank sends a notice, and your webhook marks the order paid.
- The page, which keeps asking your backend whether the order is paid, shows the confirmation.
What you need
| Item | Where |
|---|---|
| A business account with Pix API access at a supported bank | Sicoob, Sicredi, Banco do Brasil, Santander or Inter |
| The bank credential registered | dashboard, Banking → Credenciais (bank credentials) |
| An organization API token | dashboard, Integração → Tokens (API tokens) |
| A registered webhook | dashboard, Integração → Webhooks (webhooks) |
| An active plan | issuing Pix charges requires a subscription (pricing) |
The dashboard is in Portuguese for now; the menu names above are as they appear there. Setting up the bank side is covered in the Sicoob and Inter guides and the bank-by-bank comparison.
Who talks to whom
The most important rule: the token stays on your backend. It acts as the whole organization — whoever has it can create charges, read payments and change webhooks. Never ship it in browser JavaScript, a mobile app or a repository.
The browser asks your backend "create the Pix for order 1042" and later "is order 1042 paid yet?". Your backend calls Intopays and receives the webhook.
Step 1: create the charge on your backend
With curl, to try it out:
curl -X POST https://api.intopays.com/v1/pixs \
-H "Authorization: Bearer $INTOPAYS_TOKEN" \
-H "X-Credential-Key: $INTOPAYS_CREDENTIAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"amountOriginal": 89.90,
"calendarExpiration": 1800,
"payerRequest": "Order #1042"
}'
In a Node.js backend, the same call, storing what matters alongside the order:
async function createPixForOrder(order) {
const response = await fetch("https://api.intopays.com/v1/pixs", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INTOPAYS_TOKEN}`,
"X-Credential-Key": process.env.INTOPAYS_CREDENTIAL_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
amountOriginal: order.totalCents / 100, // the API takes reais (BRL)
calendarExpiration: 1800, // 30 minutes
payerRequest: `Order #${order.number}`,
}),
})
if (!response.ok) throw new Error(`Pix not created: ${response.status}`)
const pix = await response.json()
await orders.attachPix(order.id, { pixId: pix.id, qrcode: pix.qrcode, url: pix.url })
return pix
}
Pix only moves Brazilian reais, so the amount is always BRL, with up to two decimals. If your store prices in USD or CAD, convert before you create the charge and show the BRL amount to the customer. The response includes:
| Field | Use it for |
|---|---|
id | the charge at Intopays; it links the webhook to your order |
qrcode | the Pix copy-and-paste payload; the QR code is drawn from it |
url | a hosted payment page with the QR code and copy-and-paste |
transactionId | the charge's txid at the bank |
Choosing the expiry
calendarExpiration is the lifetime in seconds. After it, the bank refuses payment and the customer needs a new QR code.
| Situation | Suggested expiry |
|---|---|
| online store checkout | 15 to 30 minutes (900–1800) |
| charge sent by link, email or WhatsApp | a few hours to a day (86400) |
| in person, customer at the counter | 5 to 10 minutes |
Too short and customers lose the charge while opening their banking app; too long and you hold inventory for orders that won't be paid.
Step 2: show the QR code and copy-and-paste
Two options:
- Render it on your page. Draw the QR code from the
qrcodefield with a library (in the browser, theqrcodenpm package:QRCode.toCanvas(canvas, pix.qrcode)) and show the same text with a copy button. - Use the hosted page. Redirect to, or open, the
urlfrom the response. It needs no login, shows the amount, QR code and copy-and-paste, and never exposes the payer's data. Its wording is in Portuguese, which suits Brazilian shoppers.
Show the amount, the order name and the countdown. A shopper who sees "expires in 14:32" pays sooner.
Step 3: confirm the payment
When the customer pays, your webhook receives a pix.update event with pix.status set to COMPLETED. Your backend verifies the signature, finds the order by pix.id and marks it paid — once, even if the event arrives again. The signature check, with code, is in Pix webhooks.
Meanwhile, the payment page asks your backend every few seconds whether the order is paid:
// in the browser: ask your backend, never Intopays
const timer = setInterval(async () => {
const { status } = await fetch(`/api/orders/${orderId}/status`).then((r) => r.json())
if (status === "PAID") {
clearInterval(timer)
showConfirmation()
}
}, 3000)
That endpoint reads your own database, which the webhook updated. If the shopper closes the tab before confirmation, nothing is lost: the webhook still marks the order paid, and you send the confirmation email.
Step 4: edge cases
| Case | What to do |
|---|---|
| The charge expired unpaid | offer a "new Pix code" button that creates another charge for the same order |
| The shopper clicked "Pay with Pix" twice | if the order already has a charge within its expiry, return that one |
| The webhook never arrived | read the charge with GET /v1/pixs/:id when the expiry passes (query Pix) |
| The shopper paid two charges for one order | treat it as a duplicate and refund one through the bank |
| The order total changed | create a new charge; an issued charge's amount is fixed (amountModificationType 0, the default) |
Costs, and where the money goes
The charge is issued from the business's own account: the Pix settles there in seconds, any time of day. The per-Pix fee is whatever the bank charges; Intopays adds no per-transaction fee and never holds the funds — it charges a monthly plan. Compared with a card processor, there's no percentage per sale, no payout delay and no chargebacks; the business can refund a Pix for up to 90 days.
Pre-launch checklist
- The token lives only on the backend, in an environment variable.
- The webhook verifies the signature and is idempotent.
- The page shows the QR code, copy-and-paste and the countdown, and works on a phone.
- An expired charge offers a way to generate a new one.
- Orders with no notice after the expiry are read through the API.
- You made a small real payment and watched the order turn paid on its own.
Frequently asked questions
Can I accept Pix without a Brazilian company?
Not with this setup: charges are issued from a Brazilian business account, which requires a CNPJ. Without one, a cross-border payment provider can collect Pix on your behalf and pay you out abroad, at its own fees and timelines.
Can I just use the hosted payment page?
Yes. Every charge comes back with a url to a public page showing the amount, QR code and copy-and-paste code. Redirect the shopper to it or send it by message.
How fast does the order show as paid?
The Pix itself settles in seconds. The bank's notice usually follows right away; without it, open charges are checked at the bank in 30-second cycles while within their expiry.
Can I reuse one QR code for many orders?
Not for a checkout. Each order needs its own charge, with its own amount and ID, so your system knows which order was paid. A fixed QR code is for a counter poster: see static Pix.
Which banks can the shopper pay from?
Any bank or wallet in Brazil that offers Pix. Only the receiving business's bank needs to be integrated.
