I’m quite shocked that there is no Cost property on the order line item. When googling this I see topics from 2021, 2022 and this is still not picked up. The reason is obvious: When getting historical order data we cannot calculate the margin based on the current cost, cost prices could change. From a ERP/Financial standpoint this should be immutable locked on the order itself.
Hey AdminGh, I understand your frustration here. If its of any help, my app stores historical price/cost data Perhaps this will allow you to figure out this data? (FYI, we’ll soon be introducing order data as well so it can do all the calculations for you)
I am also interested in getting the order item cost via API. I confirm that it is still unavailable, the only cost we get is the current cost, and not the cost at the moment of purchase.
Shopify definitely store this information but it is not available to us.
We had to attach this metafield to the order when the order is placed.