Get historical product cost per item (as of the time of the order)

Shopify Partner
22 0 3

Could Shopify enhance the line item object to include a cost field?

This is so that we can access the historical cost of the item at the time of the sale.

At the moment, we can look up the price from the inventory item, but this is the current as of now.

 

 

1 Like
Highlighted
Shopify Staff
Shopify Staff
50 2 11

Hey ClementBR!

 

I have not heard of any plans to add cost to an order's line item.

However, you could definitely perform this mapping as an app by verifying costs in response to an order webhook.

Additionally, for orders that existed before your app was installed, you could compare the updated_at fields on both the order and the inventory_item to determine if the cost has potentially changed since the order was placed.

0 Likes
Shopify Partner
22 0 3

Thanks Alex, I thought about that but it's really not ideal.

What we want is line_item.cost, just like line_item.price

 

My understanding is that the Shopify margin reports are using the historical cost of the line item (at the time of the sale), so I would assume that it is already captured somewhere in the order data.

 

Consider this an official feature request :)

1 Like
Tourist
4 0 1

This would be very helpful. I would also like to see this implemented.

0 Likes