New cost property on InventoryItem

Shopify Staff (Retired)
22 0 12

On Thursday October 25th, Shopify will start introducing Product Cost. This feature enables merchants to record the unit cost of their variants, track margin, and report on product performance within Shopify. This feature will roll out to all stores over the next few days. 

Merchants will see a new cost per item field when editing variant pricing and will be able to bulk update this cost via the product CSV importer and the product bulk editor. There will also be changes to analytics, including the addition of new Profit Margin, Cost of Goods, and Gross Profit reports.

In order to enable our partners to leverage this feature in their apps we are exposing a new cost property on the InventoryItem. Please see the examples below for implementation details.


To pass Shopify the unit cost of a variant via the GraphQL Admin API you will use the productVariantUpdate mutation, see example below.


mutation productVariantUpdate($input: ProductVariantInput!) {
 productVariantUpdate(input: $input) {
   userErrors {
   productVariant {

Input variables:

 "input": {
   "id": "gid://shopify/ProductVariant/35437260802",
   "inventoryItem": {
     "cost": "25.00"

For more information about variant mutations please see our documentation.


To pass Shopify the unit cost of a variant using our REST Admin API you will use the InventoryItem endpoint, see example below.

PUT /admin/inventory_items/#{inventory_item_id}.json
 "inventory_item": {
   "id": 808950810,
   "cost": "25.00"

For more InventoryItem endpoint information see our documentation.

As always, if you have any questions, or concerns, please don't hesitate to reply in the thread below.

Replies 43 (43)
Shopify Partner
4 0 0

HI Kieran,

Great new feature.  We will get around to adding it later on to our app, but for now if we don't pass the 'cost value' when updating products/variants that will be fine (ie. make no change to our existing processes)?

Thank you

Shopify Partner
142 0 15

Let me start by saying this is a useful feature that has been asked for by merchants for a while.

However, yet again your roll out has been terrible. After numerous delays to the app store and Locations API, you decide to roll out a new feature (that will kill a fair few apps) with 2 days notice!

Ultimately (after some redevelopment) this will help my app but the way you treat developers leaves a lot to be desired and I will have to look at reducing my dependence on your marketplace.

Shopify Staff (Retired)
22 0 12

From a business use perspective, one further request is to enable calculation of profit margins based on Product Prices that are exclusive of tax.

Hi Adriano, great question, the new finance report gives an overview of margin without taxes. Shopify, Advanced, Plus plans also get the new Profit Margin reports which give this breakdown, per product and per variant.


Will we be able to inupt/update this info via Transfer?  Also, will the COG update as they either increase/decrease depending on existing vs new stock?

Hi Chris C, at present these feature are not available but this is a great suggestion and I'll feed this back to the product teams working on transfers and product cost.


Would the `cost` field be availabe in the `Variant` API endpoint by any chance (even just as a read-only attribute)?

Hi Jonathan & Clement, I'm afraid not. Our rationale is that anything which is an attribute of a physical good (their location, their weight, their cost, their quantity etc.) is at the inventory item level. Meanwhile, anything dealing with how an item is presented for sale to buyers (description, price, where it's published, images etc.) are at the product and variant level. I hope that makes sense.

if we don't pass the 'cost value' when updating products/variants that will be fine (ie. make no change to our existing processes)?

Hi Steve, it's great to hear you'll be adding product cost to your app and you're absolutely right, there's no requirement to pass the cost property.


However, yet again your roll out has been terrible. After numerous delays to the app store and Locations API, you decide to roll out a new feature (that will kill a fair few apps) with 2 days notice!

Hi GhostApps, thank you for your feedback on the timelines. It's not always possible for us to give advanced notice of feature releases but we are aware that the timeframe was particularly short in this case. I'll certainly raise your concerns internally and we'll envedour to give as much notice as possible in future. By enabling developers to set the product cost natively, we hope that partners will be able to leverage this data point, reducing their apps' dependency on storing cost data elsewhere and enabling them to concentrate on taking advantage of the huge opportunity in the product cost space.

New Member
3 0 0

Perhaps I'm missing it, but to us the Cost of Goods Sold (and getting data out of shopify to complete taxes in general) challenge with Shopify isn't whether it can retain a product cost. 

The challenge for Cost of Goods Sold (and getting data out of shopify to complete taxes in general) is that this is no efficient way to get required data out of Shopify.  Also, in some cases there's no way to get the tax related data out of shopify tied back to the products/orders they came with. For example, Shopify has charged/refunded my customers and Charged/refunded me, but this needed tax related information/data is only avaiable under Shopify Bills with no way one can tie those amounts back to shopify orders, sales, etc.

We can and do record product cost today outside of shopify.  What we need from shopify for Cost of Goods Sold (and getting data out of shopify to complete taxes in general) is a feature where we can:

1) download all our shopify data,

2) download the data in a single area,

3) download data with its related keys (say between orders and bills (see above) in addition to sales, transactions, products, et al.) 

Will this new product cost (and/or report) also come with features to support (the above) so we can complete our Cost of Goods Sold and complete taxes in general? 

New Member
1 0 0

Some of my clients have been asking for this for a while so it’s good to see it finally implemented. 

What would be really good is When raising an order via the pos or back office, the seller could view how much margin & profit is in the order. This would help them when they need to discount orders for customers. 

Shopify Partner
1 0 0

I was pointed to this article as a solution to a Create Product Rest API error I am receiving:

Return Code: 400 Message: {"errors":{"smart_collection":"Required parameter missing or invalid"}}.  Oddly, when I run the same JSON in Postman, it created the Product.  

The Smart Collections use Vendor, Product Type and Tags to automatically associate the Product to the Collect.  I have confirmed that there are smart collections for the data in the JSON:

Can you help me understand why I was pointed to this article?  Doe the Create Product Rest API require Product Cost?


Shopify Staff (Retired)
11 0 9

Hi David,


I don't know why you were directed here, but if you are having issues creating products, you can create a new topic with the JSON youre sending to get help here:


Your issue is unrelated since you're using the product API. Is this a new error or did you just start using the API? (Please respond in the new topic)



Shopify Partner
659 0 136

Hi Kieran,

1) There seems to be a pretty bad bug: the cost property is not included in webhook requests for the inventory_items/update topic! I assume this is a bug?

It might affect inventory_items/create too but I didn't test it.

2) Is it possible to add a property on order line items with the cost at the time of the sale? Otherwise, we only have access to the current value, which may have changed since then.


Shopify Staff (Retired)
22 0 12

Hi Clement,

1) Thanks for raising this, I've replicated the issue and will raise it with the engineering team immediately.

2) I know this isn't available at this point but I will ask the team if this is on the roadmap and update you shortly.

Shopify Partner
308 5 66

Hey, guys!

Today we ran into weeeird stuff with the Cost field with one of our Plus customers.

When setting the "cost" property though API to say "10.06", the Admin in the Plus store shows it as "10".

When reading from API the "cost" property, it is legitimately "10.06" there.

On the non-Plus Admin everything shows correctly of the same import.

Can Shopify Devs check this, please?

The client tried on many browsers, many computers - to eliminate the chance that this is a "OS/Browser" issue. It's the same. The only "common denominator" is that it is a Plus store.


Matrixify (Excelify) | Bulk Import Export Update Migrate |