Nested modifier items

<p style={{ textAlign: "justify" }}>In the preceding sections of this Open API Specification document the Order API component and the Menu API component are described. Within the Order API Attributes chart you will find a second-level deep “modifiers” array (i.e. <span style={{ fontWeight: "bold" }}>Order -> Items array -> Item object(s) -> Modifiers array -> Modifier object(s) -> Modifiers array -> Modifier object(s) (blank)</span>) annotated with the text: “we allow for nested modifiers, but may require additional work with you to get this working”. See screenshot of the same here:</p>

![605](https://files.readme.io/3af8be2-Screenshot_2022-09-02_at_10.32.05_PM.png "Screenshot 2022-09-02 at 10.32.05 PM.png")

<p style={{ textAlign: "justify" }}>Typically – that second-level deep Modifiers array is going to be empty – or omitted – unless we make the deliberate decision to enable nested Modifiers. This section is intended to provide further clarification on how nested modifiers function when they are enabled for ordering platforms.</p>

**Order API example:**

<p style={{ textAlign: "justify" }}>The Order API Attributes chart from the preceding section already illustrates that non-standard second-level deep nested Modifier situation:</p>

<p style={{ textAlign: "justify" }}><span style={{ fontWeight: "bold" }}>Order -> Items array -> Item object(s) -> Modifiers array -> Modifier object(s) -> Modifiers array -> Modifier object(s)</span></p>

<p style={{ textAlign: "justify" }}>Of course, you’ll need to imagine that the blank spot in the chart for that second-level deep Modifier object is actually populated with an identical set of information as the first-level deep Modifier object. For Order API - if we’ve enabled nested Modifiers for a location – and if a given Item has nested Modifiers, we just repeat those last 2 elements, as many times as needed: <span style={{ fontWeight: "bold" }}>Modifiers array -> Modifier object(s)</span>. Typically, the final Modifier object in the chain will be sent with an empty Modifiers array – but it’s also permissible to just omit it.</p>

<p style={{ textAlign: "justify" }}>In <a href="https://gist.github.com/ray-checkmate/c909d9448b23c2dd15dd351c1c1ab163">this gist</a> you will find an example Order API order packet submitted to 1 of our Lab locations that is already enabled for nested Modifiers. The example of nesting Modifiers in that gist can be described thusly: an “All-American Cheeseburger” Menu Item has an “American” cheese Modifier object, also a "Regular French Fries" Modifier object. The "Regular French Fries" Modifier object has 2 nested Modifier objects: “Bacon” and “Chili”.</p>

**Menu API example:**

<p style={{ textAlign: "justify" }}>The Menu API attributes chart from the preceding section illustrates the hierarchy of Menu API response object elements thusly:</p>

<p style={{ textAlign: "justify" }}><span style={{ fontWeight: "bold" }}>Menus array -> Menu object(s) -> Sections array -> Section object(s) -> Items array -> Item object(s) -> Modifier Groups array -> Modifier Group object(s) -> Modifiers array -> Modifier object(s)</span></p>

<p style={{ textAlign: "justify" }}>If we’ve enabled nested Modifiers for a location – and if a given Item has nested Modifiers – we just repeat those last 4 elements, as many times as needed: <span style={{ fontWeight: "bold" }}>-> Modifier Groups array -> Modifier Group object(s) -> Modifiers array -> Modifier object(s)</span></p>

<p style={{ textAlign: "justify" }}>So, a nested Modifier hierarchy with 1 non-standard additional level of nesting is illustrated thusly:</p>

<p style={{ textAlign: "justify" }}><span style={{ fontWeight: "bold" }}>Menus array -> Menu object(s) -> Sections array -> Section object(s) -> Items array -> Item object(s) -> Modifier Groups array -> Modifier Group object(s) -> Modifiers array -> Modifier object(s) -> Modifier Groups array -> Modifier Group object(s) -> Modifiers array -> Modifier object(s)</span></p>

<p style={{ textAlign: "justify" }}>In <a href="https://gist.github.com/ray-checkmate/10a9f56d9610612ce8874c1ebb6e5b5e">this gist</a> you will find an example Item object (sans some superfluous Modifier Groups that we excised) from a Menu API response for 1 of our Lab locations that is already enabled for nested Modifiers. The first example of nesting Modifiers in that gist can be described thusly: a “Traditional Wings” Menu Item has a "Pick One" Modifier Group, which has a "6 Traditional Wings" Modifier object, which has a "Signature Sauce" Modifier Group, which has a "Lemon Pepper (Dry Seasoning)" Modifier object.</p>