Cost Price via Admin API

Topic summary

Extracting and updating product cost price via Admin API for bulk updates.

  • Retrieval: Use the GraphQL Admin API. The InventoryItem object exposes unitCost (cost per item), which can be queried and fed into a Python script for processing.
  • Scale operations: For large datasets, use the GraphQL Bulk Operations API to asynchronously fetch or update data at scale.
  • Updating via REST: Alternatively, the REST Admin API supports updating cost using the inventory_item endpoint’s cost property.

Key terms:

  • InventoryItem: The SKU-level inventory record for a product variant.
  • unitCost: The cost price per item stored on InventoryItem.
  • Bulk Operations API: An async GraphQL mechanism for handling large data jobs.

Outcome: CSV export isn’t required; multiple API options are available for both reading and updating cost. Status: Guidance provided; no confirmation from the original poster on implementation or success.

Summarized with AI on January 5. AI used: gpt-5.

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?

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?

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