Payments

Pix webhooks: confirming payments automatically

How Pix payment webhooks work: what the bank notice carries, signature checks, idempotency, retries and reading the charge as a fallback, with a Node example.

By Intopays team

6 min read

The payment notice leaves the bank, reaches your server as an event and the order shows as paidOrder #1042PaidPix webhookspix.update

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 webhookIntopays webhook
Sent bythe bank holding the receiving accountIntopays
Sent tothe URL registered on the Pix keythe URL you register in the dashboard
Carriestxid, endToEndId, amount and time of the Pixa pix.update event with the full charge and its new status
Formatcentral 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

How the notice travels: the customer pays, the bank notifies Intopays, Intopays re-checks the charge at the bank and only then sends pix.update to your server, which marks the order paidCustomer paysYour banknoticeIntopays checksreads the charge at the bankpix.updateYour serverPaidOrder
The bank notice is treated as a signal: the charge is re-checked at the bank before it becomes a pix.update on your server.

When a Pix lands in the business account:

  1. the bank calls the URL registered for the Pix key with the paid charge's txid;
  2. Intopays finds the charge by txid, only within the organization that owns that bank credential;
  3. before trusting the notice, it reads the charge at the bank and stores only the status the bank confirms;
  4. if the status changed, it sends pix.update to every webhook of the organization subscribed to that event;
  5. 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"
}
FieldUse it for
idthe event ID: store it to ignore repeats
pix.idthe charge at Intopays — the one you saved when you created it
pix.statusCOMPLETED means paid; REMOVED_BY_PSP usually means it expired
pix.transactionEndIdthe payment's endToEndId, its receipt ID in the central bank's system
pix.amountOriginalthe 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.

Verifying the signature: the HMAC-SHA256 of the raw body, computed with the webhook key, must equal the x-webhook-signature headerRaw body, as received{"id":"019a8c61…", "eventType": "pix.update", "pix":{…}}Webhook keythe signature fieldHMAC-SHA256hex encodedComputed by you9c1e…4b07x-webhook-signature9c1e…4b07Equal: process itDifferent: drop it
Raw body + webhook key → HMAC-SHA256. Equal to the header: process it. Different: drop it.

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:

Redelivery of a failed pix.update: a new attempt on the next check, then at most one a day, up to 9; and reading the charge through the API as a safety netWhen your endpoint failsDeliveryfailedRetryon the next checkOnce a dayup to 9 retriesSafety netGET /v1/pixs/:idread the charge before you give up on an order
A failure doesn't lose the event: there are automatic retries and, on top, reading the charge through the API.
Rule
First retryon the next check after the failure, which runs every minute
Later retriesat most once a day
Limit9 retries per event
Body and signaturethe 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.update and boleto.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.

All articles

Keep reading

A checkout page with a Pix QR code and a copy button, a customer paying from her phone and the green mark of a confirmed orderR$89.90expires in 14:32Copy codePix on your website's checkout

Payments

How to accept Pix payments on your website: a developer guide

Build a Pix checkout end to end: create the charge on your backend, show the QR and copy-and-paste code, confirm by webhook, handle expiry. With curl and Node.

7 min readRead the article
An integration created in Banco Inter's online banking becomes a certificate and key bundle, and your system starts generating Pix QR codes.crt + .keyBanco Inter Pix API

Payments

Banco Inter Pix API: how to integrate it

How to create a Banco Inter API integration, download its certificate and key, authenticate, issue a first Pix charge and reuse the same credential for boletos.

6 min readRead the article
Your system sends the boleto request, the bank registers it, and the boleto comes out with a barcode and a Pix QR codePOST /v1/boletosBarcode + Pix QRRegistered

Payments

Boleto bancário explained, and how to issue boletos via API

What a boleto is, how Brazilians pay it, why it survives next to Pix, and what a business needs to issue registered boletos through its own bank's API.

6 min readRead the article