App reviews, troubleshooting, and recommendations
Hi there,
I'm following the new mutation rules to apply stock update
I tested successfully inventoryAdjustQuantities & inventorySetOnHandQuantities mutation.
query
query_template = '''
mutation inventorySetQuantities($input: InventorySetQuantitiesInput!) {
inventorySetQuantities(input: $input) {
inventoryAdjustmentGroup {
reason
referenceDocumentUri
changes {
name
delta
quantityAfterChange
}
}
userErrors {
code
field
message
}
}
}
'''
# Variables for the mutation
variables = {
"input": {
"name": "available",
"reason": "correction",
"referenceDocumentUri": "logistics://some.warehouse/take/2023-01-23T13:14:15Z",
"quantities": [
{
"inventoryItemId": "gid://shopify/InventoryItem/49021181952338",
"locationId": "gid://shopify/Location/63449858218",
"quantity": 11,
"compareQuantity": 1
}
]
}
}
But with the InventorySetQuantitiesInput I have this error
{'errors': [{'message': "InventorySetQuantitiesInput isn't a defined input type (on $input)", 'locations': [{'line': 2, 'column': 33}], 'path': ['mutation inventorySetQuantities'], 'extensions': {'code': 'variableRequiresValidType', 'typeName': 'InventorySetQuantitiesInput', 'variableName': 'input'}}, {'message': "Field 'inventorySetQuantities' doesn't exist on type 'Mutation'", 'locations': [{'line': 3, 'column': 3}], 'path': ['mutation inventorySetQuantities', 'inventorySetQuantities'], 'extensions': {'code': 'undefinedField', 'typeName': 'Mutation', 'fieldName': 'inventorySetQuantities'}}, {'message': 'Variable $input is declared by inventorySetQuantities but not used', 'locations': [{'line': 2, 'column': 1}], 'path': ['mutation inventorySetQuantities'], 'extensions': {'code': 'variableNotUsed', 'variableName': 'input'}}]}
I search as well in the PostMan definition, I can Find inventoryAdjustQuantities & inventorySetOnHandQuantities method but not InventorySetQuantitiesInput
so this mutation is it available ?
thanks in advance
Solved! Go to the solution
This is an accepted solution.
I got the same error and more specifically (Error: Failed to set inventory quantity: InventorySetQuantitiesInput isn't a defined input type (on $input)). I learned that inventorySetOnHandQuantities is deprecated which is why I'm using InventorySetQuantitiesInput.
This is an accepted solution.
I got the same error and more specifically (Error: Failed to set inventory quantity: InventorySetQuantitiesInput isn't a defined input type (on $input)). I learned that inventorySetOnHandQuantities is deprecated which is why I'm using InventorySetQuantitiesInput.
Hi @seeker00 thanks a lot for you input.
Indeed you're right I did not notice this icon "deprecated" 😉
have a nice day
Just to clarify, you need to use the 2024-07 or later version of the API for the InventorySetQuantitiesInput to work.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025