1. Inventory service

Inventory policies

Version:

The Commerce Engine encompasses extensible services that enable you to customize commerce functionality.

Note

Do not extend or inherit from out-of-the-box policies; instead, create your own. You can change the values in a policy by modifying the PolicySet JSON or the Environment JSON, depending on where the policy is defined and then re-running Bootstrap.

The Sitecore.Commerce.Plugin.Inventory defines the following policies.

GlobalInventoryPolicy

The GlobalInventoryPolicy defines global inventory settings, for example for stock level, and adjusting stock levels with orders. The following table lists and describes the properties and default values of the GlobalInventoryPolicy:

PropertyDefault valueDescription
CheckStockLevelfalse
Note

This property is not currently used.

SubtractStockOnOrdertrue
Note

This property is not currently used.

DefaultAllocationDateAvailableDateTimeOffset.MinValue
Note

This property is not currently used.

RetryInventoryUpdatesOnCheckouttrueWhen set to true (default), a mechanism is activated to retry inventory updates when multiple API request occur concurrently to avoid concurrency errors.
MaxRetriesForInventoryUpdatesOnCheckout5Indicates the maximum number of times to retry the inventory update request when concurrent requests are detected. The default is 3.
MaxInventorySetLength50Indicates the maximum number characters a an inventory can set name can contain, for example when a business user creates an inventory set in the Inventory dashboard.

LoggingPolicy

The LoggingPolicy policy contains the following properties:

Note

The LoggingPolicy policy is not currently used.

PropertyDefault valueDescription
LogInventoryItemFromContextfalseNot used.
LogGetDefaultInventoryItemfalseNot used.

KnownInventoryActionsPolicy

The KnownInventoryActionsPolicy policy defines the names (in string format) of inventory entity view actions used in the Inventory dashboard, in the Sitecore XC Business Tools.

Note

The properties of the KnownInventoryActionsPolicy are used by the Sitecore Business Tools UI and should not be changed.

PropertyDefault value
AddInventorySet { get; set; }AddInventorySet
EditInventorySet { get; set; }EditInventorySet
RemoveInventorySet { get; set; }RemoveInventorySet
ValidateInventorySetCanBeRemoved { get; set; }(ValidateInventorySetCanBeRemoved
AssociateSellableItemToInventorySet { get; set; }AssociateSellableItemToInventorySet
DisassociateSellableItemFromInventorySet { get; set; }DisassociateSellableItemFromInventorySet
EditSellableItemInventory { get; set; }EditSellableItemInventory
TransferInventory { get; set; }TransferInventory
AssociateCatalog { get; set; }AssociateCatalog
DisassociateCatalog { get; set; }DisassociateCatalog
PaginateInventorySellableItemList { get; set; }PaginateInventorySellableItemList
PaginateInventorySetList { get; set; }PaginateInventorySetList
PaginateInventorySetCatalogs { get; set; }PaginateInventorySetCatalogs
PaginateSellableItemInventorySets { get; set; }PaginateSellableItemInventorySets

KnownInventoryViewsPolicy

The KnownInventoryViewsPolicy policy defines the inventory views displayed in the Inventory dashboard, in the Sitecore XC Business Tools.

Note

The properties of the KnownInventoryViewsPolicy are used by the Sitecore Business Tools UI and should not be changed.

PropertyDefault value
InventoryDashboard { get; set; }InventoryDashboard
InventorySets { get; set; }InventorySets
InventorySetCatalogs { get; set; }InventorySetCatalogs
InventorySetCatalogs { get; set; }InventorySetCatalogs
InventorySetSellableItems { get; set; }SellableItemInventorySets
AssociateSellableItem { get; set; }AssociateSellableItem
EditInventory { get; set; }EditInventory
TransferInventory { get; set; } TransferInventory
Master { get; set; }Master
Details { get; set; }Details
Summary { get; set; }Summary

Back-orderability policies

The Sitecore.Commerce.Plugin.Backorderable plugin implements the configuration policies.

Note

Backorder functionality provided by the Sitecore.Commerce.Plugin.Backorderable plugin is not fully implemented in this release.

AvailabilityBackOrderedPolicy

The AvailabilityBackOrderedPolicy policy is used to temporarily store information about the back-order availability of a product during the processing of an order.

Note

The AvailabilityBackOrderedPolicy policy is not meant as a configuration policy. It stores information that comes from an InventoryInformation.BackorderableComponent. It is also used as a flag by the DelayedAvailability plugin during order processing to determine which lines of an order are on backorder.

The AvailabilityBackOrderedPolicy policy provides the following configuration properties:

PropertyDefault valueDescription
BackorderLimit0The maximum number of a sellable item a customer can purchase if it is out of stock in that inventory set.
QuantityOrdered0Allows blocks processing orders know the number of backorders already placed against a sellable item or one of its variants, to make sure that the backorder limit is not exceeded.
Note

This property is not currently used.

AvailabilityDateDateTimeOffset.UtcNowThe date when a backordered sellable item becomes available in an inventory set. The date and time are set to the current Coordinated Universal Time (UTC) date and time. The offset time is Zero.

GlobalBackorderablePolicy

The GlobalBackorderablePolicy policy provides the following configuration properties:

PropertyDefault valueDescription
 BackorderableAvailabilityExpires3Represents the number of days the result from a backorder availability check is considered valid (without re-checking). The value of this property is assigned by ItemAvailabilityComponent.AvailabilityExpires.

KnownBackorderableListsPolicy

The KnownBackorderableListsPolicy policy provides the following property:

PropertyDefault valueDescription
 BackOrdersBackOrdersSets the name of the list that contains backorders.

KnownBackorderableOrderStatusPolicy

The KnownBackorderableOrderStatusPolicy policy provides the following configuration properties:

PropertyDefault ValueDescription
BackorderableBackorderableThe status name of items that can be backordered and that are added to the list of backorders (KnownBackorderableListsPolicy).

Pre-orderability policies

The Sitecore.Commerce.Plugin.Preorderable plugin implements the configuration policies.

Note

Preorder functionality provided by the Sitecore.Commerce.Plugin.Backorderable plugin is not fully implemented in this release.

AvailabilityPreOrderedPolicy

The AvailabilityPreOrderedPolicy policy provides the following configuration properties:

PropertyDefault valueDescription
AvailabilityDateDateTimeOffset.UtcNowThe date a sellable item is available for preorder from that inventory set. The date and time are set to the current Coordinated Universal Time (UTC) date and time. The offset time is Zero.
QuantityOrdered0Allows blocks processing orders know the number of preorders already placed against a sellable item or one of its variants, to make sure that the preorder limit is not exceeded.

This property is not currently used.
PreOrderLimit0The amount of sellable items a customer can preorder from that inventory set.
CanOrderOnDateTimeOffset.UtcNow
Note

This property is not currently used.

GlobalPreorderablePolicy

The GlobalBackorderablePolicy policy provides the following configuration properties:

PropertyDefault valueDescription
 PreorderableAvailabilityExpires3Represents the number of days the result from the preorder availability check is considered valid (without re-checking).

KnownPreorderableListsPolicy

The KnownBackorderableListsPolicy policy provides the following configuration properties:

PropertyDefault valueDescription
PreOrdersPreOrdersSets the name of the list that contains preorders.

KnownPreorderableOrderStatusPolicy

The KnownPreorderableOrderStatusPolicy policy provides the following configuration properties:

PropertyDefault valueDescription
PreorderablePreorderableThe status name of items that can be preordered and that are added to the list of preorders.
If you have suggestions for improving this article, let us know!