Hi, I’m looking to develop an app to automatically update variants inventory to “not stock” when quantity is “0” for specific Shopify locations that only use POS, therefore the out of stock product won’t pollute the POS screen. I’m searching the REST Inventory API documentation as well as the GraphQL documentation but can’t find anywhere where it’s specified what query I should do. Anyone have an idea?
Thanks Alex, but are you sure that the “tracked” property is the one affecting the “stocked at this location” state? For me the “tracked” property have a much wider influence on the item independantly of its location:
"
“tracked”: true
Whether the inventory item is tracked. If true, then inventory quantity changes are tracked by Shopify
"
Apologies, I misunderstood your question.
With REST, you can DELETE an inventory level at a specific location, which is the equivalent of unchecking the box to stock that inventory at said location:
https://help.shopify.com/en/api/reference/inventory/inventorylevel#destroy
With GraphQL, there’s an inventoryLevelDeactivate mutation you can leverage:
https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/inventorydeactivate
Hope that helps!
Hi Alex, when using inventoryDeactivate mutation on graphql, how/where do I get the inventoryLevelId?
When querying the inventoryLevels, it doesnt return the inventoryLevel ID