400 error when using Flow, but succesfull with postman

Hi Drsw,

Looking at your error, it looks like your request is prefixed with a “\n”, likely from the “assign” line if your liquid adding a newline. Replacing {% %} with {%- -%} will remove newlines when evaluating Liquid.

Try this:

{%- assign inventory = lineItemsForeachitem.variant.inventoryQuantity|plus:1 -%}
{
"location_id":84988625182,
"inventory_item_id":{{lineItemsForeachitem.variant.inventoryItem.id|split:"/"|last}},
"available":{{inventory}}
}

Hope that helps!