Price selection
Learn how price selection works in Composable Commerce.
After completing this page, you should be able to:
- Describe how to create and publish Prices in Composable Commerce.
- Describe how the Price of a Line Item in a Cart is selected by Composable Commerce.
Factors influencing Prices
Several factors within your Project can influence the total Price of a Product Variant or Cart, as shown in the following diagram.
Base Prices
The base Prices of a Product Variant have the biggest impact on its final cost—it's the starting point for calculating the total Price of a Line Item.
Taxes and shipping costs
Taxes are added to the product price as a percentage of the product price. When you set up your Project, you must decide whether to include taxes in the Prices of the Product Variant. If taxes are not included, the total Price of the Line Item will be higher than its base Price as taxes will be added to it. For more information, see Taxes.
Before creating an Order, the most appropriate Price for the Line Items is selected, and tax rates and shipping costs are added—determining the Cart's total price.
Price tiers
For any Product Variant, you can specify what its Price will be if a Customer buys more than a certain quantity. Price tiers override the base Price for the Product Variant when this quantity is reached.
Product Discounts
Product Discounts apply directly to Product Variants and reduce the base Price of the Product Variants, affecting the final amount a customer pays.
Cart Discounts and Discount Codes
Cart Discounts and Discount Codes can apply to an entire Cart or specific Line Items in a Cart. They reduce the total price of a Cart based on discount criteria, such as multi-buy scenarios or shipping costs.
Price scopes
A Price isn't just the currency and amount—more parameters (scopes) exist, which affect how the Price is selected for a Product or Line Item. Price scopes ensure that Composable Commerce selects the most appropriate Price for a Product Variant or Line Item.
- Currency: Specify the currency for the Price. Both Embedded Prices and Standalone Prices require the
currency
field to define the price scope. - Customer Group: determines the Customer Group the Price is valid for.
- Channel: determines the Channel the Price is valid for.
- Country: determines the country the Price is valid for.
- Validity date: determines the validity period for the Price. Both Embedded and Standalone Prices can have validity dates optionally; prices without validity dates are always considered valid. With validity dates, you can set up Prices before they are active—knowing that the correct Price will automatically be used when the time comes.
For more information about the priority of these fields when selecting a Price for use in the Cart, see Product and Line Item Price selection.
You can see the price scopes (for Embedded Prices) by navigating to the Prices tab on the Product Variant list page in the Merchant Center.
Product and Line Item Price selection
Composable Commerce uses a fallback price selection process to select the most appropriate price for a Product Variant or Line Item.
The Product Variant price is determined by the Product Projections API and Product Projection Search endpoint, while the Line Item price is determined by the Carts API. For more information about how the price scopes map to each API, see here.
Price selection only works for Composable Commerce's internal pricing solution—Embedded or Standalone Prices. When using an external pricing solution, the external price is added directly to the Line Item, overriding any internal prices (Embedded or Standalone Price) set for the Product Variant.
Price selection process
1. Price identification: Composable Commerce uses the Product priceMode
to identify if the Product uses Embedded or Standalone Price. If the priceMode
value is not set, Composable Commerce assumes the Product to use Embedded Prices.
2. Price selection: Composable Commerce selects a price for a specified currency, prioritizing scopes in the following order (highest to lowest).
Priority | Currency | Validity dates | Customer Group | Distribution Channel | Country |
---|---|---|---|---|---|
1 (Highest) | Matching | True | Matching | Matching | Matching |
2 | Matching | Matching | Matching | Matching | |
3 | Matching | True | Matching | Matching | |
4 | Matching | Matching | Matching | ||
5 | Matching | True | Matching | Matching | |
6 | Matching | Matching | Matching | ||
7 | Matching | True | Matching | ||
8 | Matching | Matching | |||
9 | Matching | True | Matching | Matching | |
10 | Matching | Matching | Matching | ||
11 | Matching | True | Matching | ||
12 | Matching | Matching | |||
13 | Matching | True | Matching | ||
14 | Matching | Matching | |||
15 | Matching | True | |||
16 | Matching | ||||
17 (Lowest) | No Price Found |
It's important to note the following:
- During Price selection, the Customer Group has precedence over the Channel, which also has precedence over the country.
- The Price selection logic goes from finding a price for a currency that matches specifics (Customer Group, country, and Channel) to an open range.
- The Price selection logic also checks if a matching Price exists for the validity dates. If a Price is found, it is selected.
- An empty cell indicates the logic will search for a price where the corresponding scope is explicitly not defined.
- If valid Price tiers exist for a Price matching the logic, the tiered Price is used instead of the base Price.