Split fulfillment requests based on item stock level

dverzani
Shopify Partner
6 0 2

I want to create a workflow that gets triggered when an order is created that only sends a fulfillment request to a fulfillment service for the items on the order that are currently in stock.  Then, later down the road when the out of stock items become available, send the new fulfillment request.

 

So far I have not been able to figure out the exact setup to do this.  The fulfillment requests in my attempts get created for for both the in stock and out of stock items.  

 

Any ideas? Thanks for any help someone can provide

Replies 5 (5)

paul_n
Shopify Staff
956 128 225

The first part of that should be achievable through one workflow. 

 

The second part, where you wait for something to come back in stock, it a totally separate automation because it needs to trigger at a different time. You could do something like:

  • Every day
  • Get fulfillment order data (where status is open or something like that)
  • For each fulfillment order
    • Check if inventory is in stock
    • If yes, send fulfillment request
Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
dverzani
Shopify Partner
6 0 2

Thanks Paul for the response.  Could you provide me an example of what it would look like for the initial flow when a new order is placed.  For example, a 2-item order gets placed for 1 quantity each.  Only 1 of the products is in stock.  I want it to immediately send the fulfillment request for that 1 item.  Order Created would be my trigger, send fulfillment request my final action, but I am unsure of the in between conditions and actions I need to take to make sure only the instock item comes over as its own fulfillment order.  Thanks!

paul_n
Shopify Staff
956 128 225

To partially fulfill like that, you'll need to call the API using Send HTTP Request:

https://shopify.dev/docs/api/admin-graphql/2023-10/mutations/fulfillmentOrderSubmitFulfillmentReques...

 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
dverzani
Shopify Partner
6 0 2

Thanks for all your help.  Pretty surprising to me that Shopify doesn't do this natively in some fashion.  

How about this "hacky" workaround.  I have a fulfillment app location that is my source of truth for inventory, and then I create another Shopify normal location that just has all my products with fictitiously high inventory levels on them that I don't make available for online sale.  My fulfillment app location would the highest on the ranked locations order routing priority list.  So, when an order gets placed for 2 items, 1 in stock in and 1 not in stock in the fulfillment app location, it does the split that way.  If that works, then I would need a shopify flow workflow to check for when an item becomes available to fulfill in the app location, assigns the item to that location for fulfillment, then sends the fulfillment request.  Does that seem doable?

paul_n
Shopify Staff
956 128 225

We could easily add that mutation, but it would be very difficult to actually set it the way you want. This feature requires the ability to run logic on lists in order to filter them, and then changing the lists to include more data as needed by the mutation. When Flow has a code action, this will be way easier. 

 

I think that would work. You could test by adding that location and assigning a single test product.

 

 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.