Flow inventorySetQuantities 2026-01

  • App: Shopify Flow

  • Workflow ID: 019d4a2b-6b76-7e76-91a9-4aa8c6016872

  • Issue: inventorySetQuantities and inventoryAdjustQuantities mutations both returning “Variable $input provided invalid value” in Flow’s Admin API action step

  • API version: 2026-01

What is the correct input structure for inventory mutations in Flow’s Send Admin API Request action for API version 2026-01?

Geeting the error “Exception: Mutation had errors: “Variable $input of type InventorySetQuantitiesInput! was provided invalid value”

Input- {
“mutation_name”: “inventorySetQuantities”,
“mutation_input”: “{\n “reason”: “correction”,\n “ignoreCompareQuantity”: true,\n “quantities”: [\n {\n “inventoryItemId”: “gid://shopify/InventoryItem/46568206139693”,\n “locationId”: “gid://shopify/Location/63312822306”,\n “name”: “available”,\n “quantity”: 12\n }\n ]\n}”,
“api_version”: “2026-01”,
“hydration_type_patch”: “{}”
}

Output- No data returned. This is expected for this action

Tried multiple times.

I am shopify basic plan

Both mutations tried:inventorySetQuantities and inventoryAdjustQuantities

  • Both failed with: Variable $input of type InventorySetQuantitiesInput! was provided invalid value

What is the correct working mutation structure for setting inventory quantity via Flow’s Send Admin API Request action in 2026-01?

If I remember it properly, this most likely is caused by invalid JSON; when input is missing values they are named.
Though I did not test simlar setup recently.

Other then that:

ignoreCompareQuantity is deprecated, so this could be a reason;
referenceDocumentUri even though it’s not marked as required was necessary (last time I tried the mutation)

Dox – inventorySetQuantities - GraphQL Admin

Implemented the suggestion, but got the mutation error as follows:Exception: Mutation had errors: “Variable $input of type InventorySetQuantitiesInput! was provided invalid value”

Input: {
“mutation_name”: “inventorySetQuantities”,
“mutation_input”: “{\n “reason”: “correction”,\n “referenceDocumentUri”: “logistics://replenishment/auto”,\n “quantities”: [\n {\n “inventoryItemId”: “gid://shopify/InventoryItem/53885106422061”,\n “locationId”: “gid://shopify/Location/63312822306”,\n “name”: “available”,\n “quantity”: 12\n }\n ]\n}”,
“api_version”: “2026-01”,
“hydration_type_patch”: “{}”
}

Output

No data returned. This is expected for this action

“locationId”: “gid://shopify/Location/63312822306”

:eyes: ← those are curly quotes, use proper double quotes in code: "

This is often from bad practices such as copy’ing and pasting from word-processing software, OS system settings / browser extensions to modify clipboard contents to try to be fancy or other nonsense , and now adays can be from using bad ai-tools.

Or the forums itself mangling code so it’s a false positive but your initial code is okay /shrug who knows can’t tell without proper formatting.
There is reason the why it’s important to put effort into properly formatting things when you are seeking help outside your area of expertise.
A reason the experts using the code BLOCK formatting for code that should happen when selecting multiple lines and pressing the code formatting button; wraps text in triple backtick fences: ```

It make stuff like this WAAY more obvious:

{
“mutation_name”: “inventorySetQuantities”,
“mutation_input”: “{\n “reason”: “correction”,\n “referenceDocumentUri”: “logistics://replenishment/auto”,\n “quantities”: [\n {\n “inventoryItemId”: “gid://shopify/InventoryItem/53885106422061”,\n “locationId”: “gid://shopify/Location/63312822306”,\n “name”: “available”,\n “quantity”: 12\n }\n ]\n}”,
“api_version”: “2026-01”,
“hydration_type_patch”: “{}”
}

no syntax highlighting indicates broken code.
compare that to @tim_tairli 's sample or any sample in the api docs.


Otherwise if curly quotes are a false positive you then it’s api/graphql troublshooting 101:
take a step back and go through it properly before involving others.
Use the shopify-graphiql app, or the shopify cli etc, to learn what a properly shaped request looks directly with the api.
https://shopify.dev/docs/api/usage/api-exploration/admin-graphiql-explorer
Then use that to troubleshoot secondary usage systems

There’s also making the flow less dynamic and replacing all variables for static hard coded values to see what a correct structure should be.

Further just do the internet research of the general error message:
https://www.google.com/search?q=shopify+Variable+%24input+of+type+was+provided+invalid+value

It’s definitely work.

I agree with you, though Shopify’s native AI has created so many flows successfully, but failing in creating this one. In this case, the flow is executing successfully but failing in the Send Admin API request.

Implemented your suggestion, but still got the error as follows:

Input: {
“mutation_name”: “inventorySetQuantities”,
“mutation_input”: “{\n “reason”: “correction”,\n “referenceDocumentUri”: “logistics://replenishment/auto”,\n “quantities”: [\n {\n “inventoryItemId”: “gid://shopify/InventoryItem/47842498314541”,\n “locationId”: “gid://shopify/Location/63312822306”,\n “name”: “available”,\n “quantity”: 12\n }\n ]\n}”,
“api_version”: “2026-01”,
“hydration_type_patch”: “{}”
}

Output: No data returned. This is expected for this action

To aviod any kind of confusion around quote marks, use </> button to paste your code/JSON/error messages.

I installed Shopify’s GraphiQL
app and tested. It showed successful result with the following mutation “mutation {
inventorySetQuantities(input: {
name: “available”,
reason: “correction”,
referenceDocumentUri: “logistics://replenishment/auto”,
quantities: [{
inventoryItemId: “gid://shopify/InventoryItem/47664006070573”,
locationId: “gid://shopify/Location/63312822306”,
quantity: 12,
changeFromQuantity: 10
}]
}) @idempotent(key: “replenish-47664006070573”) {
userErrors { field message }
}
}” and inventory value changed from 10 to 12 exactly the result I wanted. But in actual run when order is recived flow thrown the error

Run code: Succeeded

Input : {
“productVariant”: {
“inventoryItem”: {
“inventoryLevels”: [
{
“location”: {
“id”: “gid://shopify/Location/63312822306”
},
“available”: 11
}
]
}
}
}

Output : {
“message”: ,
“return_value”: {
“currentQuantity”: 11
}
}

Send Admin API request : Failed

Input:

{
“mutation_name”: “inventorySetQuantities”,
“mutation_input”: “{\n “name”: “available”,\n “reason”: “correction”,\n “referenceDocumentUri”: “logistics://replenishment/auto”,\n “quantities”: [\n {\n “inventoryItemId”: “gid://shopify/InventoryItem/53822459248941”,\n “locationId”: “gid://shopify/Location/63312822306”,\n “quantity”: 12,\n “changeFromQuantity”: 11\n }\n ]\n}”,
“api_version”: “2026-01”,
“hydration_type_patch”: “{}”
}

Output:

No data returned. This is expected for this action

Shopify’s native AI has now built a custom app for me to replenish quantities for products that fall within certain thresholds with a single click. With the help of Power Automate and Windows Task Scheduler, I run a scheduled task once a day to click the App’s replenish button, and now my issue is resolved. Thank you all for reading and proposing solutions.