Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I am developer and using Order Payment webhook to generate files and ship orders etc.
It was working fine but now there are scenario in which there is exchange item through return, as in this case there is no payment so Order Payment doesn't invoke.
Is there any way to use any webhook to differentiate that a specific order came through normal payment or exchange through return?
(I asked this question in another topic, copying it here after realizing that it should be in this topic)
Hey @heraldo ,
From what I'm able to tell, exchanging an item just creates a new order containing the exchanged item(s). I can't think of any surefire way to identify with only payment or order webhooks whether or not an order is as a result of an exchange though.
These exchange orders do have events that say they were processed from an exchange, so you could subscribe to orders/create webhooks, and then check the events on newly placed orders and parse them to see if any are events mentioning an exchange. I'd love it if someone popped in here with a better method, but that looks to me like the most reliable way to know if an order was created with an exchanged item or not.
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog