Kowal Reservation Cleaner for Magento 2
YOU CAN TRUST US
25 years of experience in e-commerce and Magento 2
Fast delivery
Efficient implementation process
Simple and transparent complaint process
Working with clients worldwide
Free module updates
Payment by bank transfer
Who is this module for
This module is a good fit if:
- stock levels are regularly imported from an ERP
- Magento is not the primary inventory system
- MSI reservations disrupt
salable quantity - you need fast, predictable, and automated reservation cleanup
- the store runs on multiple stocks and cleanup should cover only selected ones
This module is not intended for stores that manage inventory exclusively in Magento and rely on full real-time MSI logic.
The problem it solves
In standard Magento 2 with MSI, each order, cancellation, and shipment writes data to inventory_reservation. In ERP-integrated environments, these records often stop being operationally needed, but they still affect product availability and stock diagnostics.
Most common outcomes:
- reduced
salable quantity - mismatches between Magento and ERP
- growing number of records in
inventory_reservation - harder inventory issue troubleshooting
- additional load for availability-related calculations
Key features
- automatic execution via Magento CRON
- manual execution via CLI
full_reset,log_only, andclean_after_erp_syncmodes- protection against parallel process execution
- optional reindex after cleanup
- optional cache clean after completion
- technical logging to a file
- ability to limit cleanup to selected stocks
How the module works
The module registers a frequently scheduled CRON job, but actual execution happens only when the current time matches the configuration. This avoids rebuilding the system schedule dynamically after every settings change.
Process flow:
- Check whether the module is enabled.
- Check whether the environment is allowed.
- Check the schedule window.
- Acquire a process lock.
- Count reservation records.
- Run cleanup or log only.
- Optional reindex.
- Optional cache clean.
- Release 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 is the most efficient solution for large record volumes.
Log Only
Diagnostic mode. The module does not delete data, it only counts records and writes the result to the log.
Clean After ERP Sync
Designed to run right after an ERP stock import. Functionally it cleans reservations like full_reset, but it helps organize the deployment model and scheduling.
Cleanup only for selected stocks
The module also supports cleaning only the specified stocks.
Behavior:
- if the stock list is empty, the entire reservation table is cleaned
- if specific stocks are provided, the module deletes only records for those
stock_id
In that case a selective query is used:
DELETE FROM inventory_reservation WHERE stock_id IN (...)This approach is slower than TRUNCATE, but it preserves reservations for other stocks and provides more control in complex deployments.
Business benefits
- better stock consistency between Magento and ERP
- fewer issues related to
salable quantity - simpler inventory diagnostics
- lower risk of MSI accumulating unnecessary data
- can be implemented without disabling Magento MSI
- predictable, fast process that can be automated
Configuration
Admin panel:
Stores -> Configuration -> Kowal -> Reservation Cleaner
Key settings:
- enable or disable the module
- select operating mode
- run hour and minute
- select stocks to clean
- enable reindex
- reindex type
- cache clean after the process
- logging
- lock TTL
- restrict execution to selected environments
Running from CLI
Base command:
bin/magento kowal:reservation:cleanExample usage:
bin/magento kowal:reservation:clean --mode=full_reset bin/magento kowal:reservation:clean --mode=log_only bin/magento kowal:reservation:clean --reindex=inventory_only bin/magento kowal:reservation:clean --dry-run=1 bin/magento kowal:reservation:clean --stocks=1,2This allows running the module manually, for testing, or directly after an ERP import completes.
Logging and safety
The technical log is written to:
var/log/kowal_reservation_cleaner.log
The module includes:
- process locking
- exception handling
- environment validation
- time slot validation
- ability to operate in
log_onlymode
Recommended deployment model
The most practical setup for ERP-first stores:
full_resetmode- logging enabled
- schedule set shortly after the ERP import
inventory_onlyreindex or handled separately in the integration process- leave stocks empty for a full cleanup or specify stocks where a selective variant 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 every Magento store
It is a specialized tool for deployments where the ERP controls the real inventory source of truth.
Package and module name
- Magento module:
Kowal_ReservationCleaner - Composer package:
kowal/reservation-cleaner
CTA
Need implementation or tailoring for your ERP integration, multiple stocks, or a custom schedule? Contact us via kowal.store and describe your inventory synchronization model.








