Inventory service methods
Version:
Service providers are wrapper objects designed to make it easier to interact with Connect pipelines. The providers implement no logic other than calling Connect pipelines. All of the business logic is implemented in the pipeline processors.
The Inventory service provider contains the following methods for interacting with inventory data.
GetStockInformation method
GetStockInformation method
| Name: | GetStockInformation |
|---|---|
| Description: | Retrieves different levels of stock information from the ECS. Calls the GetStockInformation pipeline. |
| Usage: | Called from Sitecore when stock information is needed for a list of specified products. |
| Signature: | GetStockInformationResult GetStockInformation(GetStockInformationRequest request) |
| Input: | |
| ShopName – string. Mandatory The name of the shop. | |
| Products – list A list of InventoryProduct. Whether it is products or product variants is up to the implementation with the ECS. | |
| DetailsLevel – StockDetailsLevel. Mandatory The StockDetailsLevel class is used as a strongly typed request parameter for the GetStockInformation service method to indicate the level of stock details that are requested. | |
| Location – string. Optional The specific warehouse or central storage where the stock information is. The default is Central storage. | |
| Customer ID – string. Optional The ID of the customer in case the stock information is dependent on the actual customer. | |
| IncludeBundledItemsInventory – bool, Mandatory Flag is valid only for bundles and the default value is false. Use it when inventory information is to be returned for all bundle items and its variants. | |
| Output: | |
| List | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetPreOrderableInformation method
GetPreOrderableInformation method
| Name: | GetPreOrderableInformation |
|---|---|
| Description: | Retrieves the preorderable information. |
| Usage: | Called from Sitecore. |
| Signature: | Result [Name](Request request) |
| Input: | |
| ShopName – String. Mandatory The name of the shop. | |
| Products - List< InventoryProduct**>. Mandatory** The list of InventoryProduct. | |
| Visitor ID – string. Optional The ID of the visitor/contact or customer. | |
| Output: | |
| OrderableInformation – List A list of strongly typed objects each with the information for a specific product. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetBackOrderableInformation method
GetBackOrderableInformation method
| Name: | GetBackOrderableInformation method |
|---|---|
| Description: | Gets the back-orderable information. |
| Usage: | Called from Sitecore. |
| Signature: | Result [Name](Request request) |
| Input: | |
| ShopName – String. Mandatory The name of the shop. | |
| Products - List< InventoryProduct**>. Mandatory** The list of InventoryProduct. | |
| Visitor ID – string. Optional The ID of the visitor/contact or customer. | |
| Output: | |
| OrderableInformation – List A list of strongly typed objects each with the information for a specific product. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
VisitedProductStockStatus method
VisitedProductStockStatus method
| Name: | VisitedProductStockStatus |
|---|---|
| Description: | Called in the event that the customer pays a visit to a product details page. |
| Usage: | Called from Sitecore |
| Signature: | VisitedProductStockStatusResult VisitedProductStockStatus (VisitedProductStockStatusRequest request) |
| Input: | |
| **ShopName –**string. Mandatory. The name of the shop. | |
| **StockInformation -**StockInformation. Mandatory. The stock information previously retrieved by calling GetStockInformation``. | |
| Location – string. Optional The specific warehouse or central storage where the stock information is. The default is Central storage. | |
| Output: | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
ProductsAreBackInStock method
ProductsAreBackInStock method
| Name: | ProductsAreBackInStock |
|---|---|
| Description: | A method that is exposed so that it can be called remotely to signal when products are back in stock. Executes the corresponding ProductsAreBackInStock pipeline. |
| Usage: | Called from ECS. |
| Signature: | ProductsAreBackInStockResult ProductsAreBackInStock(ProductsAreBackInStockRequest request) |
| Input: | |
| Shop Name – string. Mandatory The name of the shop for which this relates. | |
| Products – list< InventoryProduct>. Mandatory A list of InventoryProduct that signals which products have updated stock information. | |
| Output: | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetBackInStockInformation method
GetBackInStockInformation method
| Name: | GetBackInStockInformation |
|---|---|
| Description: | This method is used to get the updated stock information from the ECS. The method is normally called because the ProductsAreBackInStock method has been called remotely and in that case the pipeline is implicitly called.The difference between the GetStockInformation and GetBackInStockInformation methods is that the first queries for stock information in a specified location and for a given customer, whereas the latter gets the stock information for all locations ignoring customer context. |
| Usage: | Called from Sitecore |
| Signature: | GetBackInStockInformationResult GetBackInStockInformation (GetBackInStockInformationRequest request) |
| Input: | |
| Shop Name – string. Mandatory The name of the shop for which this relates. | |
| Products – list< InventoryProduct**>. Optional** A list of InventoryProduct to get updated stock information from. If the list is empty, for example, no list is provided, it is up to the ECS to return stock information updates for the products that have been updated. | |
| Output: | |
| StockInformationUpdates – list A list of StockInformationUpdate objects that each signals the product and a list of locations for which the product is back in stock, when (availability date) and the count, where the latter two are optional values. | |
| SystemMessages**-** Collection of messages from the external system. |
Usage example:
GetStockLocations method
GetStockLocations method
| Name: | GetStockLocations |
|---|---|
| Description: | Retrieves all of the stock locations from the ECS. |
| Usage: | Called from Sitecore when a list of stock locations in the ECS is required. |
| Signature: | GetStockLocationsResult GetStockLocations(GetStockLocationsRequest request) |
| Input: | |
| ShopName – string. The name of the shop. | |
| CustomerId **–**string . Optional The ID of the customer who needs the list of stock locations. | |
| Output: | |
| List | |
| SystemMessages - Collection of messages from the external system. |
Usage example:
GetProductStockLocations method
GetProductStockLocations method
| Name: | Get Product StockLocations |
|---|---|
| Description: | Retrieves all of the stock locations from the ECS for a particular product. |
| Usage: | Called from Sitecore when a list of stock locations for a product in the ECS is required. |
| Signature: | GetProductStockLocationsResult GetProductStockLocations( GetProductStockLocationsRequest request) |
| Input: | |
| ShopName – string. The name of the shop. | |
| CustomerId – string. Optional The ID of the customer who needs the list of stock locations. | |
| ProductId – string. The ID of the product to look up. | |
| Output: | |
| List<StockInformation> StockInformation– A list of StockInformation objects for each location. | |
| SystemMessages - Collection of messages from the external system. |
Usage example:
If you have suggestions for improving this article, let us know!