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”
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)
Implemented the suggestion, but got the mutation error as follows:Exception: Mutation had errors: “Variable $input of type InventorySetQuantitiesInput! was provided invalid value”
“ ← 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: ```
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.
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:
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
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.