Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
I have multiple locations where I need to set the inventory of each product variant to 0 if the current inventory is 2 or less.
If there was an action feature to update stock quantity in Shopify Flow, this would solve my problem. I can set the logic as:
Trigger: Inventory Quantity Changed
Then: Check if inventory is less than 3
Action: Update inventory quantity to 0
Send HTTP Request:
Complete Flow
This flow is functioning correctly for a single location. However, I have multiple locations where I need to set the inventory of each product variant to 0 if the current inventory is 2 or less.
I attempted the following HTTP request, but it did not work:
{
"locations": [
{
"location_id": 84738277671,
"inventory_item_id": "{{productVariant.inventoryItem.legacyResourceId}}",
"available": 0
},
{
"location_id": 84738179367,
"inventory_item_id": "{{productVariant.inventoryItem.legacyResourceId}}",
"available": 0
},
{
"location_id": 93070983463,
"inventory_item_id": "{{productVariant.inventoryItem.legacyResourceId}}",
"available": 0
}
]
}
You need a separate request for each of those.
You could probably also loop over the locations for the inventory item and put the location id in via a loop. (Use "for each").
But doing that 1x1 is fine.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025