I am trying to identify orders based on their sales channel name, thanks to Rumo, by retrieving the app_id from Order object. However, the app_id of orders that in the Admin reporting tool, under sales channel name, as "Draft Orders" have the same app_id as my other sales channel. Is there a reason to that and how can I identify the same way as the admin reporting tool do?
Btw, the source_name is always "web" and, for some reason, is not "shopify_draft_order"
Solved! Go to the solution
This is an accepted solution.
You could look at the order's landing page. For orders created from draft orders where the customer used the web checkout, the landing page would look like this: /shop_id/invoices/token
If the path includes invoices, then it came from a draft order and completed through the web checkout.
Thank you and apologize for the late reply @Busfox, your solution seems to work for your scenario. However, it's quite a pain since if the order were completed in Shopify Admin then the landing_site will be null but in that case the source_name would be shopify_draft_order. I'm intrigued that the Shopify Admin Report feature can just find draft order so easily through the sales channel name column but the API requires checking data from two attributes. I hope there's an easier way to do this.