API versoin 2025-04
Is this a bug that quantityAfterChange
is null
mutation InventorySetQuantities($input: InventorySetQuantitiesInput!) {
inventorySetQuantities(input: $input) {
inventoryAdjustmentGroup { #defines the properties that are returned. Note it is not possible to limit getting both OnHand and Availble inventory types in the return so need to filter out on our end if needed.
id
createdAt
reason
changes {
item {
id
}
name
delta
quantityAfterChange
}
}
userErrors {
field
message
}
}
}
{
"input": {
"name": "on_hand",
"reason": "correction",
"ignoreCompareQuantity": true,
"quantities": [
{
"inventoryItemId": "gid://shopify/InventoryItem/41711590080582",
"locationId": "gid://shopify/Location/{{location_id}}",
"quantity": 35
},
{
"inventoryItemId": "gid://shopify/InventoryItem/34431475449926",
"locationId": "gid://shopify/Location/{{location_id}}",
"quantity": 18
}
]
}
}
Result:
{
"data": {
"inventorySetQuantities": {
"inventoryAdjustmentGroup": {
"id": "gid://shopify/InventoryAdjustmentGroup/20783537684550",
"createdAt": "2025-05-06T20:09:32Z",
"reason": "correction",
"changes": [
{
"item": {
"id": "gid://shopify/InventoryItem/41711590080582"
},
"name": "available",
"delta": 3,
"quantityAfterChange": null
},
{
"item": {
"id": "gid://shopify/InventoryItem/34431475449926"
},
"name": "available",
"delta": 2,
"quantityAfterChange": null
},
{
"item": {
"id": "gid://shopify/InventoryItem/41711590080582"
},
"name": "on_hand",
"delta": 3,
"quantityAfterChange": null
},
{
"item": {
"id": "gid://shopify/InventoryItem/34431475449926"
},
"name": "on_hand",
"delta": 2,
"quantityAfterChange": null
}
]
},
"userErrors": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 12,
"actualQueryCost": 12,
"throttleStatus": {
"maximumAvailable": 2000.0,
"currentlyAvailable": 1988,
"restoreRate": 100.0
}
}
}
}