Flow to reduce inventory for orders - need help with inventoryAdjustQuantities call

Hey all,

I’ve got orders coming into Shopify through a third party tool from a 3rd party POS (Clover). The orders come into Shopify unfulfilled, even though they represent instances where a customer bought product and walked out of the store with it, where fulfillment is not necessary. I’ve created a Flow that marks the orders as fulfilled, but apparently the Shopify Flow action “Mark a fulfillment order as fulfilled” doesn’t reduce inventory when it’s triggered, which I also need to occur.

So I’m trying to add the Admin API Request action for ‘inventoryAdjustQuantities’ to also reduce my inventory for each of these orders by the products that were ordered. I’ve prepared the code shown below to do this - the Shopify helper Bot believes this should work as expected, but I’m getting an error “Exception: Mutation input evaluated to invalid JSON. Please ensure the input forms valid JSON after Liquid code is run.” Can anyone take a look at this logic, and help me trouble shoot what would be breaking here? Thanks in advance!

{
“input”: {
“reason”: “flow_correction”,
“name”: “available”,
“changes”: [
{
“delta”: “-{{lineItemsForeachitem.totalQuantity}}”,
“inventoryItemId”: “{{lineItemsForeachitem.inventoryItemId}}”,
“locationId”: “gid://shopify/Location/77014401211”,
}
]
}
}

I found the answer once I finally bit the bullet and posted here, posting it so that others can find it in the future. Ultimately I just had a couple syntax errors in what was posted. This appears to run successfully:

{
“input”: {
“reason”: “correction”,
“name”: “available”,
“changes”: [
{
“delta”: -{{lineItemsForeachitem.totalQuantity}},
“inventoryItemId”: “{{lineItemsForeachitem.inventoryItemId}}”,
“locationId”: “gid://shopify/Location/77014401211”
}
]
}
}