I looked into the different order webhooks and was wondering when they are triggered. This is what I figured out so far:
orders/updated
is fired whenever an order is changed in any way, including when an order is created (even before it was authorized and orders/create
is fired), closed or cancelledorders/create
is fired when the user authorizes the paymentorders/paid
is fired when the merchant accepts the paymentorders/fulfilled
is fired when the merchant fulfills the orderorders/cancelled
is fired when the order is cancelledSince orders/updated
is also fired whenever the other hooks are fired, it seems as if adding an update webhook would be good enough for keeping a local datastore synced to the shop data. However, I want to confirm that my understanding of those webhooks is correct, i.e. is it true that orders/updated
is always fired whenever an order changes in any way. and that the other webhooks are just aimed at more specific use cases?
Webhooks allow apps to stay in sync with Shopify data or perform an action after a specific event occurs in a shop. Webhooks are a performant alternative to continuously polling for changes to a shop's data. For example, a webhook can notify your app when a merchant changes a product in the Shopify admin.
You might get webhooks requests as GET or POST requests, dependent on the webhooks provider. GET webhook requests are simple and have their payload appended to the webhook URL as a query string. POST webhook requests have their payload in the request body and might also contain properties like authentication tokens.
I'd say for sake of keeping the code easier to understand it would be in your best interest to handle the appropriate webhooks just to keep the code easier to understand.
If all you're doing is tracking really general stuff, it's probably fine.
Also, on all state changes of an order the orders/updated
webhook is fired.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With