Kirby-shopify webhooks / routes not working

hey people,

i used the kirby-shopify plugin from @tristantbg for an integrated webshop.
the fetching of the products and combination with custom fields works perfect and the page is coming together. thanks for that !

what doesn´t work is automatically updating the cache via the shopify webhooks.
the following was done:

  • putting in the webhooks in the shopify configuration
  • hosting the page properly (shared hosting)
  • using https with a real certificate
  • putting in the shared secret from shopify config in the .env file

if i manually open the webhook it just redirects me to the default error page of kirby.
what am i doing wrong ? could it be that kirby somehow doesn´t activate the custom routes implemented in the plugin index.php ?
the only way of updating the shopify data is by manually deleting the site/cache folder via ftp

if anybody has tips this would be highly appreciated.

Hey @c36,

Glad you like the plugin!
Where did you find your Shared secret ? It is not the one showing in the private app config.

hey,

i used the one in the shopify webhook configuration and put it under SHOPIFY_APP_SECRET= in my .env file

Have you found a solution ?

hey thanks for being so responsive.
yes i did a dumb mistake and didnt configure the right action for the webhooks. so my changes in shopify didnt trigger the hooks.
my testing with the browser was of course not working because the browser is sending GET requests. one test with postman sorted every question in this thread out and i double checked my shopify config.
thank you !

1 Like

@tristantbg Love the plugin, thanks so much for developing it! Except I’m having the exact same problem with the webhooks, but not as easily solved.

My .env file has the SHOPIFY_APP_SECRET set to the webhook verification code in the Shopify webhook section, my webhook is set to https://mywebsite.com/kirby-shopify/api/cache/products/clear as instructed, but nothing.

If I make a sample POST through Postman with the X-Shopify_Hmax-Sha256 and X-Shopify-Shop-Domain inserted I’m getting the “Identification failed” response.

Could it possibly be an https thing?

Hey, thank you for your message.

Be careful its not
X-Shopify_Hmax-Sha256
but
X-Shopify_Hmac-Sha256

Hey again.

Sorry, that was just a typo in my post above. I have tested with the proper ‘hmac’ spelling and no luck. But more importantly it’s not working to clear the cache on the live site.

Any thoughts would be much appreciated.

Hi @tristantbg, unfortunately this issue has cropped up again and changes on Shopify aren’t clearing the cache on the site.

My env file includes SHOPIFY_APP_SECRET=“XXX” with the code underneath the webhooks, I have all the webhooks set up as below

If I clear the cache manually, products are pulled in properly so there are no other authentication issues. Pretty stumped! Any ideas?

Can I ask please how you structured this Postman request?

Hi there! Any chance you found a solution for this? I’m facing the same issue - webhooks not clearing the cache. :grimacing: