Creating a Pix QR code is the easy half of accepting Pix. The other half is knowing — without anyone checking a bank statement — that the customer paid, and marking the order paid exactly once, even when the notice arrives twice, late, or not at all.
If you've handled Stripe's payment_intent.succeeded or Square's payment webhooks, most of the habits carry over. What's different with Pix is where the notice comes from: a Brazilian bank, following a central bank standard, with no processor in between. This guide covers both layers and the rules your endpoint should follow, using Intopays's pix.update event in the examples.
Two webhooks, not one
There are two different notifications in a Pix integration, and mixing them up causes most of the bugs:
| Bank webhook | Intopays webhook | |
|---|---|---|
| Sent by | the bank holding the receiving account | Intopays |
| Sent to | the URL registered on the Pix key | the URL you register in the dashboard |
| Carries | txid, endToEndId, amount and time of the Pix | a pix.update event with the full charge and its new status |
| Format | central bank standard (Portuguese field names) | JSON with an HMAC signature header |
If you integrate directly with the bank, your server receives the first one and has to do everything below. Through Intopays, the bank notice goes to an address tied to the bank credential, and your system only receives the second.
How the notice travels
When a Pix lands in the business account:
- the bank calls the URL registered for the Pix key with the paid charge's
txid; - Intopays finds the charge by
txid, only within the organization that owns that bank credential; - before trusting the notice, it reads the charge at the bank and stores only the status the bank confirms;
- if the status changed, it sends
pix.updateto every webhook of the organization subscribed to that event; - your server verifies the signature and marks the order paid.
Step 3 matters. A txid can be predictable, and a notice on its own doesn't prove payment. If you integrate with the bank directly, do the same: read the charge with GET /cob/{txid} and check that its status is CONCLUIDA ("completed") before releasing the order.
What your endpoint receives
A JSON POST with an x-webhook-signature header. Trimmed:
{
"id": "019a8c61-02f4-7c1e-b6a3-41d09e7f5a28",
"eventType": "pix.update",
"type": "PIX",
"pix": {
"id": "200000",
"transactionId": "XXXINTOPAYSXXXSICOOBXXXPIX0000000200000",
"transactionEndId": "E75687876202611151423s0915c2f4a7",
"status": "COMPLETED",
"amountOriginal": 95.4,
"payerRequest": "Order #1042"
},
"createdAt": "2026-11-15T14:23:41.902Z"
}
| Field | Use it for |
|---|---|
id | the event ID: store it to ignore repeats |
pix.id | the charge at Intopays — the one you saved when you created it |
pix.status | COMPLETED means paid; REMOVED_BY_PSP usually means it expired |
pix.transactionEndId | the payment's endToEndId, its receipt ID in the central bank's system |
pix.amountOriginal | the amount in reais, to check against the order |
The full list of fields and events is in webhooks.
Five rules for your endpoint
1. Verify the signature first
x-webhook-signature is the hex-encoded HMAC-SHA256 of the request body, keyed with the webhook key (the signature field returned when you register the webhook). Compute it over the raw bytes as received, before parsing: re-serializing the JSON changes key order and whitespace, and the result.
In Node.js with Express, take the raw body on that route only:
import crypto from "node:crypto"
import express from "express"
const app = express()
app.post("/webhooks/intopays", express.raw({ type: "application/json" }), async (req, res) => {
const expected = crypto.createHmac("sha256", process.env.INTOPAYS_WEBHOOK_KEY).update(req.body).digest("hex")
const received = req.get("x-webhook-signature") ?? ""
const valid = received.length === expected.length && crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected))
if (!valid) return res.sendStatus(401)
const event = JSON.parse(req.body.toString("utf8"))
await saveEvent(event) // insert by event.id; a repeated id is not stored again
res.sendStatus(200)
processLater(event.id) // mark the order paid outside the request
})
2. Acknowledge fast, work later
A delivery counts as successful when your URL answers 2xx within the timeout — a few seconds. Store the event, respond, then do the slow work (invoice, email, fulfillment) in a job. A slow endpoint turns into a failure and a retry.
3. Be idempotent
The same event can arrive more than once (a retry, a manual resend). Mark the order paid conditionally — only if it isn't already. Storing the event id, and the pix.id with the status you already processed, covers both cases.
4. Check amount and order
Before releasing goods, compare pix.amountOriginal and pix.id with the order you created. Ignore events for charges you don't recognize.
5. Don't rely on the webhook alone
Webhooks are the fast path, not the only one. An endpoint that's down, an expired TLS certificate on your side or a deploy at the wrong moment will make a delivery fail. That's what the safety net is for.
Retries and the safety net
Intopays retries failed pix.update deliveries by itself:
| Rule | |
|---|---|
| First retry | on the next check after the failure, which runs every minute |
| Later retries | at most once a day |
| Limit | 9 retries per event |
| Body and signature | the same as the original delivery |
pix.create events are not retried automatically. In the dashboard, the webhook's Ver Eventos (View events) screen lists every delivery with your endpoint's HTTP status and response, and Reenviar evento (Resend event) sends it again immediately.
The safety net is reading the charge. For an order still pending after the expected time:
curl https://api.intopays.com/v1/pixs/200000 \
-H "Authorization: Bearer $INTOPAYS_TOKEN"
The read returns the stored status and triggers a check at the bank right after; if the bank reports a different status, the next read shows it and a pix.update goes out. On top of that, open charges are checked at the bank in 30-second cycles while they're within their expiry. See query Pix.
Testing your webhook
- Internal addresses never receive deliveries in production:
localhost, private networks and cloud metadata addresses are blocked. To test from your machine, expose a temporary public HTTPS URL (a tunnel). - Create a small real charge and pay it yourself (you'll need a Brazilian banking app — ask your client). Watch the delivery under Ver Eventos.
- Bank-side errors (credential, certificate, refusals) show up in the integration logs.
- A webhook can subscribe only to the events it needs, such as
pix.updateandboleto.update. With no list, it gets everything.
Building the whole checkout? See accepting Pix on your website. For what happens before the notice, see what Pix is.
Frequently asked questions
What's the difference between pix.create and pix.update?
pix.create says a charge was created, or that a payment arrived on a static QR code. pix.update says a charge's status changed — it's the event that tells you the customer paid (COMPLETED).
Does a webhook guarantee the money arrived?
Intopays only sends pix.update after the charge was checked at the bank. Still verify the signature and the amount: a request without a valid signature didn't come from Intopays.
What if my server is down?
The delivery fails and enters the retry schedule: a retry on the next minute's check, then at most once a day, up to 9 times. You can also resend from the dashboard or read the charge through the API.
Can I register more than one webhook?
Yes, up to 10 per organization. Each event goes to every webhook subscribed to its type — handy for keeping your ERP and a notification service separate.
Is a Pix payment ever reversed after the webhook?
The payer can't charge it back like a card. The business can refund it for up to 90 days, and in cases of fraud the payer's bank can open a claim through the central bank's MED mechanism, which may block the amount while it's reviewed.
