# Nested Option Group and Option

Consider a case from the previous section where the Margherita Pizza has an option group Size with Personal and Medium and based on what option (variant) you select it gives you the option to select from another option group Toppings with options Tomato, Veg Kebab and Sweet Corn. This is a nested approach to selection. You must select from the first set of options to get the list of the next set of options to choose from. The Toppings here become the nested option group and its constituents become the nested options. In contrast, in the example from the previous section, regardless of whether you have first selected the Size of the pizza or not, the Toppings would already be displayed and available for you. In fact, you can select the toppings first and then come back to select the size!

The primary use case for this is that Pizza makers support different crust or toppings on the basis of the size of the pizza selected. A personal pizza may not be entitled to a cheese burst customisation, a medium pizza may have both cheese burst and pan options while a large pizza may have two more varieties of crust available. The example of nesting given above is called a single level nesting. The same can be extended to another option group and then another one and so on which leads to n-level nesting. While we support n-level nesting of option groups and options we strongly suggest that you develop up to 1 level of nesting as most aggregators support it to that level and not beyond it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.urbanpiper.com/downstream/menu/nested-option-group-and-option.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
