I need more information regarding the following API https://www.wix.com/velo/reference/wix-stores-backend/events/oninventoryitemupdated
When does that event is fired?
An event that fires when an inventory item's information is updated
Does it include the following situation:
a client place an order (is it triggered at fulfillment or when the order is placed).
an order is created via a script.
an admin updates the stock quantity manually.
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
https://www.wix.com/velo/reference/wix-stores-backend/events/oninventoryvariantupdated