I am looking at using inventoryBulkAdjustQuantityAtLocation, but inventoryItemAdjustments only provides a availableDelta field to change quantity, so if I want to update inventory to zero, I have to query for the value first, and this waste the limit points that I dont have enough. So can I directly set quantity of a variant to zero with one request?
Hi @Allonsy,
I believe that setting the quantity of a single variant can be achieved with the inventoryActivate
mutation. Sample below
mutation inventoryActivate($inventoryItemId: ID!, $locationId: ID!) {
inventoryActivate(inventoryItemId: $inventoryItemId, locationId: $locationId, available: 0) {
inventoryLevel {
id
available
}
userErrors {
field
message
}
}
}
Hopefully this helps you achieve what you're looking to do.
Best,
Seth.
syf_ | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me 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
User | Count |
---|---|
14 | |
12 | |
10 | |
8 | |
7 |