How to add Ingredient Groups & Modifier Deltas

Introduction

An attribute can be set on a modifier group to identify it as an 'Ingredient Group' "isIngredientGroup": true, to indicate that it includes options which will be included by default. When this in place, the order payload will pass only the delta, whereby if a customer removes or adds an option from this group, an attribute "modifierAction" will specify "NO"/"ADD"

This typically applies to Pizza ordering, where kitchen teams will want to review only what differs from the standard toppings included by default in the item.

Default Selection via Scopes

To mark an item as selected by default when offered on specific items only, an attribute "overloads" allows for a defined list of "scopes" . Below, the "Mozzarella" and "Pizza Sauce" are set with a specific combination of product and modidifer group PLUs e.g. "BYOP-00-->>BYOP-TOP"meaning that the only within this combination will the "defaultQuantity":1 apply.

Ingredients without pricing only
It is only possible to define items with zero price within modifier groups with the flag "isIngredientGroup": true

{
    "products": [
        {
            "name": "Build your own Large Pizza",
            "productType": 1,
            "plu": "BYOP-00",
            "subProducts": [
                "TOP",
                "EXTRAS"
            ]
        },
        {
            "name": "Toppings",
            "plu": "TOP",
            "isIngredientGroup": true,
            "min": 0,
            "max": 3,
            "multiMax": 1,
            "productType": 3,
            "subProducts": [
                "SAUCE",
                "MOZ",
                "CH_F"
            ]
        },
        {
            "name": "Mozzarella",
            "deliveryTax": 1200,
            "plu": "MOZ",
            "price": 0,
            "productType": 2,
            "overloads": [
                {
                    "scopes": [
                        "BYOP-00-->>BYOP-TOP"
                    ],
                    "defaultQuantity": 1
                }
            ]
        },
        {
            "name": "Pizza Sauce",
            "deliveryTax": 1200,
            "plu": "SAU",
            "price": 0,
            "productType": 2,
            "overloads": [
                {
                    "scopes": [
                        "BYOP-00-->>BYOP-TOP"
                    ],
                    "defaultQuantity": 1
                }
            ]
        }
    ]
}

Modifier Delta

When a customer has removed a default topping from an order, the order payload will indicate this as in snippet below "modifierAction": "NO" similarly, if an optional item from the ingredient group is included it will show "modifierAction": "ADD"

{
  "items": [
    {
      "name": "Build your own Large Pizza",
      "subItems": [
        {
          "plu": "E-Mz-O1-",
          "name": "Mozzarella",
          "modifierAction": "NO"
        }
      ]
    }
  ]
}
{
  "items": [
    {
      "name": "Build your own Large Pizza",
      "subItems": [
        {
          "plu": "CH_F",
          "name": "Chili Flakes",
          "modifierAction": "ADD"
        }
      ]
    }
  ]
}
⚠️

Only for Default Ingredients

For any mandatory modifier groups e.g. for Pizza, the "Size" and "Crust" or other single-select groups, these should not be set as isIngredientGroup": true as these selections need to pass through on the order webhook and no delta logic needs applied.


Did this page help you?