I made a private app using shopify-api-node package which is working perfect in local development using ngrok.
I registered a webhook “products/update” which is working fine.
registered url local: https://example.ngrok.io/webhooks/product-update
but the same webhook registered with production environment, webhook is not getting fired
registered url in production: https://custom.example.in/webhooks/product-update
When both local and production servers are running, webhooks are fired to local server (tunneled via ngrok) only.
I am using nginx in production as a reverse proxy. I have checked access.log file of nginx but there is no webhook request fired by shopify. I tried creating a new private app but no help.
What can be possible issue? Thanks in advance.
3
Answers
You need to provide more information. How do you know the webhook in production is not firing? Have you proven that when you created the webhook itself that is was created? What does the webhook object look like when you inspect it? Is it all good?
If the webhook exists, and the object all looks good, the next thing to investigate is your public production server.
99/100 webhook problems are not Shopify but something developers do wrong. Ensure you have done everything right before you ask what is wrong!
Some common problems are:
POST
requests, instead it only accepts other methods. From the command line you could check this by making a POST request withcurl
to your webhook endpoint.Make sure you have setup next.js server’s SSL with certificate.crt, private.key
and ca_bundle.crt.
Example: