Commerce-specific events are triggered when prices and inventories are updated from either the Catalog UI, Commerce Admin UI, or external APIs. The triggered events update indexed price and inventory information. The following section describe the specific events and event management for solutions with Optimizely Customized Commerce.
## Inventory events
The events are handled through the CatalogKeyEventBroadcaster class.
### Listen to events
To \_listen_to new events, register your method to the event of the CatalogKeyEventBroadcaster class:
To _listen_ to remote events, first get the event from Events engine.
Ensure that you call your AddEvent in an IInitializationModule.
### Trigger events
When inventories are saved through the default implementation, the event is automatically triggered. In a custom implementation of the interface, the event must be triggered for the system to know when there are inventory changes.
To broadcast events, use the CatalogKeyEventBroadcaster class. It has one public method for triggering inventory events:
Whenever changes are done to the inventory system, call the method to raise an event.
To trigger an event in your inventory system implementation, add the following code to your void Save(IEnumerable<InventoryRecord> records); method:
## Pricing events
The events are handled through the CatalogKeyEventBroadcaster class.
### Listen to events
To \_listen_to new events, register your method to the pricing event of the CatalogKeyEventBroadcaster class:
To \_listen_to remote events, first get the event from Events engine.
Ensure that you call your AddEvent in an IInitializationModule.
### Trigger events
When you save prices through the default implementation, the event is automatically triggered. In a custom implementation of one of these interfaces, the event must be triggered for the system to know when there are price changes.
To broadcast events, use CatalogKeyEventBroadcaster class. This class has one public method for triggering pricing events:
Whenever changes are done to the pricing system, call the method to raise an event.
To trigger an event in your pricing system implementation, add the following code to your **void **SetCatalogEntryPrices(IEnumerable<CatalogKey> catalogKeys, IEnumerable<IPriceValue> priceValues); method: