# Get menu tree item hierarchy

`GET /api/v1/Tenants/{tenantId}/Outlets/{outletId}/MenuTrees/{menuTreeId}/Hierarchy`

Core API · MenuTrees · base URL `https://core-api.ancon.io` · auth: `Access-Token` header · docs: https://ancon.dev/api/core/menu-trees/get-menu-tree-item-hierarchy

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tenantId` | string (uuid) | yes |  |
| `outletId` | string (uuid) | yes |  |
| `menuTreeId` | string (uuid) | yes |  |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `SystemVisibility` | integer (int32) | no | Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`. |
| `OrderFormats` | integer (int32) | no | Used to filter the menu on what order format the customer chooses. If no filter is wanted use None, can be useful if all products should be visible but disabled if they are not the correct order format. Allowed values: `0`, `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `159`, `191`. |
| `PurchaseOrderFormat` | integer (int32) | no | Used to give back correct prices in the response, some products have advanced pricing that can be different per order format. Allowed values: `0`, `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `159`, `191`. |
| `OrderTime` | string (date-time) | no |  |
| `DayOfWeek` | integer (int32) | no | Allowed values: `0`, `1`, `2`, `4`, `8`, `16`, `31`, `32`, `64`, `96`, `127`. |
| `GuestGroupId` | string (uuid) | no |  |

## Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `correlationId` | string | no | Correlation Id for the request |

## Responses

| Status | Description |
| --- | --- |
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |

### 200 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | no |  |
| `name` | string or null | no |  |
| `isMandatory` | boolean | no |  |
| `menuTreeItems` | array<object \| object> or null | no |  |

#### Example

```json
{
  "id": "80f3733f-b43e-4035-8832-b85f84b7c176",
  "name": "Menu",
  "isMandatory": true,
  "menuTreeItems": [
    {
      "name": "Favorites",
      "items": [
        {
          "productId": "47164474-7337-409a-9296-27426ed62838",
          "productName": "Lunch",
          "imageId": null,
          "productDescription": "Todays lunch",
          "mainVariantPrice": {
            "price": {
              "amount": 89,
              "currency": "SEK"
            },
            "pricePresetId": null,
            "pricePresetName": null,
            "showPricePresetLabel": false
          },
          "orderFormat": 3,
          "productStockCounts": [],
          "productTags": null,
          "productGroupTags": null,
          "id": "f3420396-f4d4-493e-af42-107cc79f6ac8",
          "menuTreeItemType": 1,
          "menuTreeBranchId": "4875e8dc-0213-4819-a5da-48b596a22a96",
          "backgroundColor": null,
          "sortOrder": 1
        },
        {
          "productId": "4e42e7a6-f025-4c23-97d8-b5ae89d5b5b0",
          "productName": "Drink",
          "imageId": null,
          "productDescription": "Todays drink",
          "mainVariantPrice": {
            "price": {
              "amount": 25,
              "currency": "SEK"
            },
            "pricePresetId": null,
            "pricePresetName": null,
            "showPricePresetLabel": false
          },
          "orderFormat": 3,
          "productStockCounts": [
            {
              "stockProductId": "efb7ece3-d727-4bcf-a302-aab37c7a11cd",
              "count": 64,
              "reorderCount": 10,
              "variantId": "2d6478ca-7254-4733-bd6f-9abe65cc2cfe"
            }
          ],
          "productTags": null,
          "productGroupTags": null,
          "id": "7ccd03b6-2559-484d-8d1b-20e2aad8e83c",
          "menuTreeItemType": 1,
          "menuTreeBranchId": "4875e8dc-0213-4819-a5da-48b596a22a96",
          "backgroundColor": null,
          "sortOrder": 2
        }
      ],
      "contentType": 2,
      "id": "4875e8dc-0213-4819-a5da-48b596a22a96",
      "menuTreeItemType": 2,
      "menuTreeBranchId": null,
      "backgroundColor": "#0cff00",
      "sortOrder": 1
    },
    {
      "name": "Food",
      "items": [
        {
          "name": "Hamburgers",
          "items": [
            {
              "productId": "e42ee551-9aab-44a3-8175-89f5eea7cc72",
              "productName": "Bacon burger",
              "imageId": null,
              "productDescription": null,
              "mainVariantPrice": {
                "price": {
                  "amount": 149,
                  "currency": "SEK"
                },
                "pricePresetId": "885d70e9-99b6-4227-8585-6c5ff33db89f",
                "pricePresetName": "Lunch prices",
                "showPricePresetLabel": true
              },
              "orderFormat": 11,
              "productStockCounts": [],
              "productTags": null,
              "productGroupTags": null,
              "id": "c1cc6d3a-d05b-48df-b828-19f00f88209c",
              "menuTreeItemType": 1,
              "menuTreeBranchId": "0ee6ae52-c830-49e4-a947-e68552b38b46",
              "backgroundColor": null,
              "sortOrder": 2
            }
          ],
          "contentType": 2,
          "id": "0ee6ae52-c830-49e4-a947-e68552b38b46",
          "menuTreeItemType": 2,
          "menuTreeBranchId": "030e144f-a36f-4da2-835b-c2af1119917c",
          "backgroundColor": "#4dbf67",
          "sortOrder": 1
        },
        {
          "name": "Beers",
          "items": [
            {
              "productId": "6a406b57-a7ee-4923-aae9-163ca091b459",
              "productName": "Carlsberg 50cl",
              "imageId": null,
              "productDescription": null,
              "mainVariantPrice": {
                "price": {
                  "amount": 59,
                  "currency": "SEK"
                },
                "pricePresetId": "885d70e9-99b6-4227-8585-6c5ff33db89f",
                "pricePresetName": "Lunch prices",
                "showPricePresetLabel": true
              },
              "orderFormat": 1,
              "productStockCounts": [
                {
                  "stockProductId": "36c5809f-282b-4823-bc4e-afd64429c7b2",
                  "count": 102,
                  "reorderCount": 15,
                  "variantId": "e5449b1b-83b3-401a-b3ff-08c1cb446193"
                }
              ],
              "productTags": null,
              "productGroupTags": null,
              "id": "811939d1-3459-434e-b00f-8ce45d458588",
              "menuTreeItemType": 1,
              "menuTreeBranchId": "7bf7ec5b-70d3-45dd-93c1-5282d9b72364",
              "backgroundColor": null,
              "sortOrder": 2
            }
          ],
          "contentType": 2,
          "id": "7bf7ec5b-70d3-45dd-93c1-5282d9b72364",
          "menuTreeItemType": 2,
          "menuTreeBranchId": "030e144f-a36f-4da2-835b-c2af1119917c",
          "backgroundColor": "#a81383",
          "sortOrder": 1
        }
      ],
      "contentType": 1,
      "id": "030e144f-a36f-4da2-835b-c2af1119917c",
      "menuTreeItemType": 2,
      "menuTreeBranchId": null,
      "backgroundColor": "#ff0000",
      "sortOrder": 1
    }
  ]
}
```

### 400 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |
| `errorCode` | string (uuid) | no |  |
| `additionalData` | any or null | no |  |

#### Delivery request is not valid

```json
{
  "message": "Delivery information is not valid!",
  "errorCode": "41fcedd1-dfef-4d0d-a5b3-2e28da7dfc9a",
  "additionalData": null
}
```

### 401 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |

#### Example (from schema)

```json
{
  "message": "string"
}
```

### 404 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |
| `errorCode` | string (uuid) | no |  |

#### Example (from schema)

```json
{
  "message": "string",
  "errorCode": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

## Example request

```bash
curl -X GET "https://core-api.ancon.io/api/v1/Tenants/{tenantId}/Outlets/{outletId}/MenuTrees/{menuTreeId}/Hierarchy" \
  -H "Access-Token: $ANCON_TOKEN"
```
