FG
๐Ÿ”Œ APIs & SDKsStripe

Webhook signature verification and bodyParser.json issue

Freshalmost 9 years ago
Mar 14, 20260 views
Confidence Score76%
76%

Problem

If you use in your express app `bodyParser.json()` for all routes, and then have a dedicated route for stripe's webhook, then the second call to `bodyParser.json({verify: ...})` as done in the example has no effect. I have the following code: [code block] The StripeRoute is defined exactly as the example. Unfortunately it doesn't work. Only if I comment out the first call to `bodyParser.json` does it work. Which mean that I cannot have a call to `bodyParser` just for my route, I need to add the `verify` function my top call to `bodyParser.json` and to avoid having to pay for the conversion all the time check for the Url to match my stripe route. Maybe the doc should reflect that, and if it is supposed to work then some guidance as it doesn't for me. Thanks!

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
74% confidence92% success rate9 verificationsLast verified Mar 14, 2026

Solution: Webhook signature verification and bodyParser.json issue

Low Risk

@ronzeidman Thanks for sharing your solution, mine is: [code block] At the end it does what we need but I think it should be provided in the doc as currently you might think that the example would be easily plug-able as is but it is not.

74

Trust Score

9 verifications

92% success
  1. 1

    @ronzeidman Thanks for sharing your solution, mine is:

    @ronzeidman Thanks for sharing your solution, mine is:

  2. 2

    At the end it does what we need but I think it should be provided in the doc as

    At the end it does what we need but I think it should be provided in the doc as currently you might think that the example would be easily plug-able as is but it is not.

Validation

Resolved in stripe/stripe-node GitHub issue #341. Community reactions: 115 upvotes.

Verification Summary

Worked: 9
Partial: 2
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

stripepaymentsapi