Backdrop: Am building a shopify app using a test store provided by shopify. #Python #Django-
Problem: I have setup shopify webhooks for my test store using the python API for the topics “products/update” and “products/delete”. But my endpoints are not called by shopify when I manually update or delete a product on my test store.
My detective work so far: I have checked the following:
-
I have confirmed that the webhooks were successfully created using the API. I simply listed all the existing webhooks using the API for the store and mine are there.
-
The address/URL I specified in the webhook for shopify to call in the event of a product update or delete is a public url, as in it is not on my localhost. (not 127.0.0.1:8000 etc.)
-
My webhook endpoint is fine. When I manually call my endpoint in a test case, it does what it should.
-
I contacted the shopify apps support guys, and I was asked to post this issue here.
Another minor issue is that I cannot find in the shopify API docs exactly what JSON/XML the webhook will POST to my URL in the event it should. So I do not know what that JSON will look like…
Any help would be appreciated!
Thanks for the answers guys, but I found out that the issue was something else.
I forgot to make a CSRF exemption for the POST request URL that Shopify calls and also forgot to add a trailing slash ‘/’ at the end of the URL I told the webhook to call.
I guess I would have caught these errors if I used something like postcatcher.in as suggested in the comments above. I din’t bother doing that as it looked like too much of a hassle.