Logo
June 12, 2018
By Erwin Otten

What is Magento MSI? An overview of Multi Source Inventory features

The latest version of Magento (available as of Q3 2018) will contain a very valuable extension: Magento MSI, or multi source inventory.

Already available for download via Github

With Magento MSI it's possible to link multiple inventory sources to one or multiple websites. The amount in which a product is available, is calculated based on the sources made available for that website. Grouping multiple sources and defining the relation between sources and webshops is done with a new concept: 'stocks'.

Salable quantity - the total sum of the stocks - mutates immediately when a sale is processed. But, deducting the source of a product is postponed until a shipment is created. This is done via 'source selection algorithms', which have to be writen in code (for the time being), but possibly will be configurable in the feature.

Complicated? Sure!

But MSI is a very big step for Magento.

Note: Magento MSI still in development. We are looking for the right terms for the concepts within the system. They can be different in the final release of Magento MSI.

When is Magento MSI the perfect solution?

Until now, multi inventory was only possible with the use of third party modules. Because there was no support in the core, available solutions were very complex. And there was big challange in making the available solutions compatible with core modules and other third party modules.

The reason for this complexity?

Stock (qty) was always global. It was not possible to overwrite this value on a deeper level.

Configuration

Default (global)

Website

Store Group

Store View

Base URL

Product price

Product qty

Locale (language fronted)

Product visibility

Orders

Customers

Root category configuration

MSI

Decoupled

The new Magento MSI is completely decoupled from layered configuration illustrated above. Relations between websites and stocks can be created in any way desirable and are unaffected by the way a Magento shop is configured.

Because 'stock' is now separated from 'salable quantity' (more about that later), a configuration with backorders or pre-orders can also be implemented.

Magento multi source inventory is interesting for the following (imaginary) situations:

  • A webshop delivers from the warehouse and, if warehouse stock is exhausted, from it's physical store stock. Both stock locations are registered as a source in Magento. The source selection algorithm gives priority to warehouse stock and falls back on stock available in the store.
  • A B2B webshop in accessories has a large assortment constructed out of several international dropship suppliers. Various suppliers can ship the same product. The total sum of the various sources is shown to customers as 'stock available'. When orders are shipped, the supplier with the highest margin is automatically selected, in combination with the lowest shipping costs (based on the shipping address of the customer).
  • A retail chain has 500 stores. The cash register software is connected with Magento. In Magento the stock per physicial store is registered and synchronised. When visiting the webshop, users can see exactly in which quantity their local neighborhood store has a specific product on stock.
  • A Dutch webshop has fulfillment partners in Spain and Ukraine. There are 4 websites in 5 languages: Netherlands (NL), Belgium (NL / FR), France (FR), Germany (DE). The Dutch, Belgian and French shop can sell from the stock available at the fulfillment partner in Spain. The German webshop can sell both stock available at the fulfillment partner in Spain and stock available in Ukraine.

Registering sources

New in Magento Multi Source Inventory are sources. A source represents a place where stock is physically located. You create a source for each location where products can (or can) be physically on a shelf. Examples of sources are a store, the central warehouse and the warehouse of the fulfillment partner.

For each source that is created, a number can be entered for a product.

In our example we register 4 sources. Warehouse (Warehouse) LA, Warehouse DE, Store NL (stock in the store) and the Warehouse in NY.

The amount of information required for creating a resource is limited. Actually, only name and code are relevant at this point.

Merge inventory from different sources with stocks

Another new concept is 'stocks'. A stock groups multiple sources and is linked to a channel. A channel is a new term; you choose a website here.

A stock serves as a virtual, aggregated representation for the sources of a sales channel.

A bit cryptic, but remember this.

In our example, we create a stock which consists of the sources Store NL and Warehouse DE.

Stock: Europe

Sources: Store NL, Warehouse DE

A stock is linked to a website. This means that all sales via this website are deducted from one (or more) sources that are part of the stock.

The final source(s) from which the stock is deducted when creating a shipment is selected via the sourceselection algorithm. But more about that later.

This overview shows our current setup:

Stock: Europe

Sources: Store NL, Warehouse DE

Stock: US

Sources: Warehouse NY, Warehouse LA

The beauty of this construction is that expanding requires little effort. If we want to open an extra warehouse in France (or choose a fulfillment partner), we only have to create a source and link it to the Europe stock. And possibile to the US stock, if we want to enable shipping to the US from france.

Registering inventory per source

