Skip to main content

Inventory management

There are many events and actions that can cause the stock quantity of a product to change. All of those that are initiated by the plugin are explained below.

Synchronization details

Whenever the stock for a product is updated by the plugin it is done in the same way, no matter which event or action triggers the update.

First the plugin searches for any orders that are in a pending state and have not been sent to DHL for processing yet. Then for each product that is updated, a call to the GET Inventory Details route is made, which returns the available quantity in the configured warehouse. The quantity that is part of any pending orders is subtracted from the warehouse quantity and the resulting amount is set as the new quantity in the store.

info

For WooCommerce the pending order statuses that are considered are wc-pending and wc-on-hold.

Stock updates triggered by the plugin

Update Inventory cronjob

The Update Inventory cronjob updates the quantity for all products that are mapped to a warehouse.

Update ASN cronjob

The Update ASN cronjob updates the inventory for each product that is part of the ASN, after it changes to status DELIVERED.

Update Returns cronjob

The Update Returns cronjob updates the inventory for each product that is part of the Return, after it changes to status DELIVERED.

info

All of the cronjobs can also be triggered manually via the buttons in the UI.