This guide will be removed on April 29, 2022. Please use our new, easier-to-use Toast technical documentation site. All updated content is on the new site.

Using PricingRules and PricingStrategy to Calculate Prices

There are situations where additional context is needed before a price can be determined. For example, the price of a menu item that uses time-specific pricing depends on the time the menu item is ordered. For these situations, the menus API provides two values, pricingStrategy and pricingRules, that contain the information you need to calculate the menu item or modifier option's price. These values appear for every menu item, modifier group, and modifier option in the fully resolved JSON. Their contents change depending on how a menu item or modifier option's price has been configured.

You use the pricingStrategy and pricingRules values to calculate prices for:

The pricingStrategy value tells you which pricing strategy is in effect so that you can properly interpret the contents of the pricingRules value and calculate the correct price. Because they appear in multiple locations in the menu JSON, it is important to use the correct pricingStrategy and pricingRules values when calculating prices. The following sections describe which pricingStrategy and pricingRules values to use and how to interpret them.