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.
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024