Pricing Services is used to maintain prices. The service provides a full set of APIs and Broadleaf admin compatible screens for managing price data.
Price lists can be used to address many common pricing use cases including managing pricing based on date, customer, geography, and more. Price lists can manage standard, sale, and contract prices.
See articles on Price Types and Price List Features for more information.
Client applications will request pricing for products (SKUs) or carts. The following diagram and related notes explains the typical client facing pricing flow.
Clients will provide a PriceContext
as a header parameter to the priceInfo call. The
PriceContext contains locale, target currency, and other properties that are used to restrict
which price lists should be included including customer segments.
Clients will also provide a PriceInfoContext
which includes the items to be priced as a list of
PriceableTarget
objects. When using modifier rules, the PriceableTarget
can includes cost,
base price information, and other attributes used to qualify for the price modifer and as a
base value for the operator to modify.
The PriceInfoService
is used to build the PriceInfo
results. It first makes calls to
the PriceListService
and PriceListFilterService
to determines the eligible price lists. Once
eligible price lists are found, the service calculates the item prices based on the
PriceModifier
and chooses the best prices to return for each applicable price list type
(Standard, Sale, and
Contract).
The PriceListService
provides the methods to read and update price lists. In the context of the
priceInfo
endpoint, this service delegates to the PriceInfoFilterService
after calling its
modifyPriceContext
method which can be a useful place to override to introduce custom price
context logic.
A solution may have thousands of price lists. The PriceInfoFilterService
narrows the list to
process using the context information. For implementations with large numbers of price lists,
this class is a good target for optimizing the price list selection queries as most solutions can
introduce a more efficient and cacheable query that meets the specific application requirements.
See Price List Features for use cases that are handled with price lists.
See Price Types for details on the price list types (STANDARD, SALE, and CONTRACT) supported with Price Lists.
See Data Model for a diagram and description of the key entities used by the Price List Service