Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to properly respond to Shopify Webhook in React/Next.js & Node

How to properly respond to Shopify Webhook in React/Next.js & Node

KJGARRETT14
Visitor
3 0 1

Hello all,

 

I leveraged the React & Node tutorial to get started with building my first Shopify app. I'm currently subscribed to the ORDERS_PAID Webhook & since I see that the Webhook is being sent more than one time for a single order, I'm clearly not responding to it properly.

 

As you can see from my code below, I'm using the Koa-router & @Shopify/koa-shopify-webhooks NPM modules. Does anyone know how to properly respond? Both ctx.status = 200 & ctx.res.statusCode = 200 did not stop the Webhook from being sent more than once. 

 

Thanks & Stay Safe!

 

KJ GarrettScreen Shot 2020-05-07 at 18.41.35.pngScreen Shot 2020-05-07 at 18.42.26.png

Replies 3 (3)

KJGARRETT14
Visitor
3 0 1

I think I solved the issue with: 

ctx.response.status = 200;

Please let me know if anyone has any awesome resources on Next.js or Node's Koa Framework outside of their respective documentation.

 

Thanks!

Pravin-Bhapkar
Shopify Partner
13 2 3

Hi  
Have you implemented webhooks for GDPR complaint ? I saw that we don't need to register 

/shop/redact
/customers/data_request
/customers/redact
 
How you have tested it ? how you verified request is from shopify ? 


shingekinokyoji
Excursionist
20 1 2

What would be the PHP equivalent of this?