Implementing inventory lookup
You can look up inventory to determine the real-time availability of a product for sale in a store. You can also view the location where the inventory is present and also the split of inventory in different inventory status. You can also add or remove inventory from a location.
Solution
Understand APIs, services, and other components that are used to implement the inventory lookup flow.
Portlet scan
translateBarCode and
searchCatalogIndex APIs are called.- If you scan a product, the inventory details page is displayed.
- If you scan a serial number, the serial details page is displayed.
- If a matching bar code is not found, the
searchCatalogIndexAPI is called, and the product list page is displayed.
Advanced search
- Inventory statuses are obtained by calling
SIM GET API - {tenantId}/v1/inventory/inventory-statuses - Location types are obtained by calling
SIM GET API - {tenantId}/v1/stores/{storeId}/location-types - Locations are obtained by calling
SIM GET API - {tenantId}/v1/stores/{storeId}/locationsIf you select a location type, locations are filtered based on the selected location type.
When you search for products, the SIM GET API -
{tenantId}/v1/stores/{storeId}/inventory:summary?productId={productId}&inventoryStatus={inventoryStatus}&locationId={locationId}&locationType={locationType}
is called and the product list page is displayed.
If you select a location, inventory present in the selected location is displayed. If you select a location type, inventory for the selected location type is displayed.
Product list page
In the product list page, you can modify search by editing the search fields or deleting the search criteria. When you click the product description link, the inventory details page is displayed.
Inventory details page
In the inventory details page, to show inventory availability in each location, the SIM
GET API -
{tenantId}/v1/stores/{storeId}/inventory/products/{productId}/summary?group_by=locationId&unitOfMeasure={uom}
is called.
In the same custom mashup, the getCompleteItemList API is called to fetch the
product details such as description and variation. The SIM GET API -
{tenantId}/v1/stores/{storeId}/inventory/products/{productId}/summary?group_by=inventoryStatus&unitOfMeasure={uom}
is called to display the inventory status pie chart.
In the inventory details page, when you click the expand icon for a location that is present next
to the product units, the SIM GET API -
{tenantId}/v1/stores/{storeId}/inventory?productId={productId}&locationId={locationId}
is called. You can view the total number of units for a combination of product class and inventory
status that is available in the location.
The inventory details page consists of Add inventory and Remove inventory options. The add inventory action is controlled by the "Add Inventory" resource permission. Similarly, remove inventory action is controlled by the "Remove Inventory" resource permission. When you click Add inventory, the add inventory page opens. When you click Remove inventory, the remove inventory page opens.
Add or remove inventory
In the add or remove inventory page, the getCompleteItemList API is called to
fetch the product details. The inventory statuses are obtained by calling SIM GET API -
{tenantId}/v1/inventory/inventory-statuses. The getCommonCodeList API is
called to retrieve the product class. The reason codes consists of fixed values, which are SALE,
RECEIVING, COUNT, RECLASSIFICATION, RETURN.
If location scan is mandatory, the Location field is a scan field. Otherwise, it is a drop-down
list. If you scan a location, the translateBarcode API with
BarcodeType=Location is called to fetch the location details. Otherwise, locations
are obtained by calling SIM GET API - {tenantId}/v1/stores/{storeId}/locations.
For serialized products, when you scan the serial number, the translateBarcode
API is called. When you click the Done button, the SIM POST
API{tenantId}/v1/stores/{storeId}/locations/{locationId}/inventory:add is called to add
inventory. The inventory details page opens that displays the updated inventory picture.
In the remove inventory page, when you scan or select a location, the inventory in that location
is fetched by calling SIM API -
{tenantId}/v1/stores/{storeId}/inventory?productId={productId}&locationId={locationId}&uom={uom}.
When a user specifies inventory to remove and clicks the Done button, the
SIM POST API -
{tenantId}/v1/stores/{storeId}/locations/{locationId}/inventory:remove is called to add
inventory. The inventory details page opens that displays the updated inventory picture.
Serial details page
In the lookup inventory portlet, when you scan a serial, the serial details page opens. The
SIM GET API - {tenantId}/v1stores/{storeId}/inventory/serials/{serialNo} is called
to fetch all the serial attributes. The getCompleteItemList API is called to fetch
the product details. When you click the View SKU details button, the
inventory details page opens.