Is it possible to determine if an order is for a gift card using the order fields?
I believe it may be possible using lineItems and product. But I would prefer not to have to pull that much data.
I am trying to calculate the total sales for a store and I need to remove orders for gift cards.
Any thoughts are appreciated, thanks!
An order has many line items. That means one or more. You ask for them when you ask for orders. Whether there is one line item in an order, or sixty-seven line items in an order, you ask for all of them. Then you check each one to see if it is a gift card. If it is, you can remove that gift card's value from your totals.
You don't have to reference anything against a list of products. You just examine the line item. It tells you gift_card: true/false. Nothing complicated about it.
Hey HunkyBill I eventually figured it out because that is buried in the rest api documentation, but i didn't see it documented anywhere in the graphql docs which is probably why Frank was confused as well