differentiate between normal order and exchange item in webhook

New Member
2 0 0

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)

0 Likes
Shopify Staff
Shopify Staff
1012 67 133

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. 

0 Likes