Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Change Inventory Location

Change Inventory Location

Simon20
Visitor
1 0 0

I'm trying to simplify how we handle locations on our store.

Currently, we have 3 possible locations for products - 2 'app' locations and a shopify location.

I'm trying to move all products onto a single app location through graphql. 

I've tried using the productVariantUpdate mutation and sending through just the variant id, and inventoryQuantities set with available quantity and location id.

This returns no errors but changes nothing

 

any ideas? I can't see anything anywhere in the docs that suggest an alternate way of doing thisScreenshot 2022-12-19 135358.jpg

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 525

Hi @Simon20 👋

 

The `inventoryQuantities` in the `productUpdateVariant` docs highlight that this particular field is meant to be used as an input to the `productVariantCreate` mutation. In order to modify the inventory, we will need to use the `inventoryAdjustQuantity` mutation (or `inventoryBulkAdjustQuantityAtLocation`) on the Inventory object directly. There is a great breakdown of the relationships between the inventory resources here as well.

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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