Kowal Reservation Cleaner for Magento 2
Magento Modules: Clear Guidelines
You purchase the module once, with no domain restrictions
Free installation and updates via Composer
Affiliate Program
Technical support for Magento
Clear guidelines for licensing Magento modules
Magento Module Code Security
Who this module is for
This module is a good fit if:
- inventory levels are regularly imported from ERP
- Magento is not the main inventory management system
- MSI reservations disrupt
salable quantity - fast, predictable, and automatic reservation cleanup is needed
- the store operates on multiple stocks and cleanup should include only selected ones
The module is not intended for stores that manage inventory exclusively in Magento and rely on the full real-time MSI logic.
The problem it solves
In standard Magento 2 with MSI, subsequent orders, cancellations, and shipments save data in inventory_reservation. In environments with ERP integration, these records often stop being operationally needed, but they still affect product availability and inventory diagnostics.
The most common effects include:
- understated
salable quantity - discrepancies between Magento and ERP
- a growing number of records in
inventory_reservation - more difficult inventory issue diagnostics
- additional load on availability-related calculations
Key features
- automatic execution via Magento CRON
- manual execution via CLI
full_reset,log_only, andclean_after_erp_syncmodes- lock to prevent the process from running in parallel
- optional reindexing after cleanup
- optional cache clean after completion
- technical logging to a file
- option to limit cleanup to selected stocks
How the module works
The module registers a CRON job that runs frequently, but the actual execution takes place only when the current time matches the configuration. This means there is no need to dynamically rebuild the system schedule after every settings change.
Process flow:
- Check whether the module is active.
- Check whether the environment is allowed.
- Check the schedule.
- Create the process lock.
- Count reservation records.
- Perform cleanup or logging only.
- Optional reindexing.
- Optional cache clean.
- Release the lock and write the log.
Operating modes
Full Reset
The simplest and fastest option for ERP-first stores.
When cleanup applies to all stocks, the module uses:
TRUNCATE TABLE inventory_reservationThis solution is the most efficient when handling a large number of records.
Log Only
Diagnostic mode. The module does not delete data, but only counts records and saves the result in the log.
Clean After ERP Sync
A mode designed to run immediately after importing inventory levels from ERP. Functionally, it cleans reservations just like full_reset, but it organizes the deployment model and schedule.
Cleanup only for selected stocks
The module also supports a scenario where cleanup is performed only for specified stocks.
How it works:
- if the stock list is empty, the entire reservation table is cleaned
- if specific stocks are specified, the module deletes only records for those
stock_id
In this case, a selective query is used:
DELETE FROM inventory_reservation WHERE stock_id IN (...)This approach is slower than TRUNCATE, but it allows reservations for other stocks to remain and provides greater control in more complex deployments.
Business benefits
- better inventory consistency between Magento and ERP
- fewer errors related to
salable quantity - simpler inventory diagnostics
- lower risk of unnecessary data building up in MSI
- deployment possible without disabling Magento MSI
- a predictable and fast process that can be automated
Configuration
Admin panel:
Stores -> Configuration -> Kowal -> Reservation Cleaner
Key settings:
- enable or disable the module
- select the operating mode
- execution hour and minute
- select stocks for cleanup
- enable reindexing
- reindexing type
- cache clean after the process
- logging
- lock validity time
- limit operation to selected environments
Running from CLI
Basic command:
bin/magento kowal:reservation:cleanExample usage:
bin/magento kowal:reservation:clean --mode=full_resetbin/magento kowal:reservation:clean --mode=log_onlybin/magento kowal:reservation:clean --reindex=inventory_onlybin/magento kowal:reservation:clean --dry-run=1bin/magento kowal:reservation:clean --stocks=1,2This allows you to run the module manually, for testing, or directly after the ERP import is completed.
Logging and security
The technical log is saved to:
var/log/kowal_reservation_cleaner.log
The module includes:
- process lock
- exception handling
- environment control
- time slot control
- the ability to work in
log_onlymode
Recommended deployment model
The most practical option for ERP-first stores:
full_resetmode- active logging
- schedule launched shortly after ERP import
inventory_onlyreindexing or reindexing handled separately in the integration process- empty stock field for full cleanup, or specified stocks where a selective option is required
Limitations
This module:
- does not fix MSI logic
- does not reconstruct reservation history
- does not replace a properly designed ERP integration
- is not a universal solution for all Magento stores
It is a specialized tool for deployments where ERP manages the actual inventory level.
Package and module name
- Magento module:
Kowal_ReservationCleaner - Composer package:
kowal/reservation-cleaner
CTA
Need implementation or customization of the module for ERP integration, multiple stocks, or a custom schedule? Contact us via kowal.store and describe your inventory synchronization model.















