Product API does not contain 'Cost per item' property

Solved
Highlighted
Tourist
7 0 1

Hi there,

 

I was wondering why the Product API does not return cost per item. You can set it in the admin panel of your Shopify store, but cannot read/set it from the API. Is there a specific reason for this or is it not yet implemented? Thank you

 

Sincerely,

 

Thomas

0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
621 94 109

Hey @ViSoft-Thomas ,

 

This "cost" field is a property of the Inventory Item resource/endpoint of the Shopify Admin API, not the Product resource/endpoint. Every Product in Shopify has one-to-many Product Variants assigned to it, and each Product Variant has an 'inventory_item_id' field. With this 'inventory_item_id' you can use the Inventory Item endpoint to read/set the "cost" of the item.

 

Read this documentation here on how to read/set the "cost" of an inventory item via the Shopify Admin API: https://shopify.dev/docs/admin-api/rest/reference/inventory/inventoryitem

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like
Highlighted
Tourist
7 0 1

@hassain Thanks! :)

0 Likes