title: Node.js: Stripe error No signatures found matching the expected signature for payload
body: <p>Error:</p>
  
  <blockquote>
    <p>"message": "No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? <a href="https://github.com/stripe/stripe-node#webhook-signing" rel="nofollow noreferrer">https://github.com/stripe/stripe-node#webhook-signing</a>",</p>
  </blockquote>
  
  <p>I've tried <code>req.rawBody</code>, but the same result. I ve also tried all the solutions available on stack overflow and github. </p>
  
  <h3>server.js</h3>
  
  <pre><code>// use express body parser
  app.use(bodyParse.json());
  </code></pre>
  
  <h3>stripe.js</h3>
  
  <pre><code>router
    .route('/payment/hook')
    .post(bodyParser.raw({
      type: 'application/json'
    }), paymentsController.transactionHook);
  </code></pre>
  
  <h3>paymentsController.js</h3>
  
  <pre><code>transactionHook: async(req, res, next) =&gt; {
      const sig = req.headers['stripe-signature'];
      let event;
  
      try {
        event = await stripe.webhooks.constructEvent(req.body, sig, endpointSecret);
  
      } catch (err) {
          return res.status(400).json({ message: err.message, detail: err.detail });
        }
    }
  </code></pre>
  
  <h3>Response</h3>
  
  <p><a href="https://i.stack.imgur.com/9fbRv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9fbRv.png" alt="Response"></a></p>