Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
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.
Please help me, failing in the next app submission may disable the app submission for a few weeks.
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');
🙂