Now that sources and stocks have been created, it is interesting to look at the product edit page in the Magento admin panel.

Per source created, it's possible to fill in the number available for this product. In our case, that is stock for the sources Store NL, Warehouse DE, Warehouse LA and Warehouse NY.

Salable Quantity

Summary so far: for each product, you register the number of items per source. Several sources combined form a stock. A stock is linked to a website.

In the product grid we can see two new columns: Quantity per Source and Salable Quantity

With MSI, an important shift has been made regarding the way stock is handled in general

Quantity per source represents (as visible in the column) the physical stock at a location. We do not want to change this figure until a shipment has been created. Not when an order is placed, which is the case in previous versions of Magento.

New is 'Salable Quantity'. Salable Quantity is the sum of available resources, grouped in stocks. Because of the relationship between stocks and channels (websites), we cansee all stocks in the adminpanel, but the salable quantity per website is different.

In our case:

Europe = 2 (Store NL: 2 + Warehouse DE: 0)

There are only 2 products salable via websites linked to the 'Europe' stock

US = 18 (Warehouse LA: 12 + Warehouse NY: 6)

There are 18 products salable via websites linked to the 'United States' stock

A visitor using a webshop linked to the EU stock, can only order 2 pieces of the product. But, visitors in the US can order 18 pieces of the product.

If an order is placed, the ordered quantity is deducted from the salable number.

Just like 'qty' did before, the value 'salable quantity' triggers a number of notifications and actions (depending on configuration):

  • Sets 'in stock / out of stock' status at stock 0
  • Shows as stock number on the frontend, if desired
  • Shows notification when a visitor places more products in a shopping cart than available

Source selection algorithm

Salable quantity is mutated when an order is placed and paid.

It really gets interesting when we create a shipment. It is only at this moment that it is calculated from which source stock is actually deducted.

This is done via a newly introduced concept: Source selection algorithms.

Source selection algorithms can be used to calculate from which source(s) an order can be delivered in the most efficient (or prefered) way, using all interesting information from customers, products, addresses, stock and sources.

For example:

  • Orders are always sent from store stock, unless quantity ordered is larger than actual stock. Then orders are send from the central warehouse.
  • Use the source that has sufficient stock to deliver all ordered products.
  • Orders are sent on the basis of the nearest department store based on the shipping address of the customer.
  • In a situation where several suppliers offer the same product: based on the highest product margin.

Performance

That source selection happens when making shipments, instead of when placing an order, is no coincidence.

Source selections algorithms can be very complex and therefore require computing power and time to exectue. Especially if they are performed as part of a mass action.

Performance has been an important focal point during the development of the Magento MSI module. By selecting the actuel source later, the Magento checkout remains blazing fast.

Partial shipments

Magento multi inventory does support partial shipments. When creating a shipment, it is possible to choose for how many ordered items a shipment is created.

This way, there is some room for tweaking the way an order is shipped manually.

For example in a situation where a customer indicates that he / she wants to have a specific product delivered upfront after placing an large order. A customer service representative can make a partial shipment to deliver the products available from store stock, as where the source selection algorithm would haved delivered from the central warehouse (with a longer delivery time).

Available source selection algorithms

At the launch of Magento MSI, one source selection algorithm will be available: Source priority.

In other words; The priority is set manually for the various sources (department stores, warehouse, external supplier).

Set the source priority

Pro tip: When setting the sources of a stock, the order determines the priority.

A number of other preconditions can be found from reading the source code:

https://github.com/magento-engcom/msi/blob/2.3-develop/app/code/Magento/InventorySourceSelection/Model/Algorithms/PriorityBasedAlgorithm.php
  • Only take sources in consideration that have at least 1 number of the ordered product
  • If all sources added up do not have enough stock to supply, the shipment can not be created

Source selection algorithms can be programmed according to your own wishes.

Some insight news: Amasty will have a set of source selection algorithms available at the launch of Magento MSI.

How to install Magento MSI?

Multi source inventory is part of Magento 2.3, so will be available in your adminpanel after upgrading. During the upgrade, one source and one stock are created (the defaults).

If there is no interest in using Magento's multi source inventory features, there is no obligation to do so.

Please note: when using the MSI features (sources or stocks are created) at launch, there is no compatibility with grouped and bundled products. Support for these product types is a feature that is at the top of the roadmap for the follow-up release of Magento MSI.

June 12, 2018
By Erwin Otten

Looking for a Magento webshop specialist?

We'd love to get in touch with you. Let's start a Magento webshop project?