I am getting the product_id and variant_id in the order line item even if the product is deleted from shopify store.
It even says product_exists : true. Can you please tell me why this happens and is there any way that I can detect if the
product exists or not without making any addition API calls?
This is a bit of a pain, we suffer the same issue in our applications. We already have all product details so we compare it to that, however I understand this is a bigger issue when this isn't available.
We find many applications cause this problem such as any application that offers tiered pricing. These applications delete and recreate variants all the time and break the connection to the original product.
+1 on adding something to identify this without needing to scan through all products.
Looking through our code, all line_items should be getting their product_id value nullified on product destruction. I just tested out creating a product, buying it and destroying it. And I'm still seeing the product_id and variant_id in my API responses.
For now, I'd say you could perhaps subscribe to product delete webhooks and keep note of them somewhere. I'll file an issue and we'll post an update to the API announcements area when a patch goes out.
Have you created a collection on your online store and experienced an issue with adding yo...By Ollie Aug 24, 2022
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...By Ollie Jul 28, 2022