GraphQL API - inventory item unitCost permission

Topic summary

Main issue: how to control access to the ProductVariant/InventoryItem unitCost field in the Admin GraphQL API via a “View product costs” permission.

Context: An app with read_inventory and read_products scopes can successfully query products, inventory, and unitCost, but wants to hide unitCost from API users. The Shopify docs note unitCost requires “View product costs” when granular permissions are enabled.

Latest update/answer: Shopify support clarified that “View product costs” (aka “View unit costs”) is a store staff permission, not an API permission. It cannot be used to limit access to unitCost in GraphQL for API users.

Outcome: No API-level mechanism exists to restrict unitCost if the app has the relevant scopes. The question is resolved with a definitive “not possible” using API permissions. Unanswered alternatives (e.g., app-side filtering) are not addressed in the thread.

Summarized with AI on December 14. AI used: gpt-5.

On the GraphQL document page about Product Variant it says:

unitCost> Unit cost associated with the inventory item. Note: the user must have “View product costs” permission granted in order to access this field once product granular permissions are enabled.

https://shopify.dev/docs/api/admin-graphql/2024-10/objects/ProductVariant

Where is this “View product costs” permission given to API user?

I have set up an application to a store and given it API access scopes read_inventory and read_products. I have created GraphQL query and successfully ran it to get products and inventories from Shopify store. I also get inventory item unit cost if I request it but I would like to hide it from potential users of shop’s GraphQL API. So my question is where is “View product costs” permission set, and can I use it to limit API user’s access?

I got an answer from Shopify support. “View unit costs” permission is a reference to the permission given to store staff account and this cannot be used for limiting access to the unit cost field in the inventory item in GraphQl queries. So, the answer is no, it is not possible to limit API user’s access to inventory item unit cost field.