skip to Main Content

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


  1. 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!

    Login or Signup to reply.
  2. Some common problems are:

    • An invalid SSL certificate, e.g. one that is self-signed or one that is missing intermediate certificates. You can check for problems using https://www.ssllabs.com/ssltest/
    • Your server or app is not configured to accept POST requests, instead it only accepts other methods. From the command line you could check this by making a POST request with curl to your webhook endpoint.
    • Your app has implemented webhook verification logic and you are trying to verify production webhooks using your development app secret.
    • The webhook that you created has been cancelled because Shopify was not receiving a 200 status response quickly enough. You can use the Webhooks API to list webhooks and verify that yours is still registered.
    Login or Signup to reply.
  3. Make sure you have setup next.js server’s SSL with certificate.crt, private.key
    and ca_bundle.crt.

    Example:

    var options = {
        key: fs.readFileSync(__dirname + "/../certificates/server.key"),
        cert: fs.readFileSync(__dirname + "/../certificates/server.crt"),
        ca: fs.readFileSync(__dirname + "/../certificates/ca_bundle.crt"),
      }; 
    
      http.createServer(server.callback()).listen(8081);
      https.createServer(options, server.callback()).listen(443);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search