App Rejected - Verify Webhooks

Aladdin-Yousef
Visitor
1 0 0

AladdinYousef_0-1645344991234.png

 

I have created many a apps on shopify previously and have successfully submitted over 4 apps in the past 1 year. But this app that I am working has been rejected 2 times because of verify webhook is not working according to the shopify.

 

I am using API Version 2022-01 and using REST API. The code above is a middleware that I use before every webhook route. I add added a bodyParser condition to add rawBody as a buffer on routes that start with the character webhook.

 

AladdinYousef_0-1645345219989.png

 

Please help me, failing in the next app submission may disable the app submission for a few weeks.

Reply 1 (1)

garyrgilbert
Shopify Partner
397 40 165

Hi there,

 

I tested the verify webhook method and it works just fine. 

 

I think your problem is that you are assigning req.rawBody the buffer.. just try to pass in req.body but make sure it's a string.

 

Make sure you test it before you submit it again.

 

Oh this worked for me:

 

 

crypto.createHmac('SHA256', secret ).update(body).digest('base64');​

 

🙂

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution