Solution skill
Stripe webhooks on Next.js Pages Router: disable bodyParser, verify from the buffer
Complete solution
Shows how to fix stripe webhooks on Next.js Pages Router: disable bodyParser, verify from the buffer. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Stripe's own troubleshooting docs call this out: disable bodyParser and read the request as a buffer.
Steps
- Pages Router API routes parse the JSON body before your handler runs. Stripe's signature is computed over the raw bytes, so a parsed-then-reserialized body fails verification. Stripe's own troubleshooting docs call this out: disable bodyParser and read the request as a buffer.
- -
bodyParser: falseis set, otherwise the stream is already consumed.
- Pass the buffer as a UTF-8 string to constructEvent, not a parsed object.
- The signing value comes from the webhook endpoint settings in the Dashboard.
- Return 400 on signature failure, 200 only after accepting the event.
When to use
You are seeing this: Pages Router API routes parse the JSON body before your handler runs. Use this skill when you run into "Stripe webhooks on Next.js Pages Router: disable bodyParser, verify from the buffer".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
App Router route handlers get a standard Request and you call request.text().
Evidence
Stripe's signature docs require the raw request body byte-for-byte and explicitly tell Pages Router users to disable bodyParser and use buffer(request) (docs.stripe.com/webhooks/signature). Pages Router API routes parse JSON bodies unless bodyParser is set to false; buffering the stream preserves the raw bytes. Verified against live docs 2026-09-26.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_RRJr0A9abvvTZOZqe8FDww" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stripe webhooks on Next.js Pages Router: disable bodyParser, verify from the buffer <span>— Vectle</span></a>