How To Tell If An Order Should Be Fulfilled By SFN or Other Warehouse Location

KJWebPro
Shopify Expert
20 0 2

This seems like it should be a basic ask, but I just want to ensure we follow best practice when setting this up. We are transitioning a Plus site to Shopify Fulfillment Network, but there are a couple scenarios where a secondary warehouse would fulfill a line item. We need to alert the secondary warehouse to fulfill a line item when:

  • An order contains one of a few products that won't be fulfilled by SFN (e.g. "hazardous" items SFN can't fulfill yet, like hand sanitizer)
  • An order contains an item that is out of stock at SFN, but still in stock at the secondary warehouse
Would the best way to alert the secondary warehouse to an item they need to fulfill be to subscribe to an order webhook? Where can you tell in an order webhook JSON which location a line item's fulfillment/stock is being drawn from?  I'm not seeing that in the JSON.
 
Or what is the best way to tell if a separate location / fulfillment service has items to fulfill on an order?
0 Likes
O0O0
Shopify Staff
Shopify Staff
5 0 1

Hello!

 

For the first scenario you mentioned, Shopify will assign the item to be fulfilled by the location that does stock it. So only stocking the hazardous items in the non-SFN location should do the trick.

 

For the second stock-related scenario, if the item is out of stock, Shopify should automatically assign the order to a next location that does still have stock left. 

 

Check out the FulfillmentOrder resource for more details:

 

https://shopify.dev/tutorials/manage-fulfillments-with-fulfillment-and-fulfillmentorder-resources

0 Likes
KJ_Kevin
Shopify Partner
4 0 1

Thanks for the reply. We're still looking for a way to get the FulfillmentOrders for a location that has inventory tracked by Shopify (e.g. "St. Louis Warehouse").

 

If we try to use assigned_fulfillment_orders.json to get fulfillment orders for the Shopify-tracked "St. Louis Warehouse" location, we are given the error "The api_client is not associated with any fulfillment service." It seems it won't return FulfillmentOrders unless we use a FulfillmentService location.

 

If we create a FulfillmentService for "St. Louis Warehouse" though, we have a different problem, as now we can't manage inventory inside of Shopify and products that run out of stock at SFN would need to have their "Inventory managed by" setting changed to "St. Louis Warehouse" whenever they run out of stock at SFN.

 

Can we get FulfillmentOrders for a Shopify-tracked location instead of needing to create a FulfillmentService?

0 Likes
O0O0
Shopify Staff
Shopify Staff
5 0 1

You can use our Fulfillment Order GraphQL API. You can then filter by `assignedLocation` as well as filter orders by a `location_id`. See this walkthrough:

 

https://shopify.dev/tutorials/manage-fulfillments-with-fulfillment-and-fulfillmentorder-resources#or...