1. Pricing service

Pricing 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 following policies can be configured through the Pricing plug-in.

  • Policy: Description
  • GlobalPricingPolicy: Provides the ability to specify standard price policies. It applies in the Commerce Shops service. The following sample shows the GlobalPricingPolicy returned on an environment policies collection. You can overwrite the policy for a particular shop by adding it to the policies collection for that shop.
  • KnownPricingActionsPolicy: Defines the names of the pricing entity view actions.
  • KnownPricingListsPolicy: Defines the names of the pricing transient and entity indexes lists.List Name              Default valuePriceBookCards            PriceBooks-{0}-PriceCards
  • KnownPricingViewsPolicy: Defines the names of the pricing entity views
  • ListPricingPolicy: The ListPricingPolicy provides the ability to specify a List Price in multiple currencies.The following sample shows the ListPricingPolicy returned on a SellableItempolicies collection or one of its variants:
{
      "@odata.type": "#Sitecore.Commerce.Plugin.Pricing.ListPricingPolicy",
      "PolicyId": "db13def722dc488f86a0673b83eb85e8",
      "Models": [],
      "RuleSet": null,
      "Prices": [
        {
          "CurrencyCode": "USD",
          "Amount": 44.75
        },
        {
          "CurrencyCode": "CAD",
          "Amount": 45.75
        }
      ]
}
  • OnSalePolicy: The OnSalePolicyprovides the ability to specify that a SellableItem is on sale.The following sample shows the OnSalePolicyreturned on a SellableItem policies collection or in the policies collection of one of its variants:
{
      "@odata.type": "#Sitecore.Commerce.Plugin.Pricing.OnSalePolicy",
      "PolicyId": "b70814f6f15b4a0aaeea74e83af63c20",
      "Models": [],
      "RuleSet": null,
      "OnSale": true,
      "ShowInCart": false,
      "CartDisplay": "text"
 }
  • PriceCardPolicy: The PriceCardPolicyprovides the ability to specify a Price Card for the SellableItem. This allows the SellableItem to share a pricing definition with multiple other SellableItems. The same logical PriceCard name can be represented in multiple Price Books, providing a flexible method for specifying pricing.The following sample shows the PriceCardPolicy returned on a SellableItem policies collection or in the policies collection of one of its variants. It indicates that a common price definition is being referenced:
{
      "@odata.type": "#Sitecore.Commerce.Plugin.Pricing.PriceCardPolicy",
      "PolicyId": "2f770e056b9149088c8f57a84d9343ed",
      "Models": [],
      "RuleSet": null,
      "PriceCardName": "HabitatPriceCard"
  }
  • PurchaseOptionMoneyPolicy: The PurchaseOptionMoneyPolicypolicy provides the ability to specify a calculated Sell Price in multiple currencies. The following sample shows the PurchaseOptionMoneyPolicyreturned on a SellableItem policies collection or in the policies collection of one of its variants. It represents what you would actually sell an item for based on the context of the call. This could be a dynamically calculated price based on environment factors, for example, the Date/Time or the quantity the customer intends to purchase based on what they have in the cart.
{
      "@odata.type": "#Sitecore.Commerce.Plugin.Pricing.PurchaseOptionMoneyPolicy",
      "PolicyId": "b70814f6f15b4a0aaeea74e83af63c20",
      "Models": [],
      "RuleSet": null,
      "SellPrice": {
        "CurrencyCode": "USD",
        "Amount": 10
      }
 }
If you have suggestions for improving this article, let us know!