Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.
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
Shopify Staff
2677 288 731

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
Shopify Staff
2677 288 731

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
12 1 3

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