- DATE:
- AUTHOR:
- The Toast - API team
chargeAsExtra value added to the PreModifier object in the menus and config APIs
The PreModifier object in both the menus and config APIs includes a new chargeAsExtra boolean value. When true, selecting this pre-modifier adds an additional portion of the modifier to the menu item and adds the price of the additional portion to the menu item according to the rules listed below.
If the modifier group that the modifier belongs to uses:
The No charge option, the Toast platform uses the modifier's override price or, if no override price exists, the item reference price as the price of the additional portion.
The Individual option where each modifier has its own price, the Toast platform uses the modifier's override price or, if no override price exists, the item reference price as the price of the additional portion.
The Group option where all modifiers in the group share a price, the Toast platform uses the the group price as the price of the additional portion.
Additionally, if the modifier group that the modifier belongs to uses:
Size pricing, the Toast platform uses the size price that matches the size of the menu item when determining the price of the additional portion.
Sequence pricing, the Toast platform treats the additional portion as the next modifier in the sequence and prices it using the sequence pricing rules that have been specified.
Size/sequence pricing, the Toast platform matches the size of the additional portion to the size of the menu item and then treats it as the next modifier in the sequence when determining the price of the additional portion.
The chargeAsExtra value is null if it has not been set.
For the config API, the chargeAsExtra value is immediately available.
For the menus API, the chargeAsExtra value becomes available in the menu JSON after a restaurant has made a menus-related change and published the new menu, which initiates regeneration of the restaurant's menus data. For more information, see Menus API returns published data only. Also, the change applies to both V2 and V3 of the menus API.
Note
For information on the differences between V2 and V3 of the menus API, see Comparing menus API V2 and V3.
For information on pre-modifiers, see this Toast Central article.