Wix Store OnInventoryUpdate details

I need more information regarding the following API onInventoryItemUpdated - Velo API Reference - Wix.com

When does that event is fired?

An event that fires when an inventory item’s information is updated

Does it include the following situation:

  1. a client place an order (is it triggered at fulfillment or when the order is placed).

  2. an order is created via a script.

  3. an admin updates the stock quantity manually.

  4. a script updates the stock quantity (webhook/scheduled task).

onInventoryItemUpdated - event handler runs when product inventory tracking method is changed from tacking to not tracking (both ways) (trackInventory = true / false.)
so: 1,2,3,4 - no

Suppose you want to get updated when the stock amount changes, you need to use " onInventoryVariantUpdated ". In that case, the event handler runs when inventory information for a product variant is updated in a store ( inStock = true/false OR quantity= ### ). if a product does not have variants then it will use the default variant id “00000000-0000-0000-0000-000000000000”

In this case, it will be triggered no matter who caused it, when the stock of the product changes.
1,2,3,4 - yes

Thx you very much,

It’s clearer now.

Might be worth putting that explanation in the documentation :slight_smile: