Hi there! I need a favor. Right now, I need to perform a bulk import to update the inventory of some products. I used this documentation (https://shopify.dev/docs/api/usage/bulk-operations/imports)
with the productVariantsBulkUpdate
mutation. I’d like to know if there’s another way to make this update, or if it cannot be done in bulk.
Hi Jason,
I’d suggest taking a look at the inventorySetQuantities mutation to update inventory quantities. You’ll need the following for each level you want to update:
- the location ID
- the inventory item ID
- the new amount
Depending on your use-case, you might also want to set ignoreCompareQuantity=false
if you’re running into issues with passing the current level in compareQuantity
.
Best,
Daniel
Thank you for the response, but I have another question. In the documentation for Bulk Import Data with the GraphQL Admin API, it states that bulkOperationRunMutation
has limitations for running processes in bulk. It allows only a defined list of mutations that can be executed. Can this mutation be executed in bulkOperationRunMutation
?
No, only mutations from the list are accepted
Ok, then, isn’t there a way to update the inventory in bulk? It just doesn’t make sense that it can’t be done!