CartOperationService is responsible for making sure the cart and its items are correctly priced.
It achieves this by repricing on updates to the cart (adding an item, removing an item, adding an offer code, etc.), by setting reasonable and configurable time limits on the time-to-live for stored prices, and also offers an endpoint for repricing at any time.
An important note is that price data can live both from within the Catalog service as well as from a Pricing service.
This means that if prices are setup within the Catalog service as well as the Pricing service, when Cart Operation service consults the Pricing service to determine what the best overall prices are, it could be from either location.
If prices are only setup within the Catalog service, the Pricing service will determine the best price from the catalog data.
Ultimately, whatever prices are returned from the Pricing service are saved to the cart items and used by Cart Operation service within
DefaultCartPricingService to determine the totals for the cart.
The following components are the primary ones responsible for calculating and updating pricing for the cart and its items. These are invoked through interactions with the CartOperationService component.
The high-level pricing workflow is managed in the CartPricingService and described on its documentation page. Additionally, this page contains a breakdown of how the cart totals are calculated.
Describes how fulfillment factors into the pricing calculations and the integrations with fulfillment providers.
The service responsible for determining and applying tax on the cart’s taxable pricing fields.
Additional key components of the pricing workflow include the usage and application of offers to the cart, and stale pricing time limits that keeps the cart on the latest prices.