We have 2 locations (Store and Warehouse). Warehouse is our shipping origin so orders are assigned to this location as long as there is enough inventory (which is usually the case). But for orders with a shipping_lines title of “Store Pickup” we want to switch them to Store if this location has enough inventory to fulfil the order, otherwise leave it as Warehouse. On some occasions the order is assigned to the Store anyway if it’s the only location that has the inventory, in which case we would just skip it.
Yes, that should be possible. You could use the “Move fulfillment order” action in Flow. That will move the entire fulfillment order. If you need to move one or more items but not all, or items across multiple fulfillment orders, then you could call the API directly using “Send Admin API request” to split a fulfillment order and assign it to a new location
Thanks @paul_n . How would I determine whether the Store location has enough inventory to fulfil the order before using ‘Move fulfillment order’ to change the location for the whole order?
There are a few templates that show how to check location inventory. I’d install one and look at the path to the variables (you need to check both the name and available quantity). The path is roughly variant / inventory item / inventory levels / available and … location/name
An order has 0 to N fulfillment orders available at order / fulfillment orders. That action takes only one, so you either need a trigger that provides just one, or you can use For each to loop over order / fulfillment orders and then you can use that action inside the loop on the single fulfillment order.
That said, when an order is created, it has 0 fulfillment orders. They are assigned and then that triggers an fulfillment order ready to fulfill trigger for each fulfillment order that was made. So I would use that trigger, which will not require looping. The second option is to use a wait step after the trigger, something like 5 minutes. And then do the looping.
Thanks @paul_n . I am just getting around to looking at this again. I have changed the trigger to fulfillment order ready to fulfill, then run a check to see if the fulfillment order’s assigned location is Warehouse and the shipping line code is store-pickup (in which case we’d want to move it to Store if there is sufficient inventory at this location). What I’m struggling with is the next step: