Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Cost Price via Admin API

Solved

Cost Price via Admin API

qlasqlas
Visitor
1 0 0

Hi, on my store I have a lot of items, I wanted to bulk update my products using my admin API and my own python program. Is it possible to extract the cost price I have set for the items on my store using an Admin API? Or is there another way to do it except exporting it as csv?

Accepted Solution (1)

Liam
Community Manager
3108 342 884

This is an accepted solution.

You should be able to use the GraphQL Admin API to retrieve the cost per item of your products via the unitCost field on the InventoryItem object

 

You can then use the returned data in your Python program to perform your updates - or use the Bulk Operations API to update. Would this work for your use case?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

Liam
Community Manager
3108 342 884

This is an accepted solution.

You should be able to use the GraphQL Admin API to retrieve the cost per item of your products via the unitCost field on the InventoryItem object

 

You can then use the returned data in your Python program to perform your updates - or use the Bulk Operations API to update. Would this work for your use case?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

VladimirK89
Shopify Partner
13 1 4

You can also update via REST Admin API using the inventory_item endpoint, see the cost property.