I need to update the available quantity for a variant to which I only have the ID available.
From my understanding I can get the InventoryItem ID easily with a call for the variant data. Now to update the InventoryLevel I also need the location_id but how do I get that one? How can I update the available quantity?
Below is a GraphQL API example of how you can query a product variant's inventory item's inventory levels to see on-hands by location. Once you get your locations then you can issue a GraphQL mutation request to change the on-hand availability for a particular location. As for the mutation, it's discussed here --> https://www.shopify.com/partners/blog/multi-location_and_graphql.
Hope this helps!
That is helpful. Thank you very much. Do you know if it would be possible to have the same inventoryitem for two different products?
So that they share the quantity and if one decreases, the other one does too?
As far as I'm aware, each InventoryItem is a unique record based on its ID. So I don't think that more than one Product (or ProductVariant) can share the same InventoryItem ID.
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...By Ollie Jul 28, 2022