How to handle Modifer Groups
Modifier groups let customers configure a product, for example choosing how a steak is cooked or adding extra toppings to a pizza. This guide explains how they're structured in menus published to your Menu Update webhook, and the rules your ordering interface should apply.
Modifier Groups
A product with sections for additional choices (modifier groups) will be sent in three collections, linked by _id:
| Collection | Holds | Its subProducts lists |
|---|---|---|
products | The item the customer orders | Its modifier groups |
modifierGroups | A choice shown to the customer, with its selection rules | The options in that choice |
modifiers | Each option the customer can pick | Nested modifier groups, if any |
Example: Build your own pizza
This pizza costs 10.00 and has two modifier groups: a required first topping included in the price, and optional extra toppings at 1.00 each. Each box shows the last characters of the item's _id.
%%{init: { "theme": "base", "themeVariables": { "fontSize": "13px", "background": "transparent", "lineColor": "#64748b", "edgeLabelBackground": "transparent", "actorBkg": "#038851", "actorTextColor": "#ffffff", "actorBorder": "#026139", "actorLineColor": "#94a3b8", "signalColor": "#64748b", "signalTextColor": "#059669", "noteBkgColor": "#e6f4ee", "noteTextColor": "#02502f", "noteBorderColor": "#038851", "activationBkgColor": "#c6ebdc", "activationBorderColor": "#026139", "sequenceNumberColor": "#ffffff" }, "flowchart": { "nodeSpacing": 25, "rankSpacing": 35, "padding": 8, "useMaxWidth": true }, "sequence": { "useMaxWidth": true, "actorMargin": 70, "width": 150, "height": 60, "boxMargin": 12, "noteMargin": 14, "messageMargin": 50, "diagramMarginX": 20, "diagramMarginY": 20, "actorFontSize": 18, "actorFontWeight": 700, "noteFontSize": 15, "noteFontFamily": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", "messageFontSize": 16, "messageFontWeight": 700, "noteAlign": "left", "mirrorActors": false } }}%%
flowchart TD
Product["<b>Build your own pizza</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d001</span>"]
MG1["<b>Choose your first topping</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d002</span>"]
MG2["<b>Add extra toppings</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d003</span>"]
M1@{ shape: st-rect, label: "<b>Pepperoni</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d004</span>" }
M2@{ shape: st-rect, label: "<b>Chicken</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d005</span>" }
M3@{ shape: st-rect, label: "<b>Bacon</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d006</span>" }
M4@{ shape: st-rect, label: "<b>Mushroom</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>…d007</span>" }
Product --> MG1
Product --> MG2
MG1 --> M1
MG1 --> M2
MG2 --> M3
MG2 --> M4
classDef product fill:#fdf1dc,stroke:#8a7a4f,color:#3a2f1a,stroke-width:2px;
classDef modgroup fill:#038851,stroke:#026139,color:#ffffff,stroke-width:2px;
classDef modifier fill:#EBFBF1,stroke:#8fc9a8,color:#02502f,stroke-width:2px;
class Product product;
class MG1,MG2 modgroup;
class M1,M2,M3,M4 modifier;
To build the pizza from the payload:
- Read the product. Its
subProductslists the_idof each modifier group, in the order to show them:…d002, then…d003. - Look up each modifier group in
modifierGroups. Show itsnameto the customer, apply its selection rules (min,max,multiMax), and read itssubProductsfor the_idof each option. - Look up each option in
modifiers. Show itsnameandprice, and use itspluwhen the customer selects it.
Products with Modifier Groups
"products": {
"6650c1a2e4b0f1a2b3c4d001": {
"_id": "6650c1a2e4b0f1a2b3c4d001",
"name": "Build your own pizza",
"productType": 1,
"plu": "PIZ-BYO",
"price": 1000,
"subProducts": [
"6650c1a2e4b0f1a2b3c4d002",
"6650c1a2e4b0f1a2b3c4d003"
]
}
}"modifierGroups": {
"6650c1a2e4b0f1a2b3c4d002": {
"_id": "6650c1a2e4b0f1a2b3c4d002",
"name": "Choose your first topping",
"productType": 3,
"plu": "GRP-FIRST",
"min": 1,
"max": 1,
"multiMax": 1,
"subProducts": [
"6650c1a2e4b0f1a2b3c4d004",
"6650c1a2e4b0f1a2b3c4d005"
]
},
"6650c1a2e4b0f1a2b3c4d003": {
"_id": "6650c1a2e4b0f1a2b3c4d003",
"name": "Add extra toppings",
"productType": 3,
"plu": "GRP-EXTRA",
"min": 0,
"max": 5,
"multiMax": 2,
"subProducts": [
"6650c1a2e4b0f1a2b3c4d006",
"6650c1a2e4b0f1a2b3c4d007"
]
}
}"modifiers": {
"6650c1a2e4b0f1a2b3c4d004": {
"_id": "6650c1a2e4b0f1a2b3c4d004",
"name": "Pepperoni",
"productType": 2,
"plu": "TOP-PEPP",
"price": 0,
"subProducts": []
},
"6650c1a2e4b0f1a2b3c4d005": {
"_id": "6650c1a2e4b0f1a2b3c4d005",
"name": "Chicken",
"productType": 2,
"plu": "TOP-CHKN",
"price": 0,
"subProducts": []
},
"6650c1a2e4b0f1a2b3c4d006": {
"_id": "6650c1a2e4b0f1a2b3c4d006",
"name": "Bacon",
"productType": 2,
"plu": "TOP-BACN",
"price": 100,
"subProducts": []
},
"6650c1a2e4b0f1a2b3c4d007": {
"_id": "6650c1a2e4b0f1a2b3c4d007",
"name": "Mushroom",
"productType": 2,
"plu": "TOP-MUSH",
"price": 100,
"subProducts": []
}
}Products as options
A modifier group can also offer a regular product, such as a side in a meal. The option keeps "productType": 1, but is sent in modifiers like any other option and is looked up the same way.
%%{init: { "theme": "base", "themeVariables": { "fontSize": "13px", "background": "transparent", "lineColor": "#64748b", "edgeLabelBackground": "transparent", "actorBkg": "#038851", "actorTextColor": "#ffffff", "actorBorder": "#026139", "actorLineColor": "#94a3b8", "signalColor": "#64748b", "signalTextColor": "#059669", "noteBkgColor": "#e6f4ee", "noteTextColor": "#02502f", "noteBorderColor": "#038851", "activationBkgColor": "#c6ebdc", "activationBorderColor": "#026139", "sequenceNumberColor": "#ffffff" }, "flowchart": { "nodeSpacing": 25, "rankSpacing": 35, "padding": 8, "useMaxWidth": true }, "sequence": { "useMaxWidth": true, "actorMargin": 70, "width": 150, "height": 60, "boxMargin": 12, "noteMargin": 14, "messageMargin": 50, "diagramMarginX": 20, "diagramMarginY": 20, "actorFontSize": 18, "actorFontWeight": 700, "noteFontSize": 15, "noteFontFamily": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", "messageFontSize": 16, "messageFontWeight": 700, "noteAlign": "left", "mirrorActors": false } }}%%
flowchart TD
Product["<b>Delicious Steak Frites</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>#quot;productType#quot;: 1</span>"]
MG1["<b>Choose a side</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>#quot;productType#quot;: 3</span>"]
P1@{ shape: st-rect, label: "<b>Side Salad</b><br/><span style='font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'>#quot;productType#quot;: 1</span>" }
Product --> MG1
MG1 --> P1
classDef product fill:#fdf1dc,stroke:#8a7a4f,color:#3a2f1a,stroke-width:2px;
classDef modgroup fill:#038851,stroke:#026139,color:#ffffff,stroke-width:2px;
classDef modifier fill:#EBFBF1,stroke:#8fc9a8,color:#02502f,stroke-width:2px;
class Product,P1 product;
class MG1 modgroup;
Products offered in a Modifier Group
"products": {
"6650c1a2e4b0f1a2b3c4d010": {
"_id": "6650c1a2e4b0f1a2b3c4d010",
"name": "Delicious Steak Frites",
"productType": 1,
"plu": "STK-01",
"price": 1500,
"subProducts": [
"6650c1a2e4b0f1a2b3c4d011"
]
}
}"modifierGroups": {
"6650c1a2e4b0f1a2b3c4d011": {
"_id": "6650c1a2e4b0f1a2b3c4d011",
"name": "Choose a side",
"productType": 3,
"plu": "MOD-02",
"min": 0,
"max": 1,
"multiMax": 1,
"subProducts": [
"6650c1a2e4b0f1a2b3c4d012"
]
}
}"modifiers": {
"6650c1a2e4b0f1a2b3c4d012": {
"_id": "6650c1a2e4b0f1a2b3c4d012",
"name": "Side Salad",
"productType": 1,
"plu": "SIDE-01",
"price": 250,
"subProducts": []
}
}Modifier group rules
Each modifier group limits what the customer can select. Your ordering interface should enforce these limits before an order is placed. Select an example, or change any value, to see how the rules combine.
Minimum number of selections in total. 0 makes the group optional.
Required. At least 1 selection in total.
Maximum number of selections in total.
Single choice. Only 1 selection in total.
Minimum quantity of each option that is selected.
Maximum quantity of any one option.
Each option can be selected once.
Minimum number of different options that must be selected.
Maximum number of different options that can be selected.
min0 selected, at least 1 requiredmax0 selected, up to 1 allowedmultiMaxNo option has a quantity above 1{
"name": "Cooking instructions",
"productType": 3,
"min": 1,
"max": 1,
"multiMax": 1
}Updated 1 day ago
See related guides
For the order of items within categories, see guide below;
