Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Shopify Inventory Allocation Algorithm with Fulfillment Service

Nicholas_P
Shopify Partner
30 3 23

Hi there,

 

We're a 3PL, and our clients have been struggling for some time with inventory allocation within Shopify, particularly during high-volume sales events when a fulfillment is not automatically created after the order has been paid during checkout. Some of that may have been due to the way our integration worked, which was so old it actually predated Shopify's concept of a Fulfillment Service.

 

Having written a new integration with Shopify that uses the concept of a Fulfillment Service (with a /fetch_stock.json implementation and the whole 9 yards), I'm hoping someone at Shopify can explain if this scenario is properly addressed by Shopify.

 

Let's say for the sake of example, the option to automatically create the fulfillment in Shopify when the order has been marked as paid is turned off.

 

1. Product X has 10 units in stock. Shopify: 10 units, 3PL: 10 units.

2. Customer A places an Order A for 9 units of product X. The fulfillment is not created. Shopify: 1 unit, 3PL: 10 units.

3. Customer B places an Order B for 1 unit of product X, and the fulfillment is created, and is in a "pending" state. Shopify: 0 units, 3PL: 10 units.

4. Say our integration accepted the webhook, but hasn't marked the fulfillment on Order B as "open" yet. And of course we don't know about Order A at all. So if Shopify calls our "/fetch_stock.json" on Product X at this instant, we are going to return 10 units.

 

If Shopify went back and updated with 10 units, that would cause a stockout situation if a Customer C came along and placed an order. 

 

So what I'm asking is: in the context of a Fulfillment Service and when calling "/fetch_stock.json", is Shopify smart enough to do this as "take the fetch_stock.json number, and subtract out inventory from orders with fulfillments in 'pending' state, and also orders that are 'not fulfilled'"?

 

In other words, even though the concept of inventory allocation doesn't seem to be exposed as a first-class object in the Shopify API, is there some logic there to help address inventory on in-flight orders, particularly in the context of high-volume sales events?

 

In my testing on dev shop, it does indeed seem that Shopify behaves this way, which is great! But I can't find it documented anywhere. It'd be nice to understand if the logic is simply looking at "open" orders, or if the fulfillment status comes into play, or really how it is working at all.

 

Thanks for any clarification on this!

Replies 4 (4)

Josh
Shopify Staff
1134 84 233

Hey @Nicholas_P , 

 

Good news, I can answer this without a long-winded explanation. Yes, Shopify has protections in place to prevent overselling in the scenario that you've provided. We'll account for any inventory that is 'committed' (purchased, but fulfillment incomplete) and subtract that committed amount from whatever a fulfillment service provides us as an inventory level. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

MegH
Visitor
2 0 0

Is this also the case when not using a fulfillment service, but when our store hasn't fulfilled orders yet?  For instance, during a sale 50 orders come in overnight for one type of shirt.  We only had 60 in stock when the sale began, so, does Shopify keep track of how many of that particular shirt are already in orders that are fulfilled?  

MegH
Visitor
2 0 0

I mean not fulfilled?


@MegH wrote:

Is this also the case when not using a fulfillment service, but when our store hasn't fulfilled orders yet?  For instance, during a sale 50 orders come in overnight for one type of shirt.  We only had 60 in stock when the sale began, so, does Shopify keep track of how many of that particular shirt are already in orders that are fulfilled?  


 

Battlz123
Visitor
2 0 1

How long will it take for my products to start selling??????