A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi all,
I'm trying to workout how to bulk update inventory via API for a single location.
I've tried the rest API and can update one item at one location, but it won't allow multiple inventory_item_ID updates at a location.
I also found the below mutation here: https://www.shopify.com/ca/partners/blog/multi-location_and_graphql
mutation {
inventoryBulkAdjustQuantityAtLocation(
locationId: "gid://shopify/Location/1",
inventoryItemAdjustments: [
{inventoryItemId: "gid://shopify/InventoryItem/1", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/2", availableDelta: 10}
]) {
inventoryLevels {
available
}
}
}
have edited it to my location IDs and inventory, but am getting the below response without updates.
mutation {
inventoryBulkAdjustQuantityAtLocation(
locationId: "gid://shopify/Location/67933143202",
inventoryItemAdjustments: [
{inventoryItemId: "gid://shopify/InventoryItem/7085453803682", availableDelta: 99},
{inventoryItemId: "gid://shopify/InventoryItem/7085453508770", availableDelta: 99}
{inventoryItemId: "gid://shopify/InventoryItem/7085453476002", availableDelta: 99}
{inventoryItemId: "gid://shopify/InventoryItem/7085453410466", availableDelta: 99}
]) {
inventoryLevels {
available
}
}
}
{ "data": { "inventoryBulkAdjustQuantityAtLocation": { "inventoryLevels": null } }, "extensions": { "cost": { "requestedQueryCost": 10, "actualQueryCost": 10, "throttleStatus": { "maximumAvailable": 2000, "currentlyAvailable": 1990, "restoreRate": 100 } } } }
Any ideas on what I'm missing here?
Hi Luke_f,
When testing that format of updating multiple items at once in a test store it worked ok. That "inventoryLevels": null value was replicable by doing a couple different things intentionally as a test which leads to these suggestions:
-
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