Adobe Commerce - Inventory
Changed on:
17 Oct 2023
Overview
The Inventory module is responsible for aggregate stock synchronization between Fluent and Adobe Commerce. The main purpose of this module is to keep Adobe Commerce Inventory up to date.
Detailed Technical Description
Synchronization process flow
Synchronization flow contains 4 steps:
- Adobe Commerce Update Stock Service requests Fluent for the aggregate inventory data for a specific date-time range.
- Fluent returns appropriate stock information.
- Adobe Commerce publishes received data to the Adobe Commerce message queue.
- Inventory message consumer fetches published messages and saves appropriate inventory/stocks.
This flow is common for all Inventory synchronization types.
Synchronization types
There are three synchronization types implemented:
- Full
- Manual
- Delta
Full Synchronization
Allows synchronizing the entire inventory, recommended being used after module installation to import all aggregate inventory information from Fluent to Adobe Commerce for the configured catalog. To fetch inventory, it uses a changed date range from 1970-01-01 to NOW + 5 mins.
Can be run from Adobe Commerce CLI with the command below:
`1bin/magento fluent:stock_full:update`
Manual Synchronization
Allows fetching Fluent inventory changes from a specific date. Can be run only from the admin interface. It uses the date range from SPECIFIED to NOW + 5mins
Delta Synchronization
A background process to keep Adobe Commerce inventory up to date is executed by the Adobe Commerce cron job process. The frequency of the cron job execution can be configured in module configuration in Adobe Commerce admin. By default, it runs every 5 minutes. It uses the date range from LAST_EXECUTION_TIME to NOW + 5 mins.
Multi-Source Inventory
The Inventory module uses Adobe Commerce’s out-of-box Multi-Source Inventory solution, see About Stocks and Sources | Adobe Commerce 2.4 User Guide for more details.
It means that the synchronization process runs individually for each website(retailer) configured in Adobe Commerce installation. Ensure stocks and sources are configured per website as per the below guideline.
- For each Retailer(Per-website) create an Inventory Source.
Format:, e.g:`SOURCE\_PREFIX + \_ + RETAILER\_ID`
`FL\_SO\_1`
- For each website create an Inventory Stock and assign the previously created Source to it.
Format:, e.g`STOCK\_PREFIX + \_ + RETAILER\_ID`
`FL\_AG\_1`
Such configuration guarantees that each website(retailer) has its appropriate stock information only.
Simplified module architecture
There is one single StockUpdate service that is used by all synchronization process entry points: cron, admin controller, and CLI. This service uses a builder to retrieve an API request (Builder pattern) and another service to push Inventory messages into the queue.