-
Notifications
You must be signed in to change notification settings - Fork 247
Configure MSI SSA
DEVELOP User Guide - This guide provides MSI Develop Branch/Active Development merchant information on Magento Multi Source Inventory (MSI) features and project.
You have two out-of-the-box Source Selection Algorithms available for recommending the best shipping and inventory quantity deductions for your stores:
- Source Priority
- Distance Priority
If you use the Distance Priority algorithm, we recommend also configuring the Source Priority. If distance cannot be determined using the configurations and addresses in the Distance Priority, the SSA falls back to Source Priority for shipment recommendations.
Custom stocks include an assigned list of sources to sell and ship available product inventory through your storefront. This algorithm uses the order of assigned sources in your stock to make recommendations.
When run, the algorithm:
- Works through the configured order of sources at the stock level starting at the top
- Recommends a quantity to ship and source per product based on the order in the list, available quantity, and quantity ordered
- Continues down the list until the order shipment is filled
- Skips disabled sources if found in the list
To configure, assign and order sources to a custom stock. See Assigned Sources and Priorities.
This algorithm compares the location of the shipping destination address with source locations to determine the closest source to fulfill shipments. The distance may be determined by physical distance or time spent traveling from one location to another, using imported database location data or Google directions (driving, walking, or bicycling).
We recommend entering full street address and GPS coordinate information in your sources if using the Distance Priority algorithm. Google MAP uses your GPS coordinates and your street address. Offline Calculation uses the city, state, country, and zip codes.
You have two options for calculating distance:
- Google MAP: Uses Google Maps Platform services to calculate the distance and time between the shipping destination address and source locations. This option uses the source's Latitude and Longitude (GPS coordinates) and may use the street address depending on the computation mode. You must provide a Google API key with Geocoding API and Distance Matrix API enabled. This option requires a Google billing plan and may incur charges through Google.
- Offline Calculation: Calculates the distance using downloaded and imported geocode data using zip/post codes and GPS coordinates to determine the closest source to the shipping destination address. To configure this option, you may require developer assistance to initially download and import geocodes using a command line.
You do not need a Google account to get started. The process includes Google account and project creation if needed. This option requires a billing account and payment method to complete configurations and use the algorithm.
Step 1: Create the Google API Key
-
Visit Google Maps Platform and click Get Started.
-
To enable the platform, select Maps, Routes, and Places and click Continue.
-
Sign in with a Google account or create a new account.
-
Set up the project:
- Select a project or enter a new project name.
- Select Yes to accept the terms.
- Click Next.
-
Enter a billing account or create one. You can skip and add a billing account later.
-
Click Console to open and configure your Google Cloud Platform options.
- Open your project.
- Expand the menu and click APIS & Services > Library.
Google API Services - Search for Geocoding API and Distance Matrix API. Select and enable each service.
Google API Key Copy
Step 2: Configure the Google MAP Provider
-
On the Admin sidebar, tap Stores. Then under Settings, choose Configuration.
-
In the panel on the left under Catalog, choose Inventory.
-
Expand the Distance Provider for Distance Based SSA section, and set Provider to "Google MAP".
Google MAP Provider -
Expand the Google Distance Provider, and configure the settings:
Google MAP Configurations -
Enter the Google API Key, copied from your Google Cloud Platform project.
-
For Computation mode, select a configuration. If distance cannot be determined based on the computation mode, the Source Priority is used.
- Driving: Default setting, requests standard driving directions using the road network
- Walking: Requests walking directions using pedestrian paths and sidewalks (where available)
- Bicycling: Requests bicycling directions using bicycle paths and preferred streets (where available). The Distance Matrix Service is currently only available in the US and some Canadian cities.
-
For Value, select a value type:
- Distance: Default setting, returns the distance between points in metrics (kilometers and meters) or imperial (miles and feet)
- Time to Destination: Returns the time required to travel from the source locations to the shipping address in hours and minutes
-
-
When complete, tap Save Config.
Important: If routes and data does not return for the selected Computation mode (driving, bicycling, or walking) for a shipment, the SSA defaults to using the Source Priority.
Offline calculations use country codes to determine the distance between the shipping destination and source addresses. This option may require developer assistance to configure. You will issue an Inventory Management CLI command to download and import data from geonames.org.
Step 1: Download and Import Geocodes
-
Open a command line.
-
Enter the following command with a space separated list of country codes (using ISO-3166 alpha2 on geonames.org):
php bin/magento inventory-geonames:import <country code>
The system downloads and imports the geocodes data to your database. A message displays "Importing country code: OK" when complete.
For example, if you want to import geocodes for the United States, United Kingdom, Italy, and France, you would use the command:
php bin/magento inventory-geonames:import us gb fr it
Run this command anytime you need to add more geocodes.
Step 2: Configure Offline Calculation
- On the Admin sidebar, tap Stores. Then under Settings, choose Configuration.
- In the panel on the left under Catalog, choose Inventory.
- Expand the Distance Provider for Distance Based SSA section, and set Provider to "Offline Calculation".
- When complete, tap Save Config.
Multi-Source Inventory developed by Magento 2 Community
- Technical Vision. Catalog Inventory
- Installation Guide
- List of Inventory APIs and their legacy analogs
- MSI Roadmap
- Known Issues in Order Lifecycle
- MSI User Guide
- 2.3 LIVE User Guide
- MSI Release Notes and Installation
- Overview
- Get Started with MSI
- MSI features and processes
- Global and Product Settings
- Configure Source Selection Algorithm
- Create Sources
- Create Stock
- Assign Inventory and Product Notifications
- Configure MSI backorders
- MSI Import and Export Product Data
- Mass Action Tool
- Shipment and Order Management
- CLI reference
- Reports and MSI
- MSI FAQs
- DevDocs Documentation
- Manage Inventory Management Modules (install/upgrade info)
- Inventory Management
- Reservations
- Inventory CLI reference
- Inventory API reference
- Inventory In-Store Pickup API reference
- Order Processing with Inventory Management
- Managing sources
- Managing stocks
- Link and unlink stocks and sources
- Manage source items
- Perform bulk actions
- Manage Low-Quantity Notifications
- Check salable quantities
- Manage source selection algorithms
- User Stories
- Support of Store Pickup for MSI
- Product list assignment per Source
- Source assignment per Product
- Stocks to Sales Channel Mapping
- Adapt Product Import/Export to support multi Sourcing
- Introduce SourceCode attribute for Source and SourceItem entities
- Assign Source Selector for Processing of Returns Credit Memo
- User Scenarios:
- Technical Designs:
- Module Structure in MSI
- When should an interface go into the Model directory and when should it go in the Api directory?
- Source and Stock Item configuration Design and DB structure
- Stock and Source Configuration design
- Open Technical Questions
- Inconsistent saving of Stock Data
- Source API
- Source WebAPI
- Sources to Sales Channels mapping
- Service Contracts MSI
- Salable Quantity Calculation and Mechanism of Reservations
- StockItem indexation
- Web API and How To cover them with Functional Testing
- Source Selection Algorithms
- Validation of Domain Entities
- PHP 7 Syntax usage for Magento contribution
- The first step towards pre generated IDs. And how this will improve your Integration tests
- The Concept of Default Source and Domain Driven Design
- Extension Point of Product Import/Export
- Source Selection Algorithm
- SourceItem Entity Extension
- Design Document for changing SerializerInterface
- Stock Management for Order Cancelation
- Admin UI
- MFTF Extension Tests
- Weekly MSI Demos
- Tutorials