Price Books for Developers

The Salesforce B2C Commerce API dw.catalog.ProductPriceModel scripting class enables you to retrieve product prices in the storefront. Because many prices can be defined for a given product, B2C Commerce uses a set of business rules to determine which price is relevant at a given time. In general, B2C Commerce, based on price look up rules, determines the best price (lowest price) for a requested quantity and shows it in the storefront.

These are the price lookup rules:

The above rules represent how prices are retrieved through the scripting API. Product prices are also relevant when a search is performed in the storefront. For example, B2C Commerce lets you refine searches by price. For performance reasons, B2C Commerce does not directly access prices that are stored in the database to provide this refinement capability. Instead, it uses prices that are stored in the product search index when the index is built. It's possible, therefore, for these prices to get out of synch (though they generally remain consistent).

Adequate information is encoded in the product index and B2C Commerce follows the same lookup rules regarding applicable price books, price activation dates, and multiple price tables for a given product. In some cases, you must rebuild the product index so that the prices used by B2C Commerce are consistent with the prices that appear on product detail pages.

Related Links

Price Lookup Example