Overview
Food delivery item customization is divided into three layers:Specs — Specifications
Each item may have one or multiple specification dimensions:item_id and sku_id. Just pass the corresponding spec ID when ordering.
Attrs — Attributes
Customization options not affecting price:Ingredients — Extra Ingredients
Most complex customization layer, including exclusion rules:Exclusion Rules
Each option’sexcludes array lists which option IDs are incompatible with it:
ig_{group_index}_{option_index}, stable and predictable.
Typical Scenarios
Starbucks Chain Exclusion:Default Ingredients — Defaults
For AI Agent quick ordering convenience, menu returns pre-computeddefault_ingredients:
Two layers of “required groups”
“Required” appears at two distinct layers in a menu — don’t conflate them:- Per-item required ingredient groups: within one item you must pick enough options, e.g. a drink’s required “Temperature” / “Sugar”. These live in that item’s
ingredient_options(upstreamisRequiredgroups). Missing one is rejected at order time as “ingredients not fully selected”. - Store-level required item groups: the whole order must include another item of a certain kind, e.g. a malatang shop’s “Required Soup”. These live in the top-level
required_groups[]of theget_shop_menuresponse (andcategories[].required); pick fromcandidate_item_idsand add toitems[].
The two are enforced at different times: store-level required groups are checked by the gateway at
quote_cart (can_checkout=false + blocking_reason, a soft hint) and preview_order (MISSING_REQUIRED_SELECTION, HTTP 400 hard block); per-item required ingredient groups are validated by the upstream at order time.Echoing selected specs
get_shop_menu returns the available options; quote_cart and preview_order echo back the user’s selected specs and ingredients on each item, so you can show “what was ordered”:
The echo is translated by each item’s own
sku_id / ingredient_option_ids, so multiple items (including the same item with different specs) never cross-contaminate; fields are [] when there are no specs / ingredients.
