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.

Re: I want to update inventory quantity of variants in bulk

Solved

I want to update inventory quantity of variants in bulk

Tayyab_sheikh
Shopify Partner
2 0 2

I am updating price of variants of products in bulk by creating jsonl file and uploading on shopify server and using this mutation
mutation {
bulkOperationRunMutation(
mutation: "mutation call($input: ProductVariantInput!) {productVariantUpdate(input: $input) {
productVariant {
id
last_submitted_price: price
}
userErrors {
field
message
}
}
}",
stagedUploadPath: "#{key}") {
bulkOperation {
id
url
status
}
userErrors {
message
field
}
}
}
But I also want to update inventoryQuantity in bulk using inventoryActivate graphql API in the same way as I submited price in bulk but I could not do that. i dont know where I am doing mistake. Please guide ma how can i do this in the same pattern which I am using

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 239 534

This is an accepted solution.

Hey @Tayyab_sheikh

We outline the BulkOperationsRunMutation (import) mutations that are available along with some other limitations; see doc here - import limitations. While the inventoryActivate mutation is not listed there, depending on the API version you are using it may be worth exploring and testing other approaches to inventory management. 

For example, using the productVariantUpdate mutation, the inventoryItem input can help configure tracking and the inventoryQuantities input is used for setting the inventory level of a variant at a specified location. There is also an updated overview of inventory management workflows for apps that provide this sort of management.  

I hope the above provides a few insights and resources for you to work with!  

Cheers - @awwdam 
Shopify Developer Support

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

View solution in original post

Replies 4 (4)

ShopifyDevSup
Shopify Staff
1453 239 534

This is an accepted solution.

Hey @Tayyab_sheikh

We outline the BulkOperationsRunMutation (import) mutations that are available along with some other limitations; see doc here - import limitations. While the inventoryActivate mutation is not listed there, depending on the API version you are using it may be worth exploring and testing other approaches to inventory management. 

For example, using the productVariantUpdate mutation, the inventoryItem input can help configure tracking and the inventoryQuantities input is used for setting the inventory level of a variant at a specified location. There is also an updated overview of inventory management workflows for apps that provide this sort of management.  

I hope the above provides a few insights and resources for you to work with!  

Cheers - @awwdam 
Shopify Developer Support

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

DanubioBlu
Shopify Partner
13 0 6

Sorry but on doc is writtent

 

ProductVariantInput.inventoryQuantities

The inventory quantities at each location where the variant is stocked. Used as input only to the productVariantCreate mutation.

 

You cannot set Quantities Level on ProductVariantUpdate

 

aymanelmadidi
Shopify Partner
1 0 0

Exactly you can't use it to update unfortunately. anyone found a solution?