Shopify order webhooks

巧了我就是萌 提交于 2019-12-20 18:27:13

问题


I looked into the different order webhooks and was wondering when they are triggered. This is what I figured out so far:

  1. 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 cancelled
  2. orders/create is fired when the user authorizes the payment
  3. orders/paid is fired when the merchant accepts the payment
  4. orders/fulfilled is fired when the merchant fulfills the order
  5. orders/cancelled is fired when the order is cancelled

Since 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?


回答1:


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.



来源:https://stackoverflow.com/questions/12738309/shopify-order-webhooks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!