Area: Optimizely B2B Commerce

Realtime Inventory API handlers

Recommended reading 


URL: /api/v1/realtimeinventory

Description: Gets the specified real time inventory parameter.

Base: HandlerBase<GetRealtimeInventoryParameter, GetRealtimeInventoryResult>


Order Handler Description
500 ValidateContext Retrieves product settings by GetProductSettingsHandler. Validates CanSeeProducts setting, if it equals "false", returns error.
600 GetDisplayableGetInventoryParameter Store GetInventoryParameter property from the parameter object to DisplayableGetInventoryParameter property on the result object. If DisplayableGetInventoryParameter property doesn't contain any product id, returns error.
700 GetInventoryResults Retrieves a inventoryServiceResults using the RealTimeInventory engine. If the inventoryServiceResults contains any Inventories, stores them in the RealTimeInventoryResults property on the result object.
800 GetAvailability

Iterates over RealTimeInventoryResults and gets a product and a productInventory from each RealTimeInventoryResult.

Iterates over each product's unit of measure, if productInventory does not have availability information for selected unit of measure, calls GetAvailability catalog pipeline for it. Updates product's availability and availability in warehouses.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Dec 11, 2020

Recommended reading