# Modifiers

The data model for modifier is represented by [`Modifier`](/data-models.md#modifier) class.

## API methods

## Get modifiers

<mark style="color:blue;">`GET`</mark> `http://{server-address}/modifiers`

Returns all modifiers that matches query parameters. Result is of type [`QueryResult<Modifier>`](/data-models.md#queryresult).

#### Query Parameters

| Name   | Type      | Description                                                                                                              |
| ------ | --------- | ------------------------------------------------------------------------------------------------------------------------ |
| Id     | string    | Supports NData syntax.                                                                                                   |
| $skip  | int       | Pagination property. Describing number of records to skip from beginning of result collection.                           |
| $take  | int       | Pagination property. Maximum count of items to be returned.                                                              |
| $sort  | string\[] | <p>Comma separated list of property names. Please see NData syntax.<br></p>                                              |
| $count | bool      | If set to `true`, response will not contain `items` collection. Use to get resource count, not the resources themselves. |
| Name   | string    | Supports NData syntax.                                                                                                   |

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization header with authorization token. |

{% tabs %}
{% tab title="200: OK Successful response" %}

```javascript
{
    "items":
    [
        {
            "id": "657b20bbde0bfde5af0f59dd",
            "name": "Steak doneness",
            "displayName": "How do you like your steak cooked?",
            "minimumSelectedOptionsCount": 1,
            "maximumSelectedOptionsCount": 1,
            "maximumSelectedOptionsTotalQuantity": 1,
            "options":
            [
                {
                    "id": "c0b15868-bc3d-4c63-bf58-8b0a47a613c9",
                    "name": "Rare",
                    "unitPrice": null,
                    "isUnitPriceIncludingVat": true,
                    "pluId": null,
                    "defaultSelectedQuantity": 0,
                    "maximumSelectedQuantity": 1
                },
                {
                    "id": "0f74604d-8eeb-4c35-8f07-91730c7a80da",
                    "name": "Medium rare",
                    "unitPrice": null,
                    "isUnitPriceIncludingVat": true,
                    "pluId": null,
                    "defaultSelectedQuantity": 1,
                    "maximumSelectedQuantity": 1
                },
                {
                    "id": "e39889b9-3f1a-4f07-9d90-97edc1f8623c",
                    "name": "Medium",
                    "unitPrice": null,
                    "isUnitPriceIncludingVat": true,
                    "pluId": null,
                    "defaultSelectedQuantity": 0,
                    "maximumSelectedQuantity": 1
                },
                {
                    "id": "fcbad5e7-5e45-415c-bc02-90a2d5c4818c",
                    "name": "Medium well",
                    "unitPrice": null,
                    "isUnitPriceIncludingVat": true,
                    "pluId": null,
                    "defaultSelectedQuantity": 0,
                    "maximumSelectedQuantity": 1
                },
                {
                    "id": "a2b6b6de-6a87-40a0-9d10-4be83314e5dd",
                    "name": "Well done",
                    "unitPrice": null,
                    "isUnitPriceIncludingVat": true,
                    "pluId": null,
                    "defaultSelectedQuantity": 0,
                    "maximumSelectedQuantity": 1
                }
            ],
            "_v": 1
        },
        {
            "id": "65847589d77a632b9674c99c",
            "name": "side dishes for meat",
            "displayName": "Add a side",
            "minimumSelectedOptionsCount": 1,
            "maximumSelectedOptionsCount": 2,
            "maximumSelectedOptionsTotalQuantity": 2,
            "options":
            [
                {
                    "id": "c0b15868-bc3d-4c63-bf58-8b0a47a613c1",
                    "name": "Mashed Potatoes",
                    "unitPrice":
                    {
                        "amount": 4.90,
                        "currencyLabel": "EUR"
                    },
                    "isUnitPriceIncludingVat": true,
                    "pluId":
                    {
                        "code": 2,
                        "stockName": "S01"
                    },
                    "defaultSelectedQuantity": 0,
                    "maximumSelectedQuantity": null
                },
                {
                    "id": "0f74604d-8eeb-4c35-8f07-91730c7a80d5",
                    "name": "Grilled Vegetables",
                    "unitPrice":
                    {
                        "amount": 4.70,
                        "currencyLabel": "EUR"
                    },
                    "isUnitPriceIncludingVat": true,
                    "pluId":
                    {
                        "code": 3,
                        "stockName": "S01"
                    },
                    "defaultSelectedQuantity": 0,
                    "maximumSelectedQuantity": null
                }
            ],
            "_v": 7
        }
    ],
    "count": 2,
    "totalCount": 2
}
```

{% endtab %}
{% endtabs %}

## Get modifier by ID

<mark style="color:blue;">`GET`</mark> `http://{server-address}/modifiers/{id}`

Result is of type [`Modifier`](/data-models.md#modifier).

#### Path Parameters

| Name                                 | Type   | Description                 |
| ------------------------------------ | ------ | --------------------------- |
| id<mark style="color:red;">\*</mark> | string | Unique modifier identifier. |

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization header with authorization token. |

{% tabs %}
{% tab title="200: OK Resource with given ID is found." %}

```javascript
{
    "id": "657b20bbde0bfde5af0f59dd",
    "name": "Steak doneness",
    "displayName": "How do you like your steak cooked?",
    "minimumSelectedOptionsCount": 1,
    "maximumSelectedOptionsCount": 1,
    "maximumSelectedOptionsTotalQuantity": 1,
    "options":
    [
        {
            "id": "c0b15868-bc3d-4c63-bf58-8b0a47a613c9",
            "name": "Rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "0f74604d-8eeb-4c35-8f07-91730c7a80da",
            "name": "Medium rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 1,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "e39889b9-3f1a-4f07-9d90-97edc1f8623c",
            "name": "Medium",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "fcbad5e7-5e45-415c-bc02-90a2d5c4818c",
            "name": "Medium well",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "a2b6b6de-6a87-40a0-9d10-4be83314e5dd",
            "name": "Well done",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        }
    ],
    "_v": 1
}
```

{% endtab %}

{% tab title="404: Not Found Resource with given ID is not found." %}

```javascript
{
    "title": "Zdroj nebol nájdený",
    "status": 404
}
```

{% endtab %}
{% endtabs %}

## Create modifier

<mark style="color:green;">`POST`</mark> `http://{server-address}/modifiers`

Creates new modifier. Result is of type [`Modifier`](/data-models.md#modifier).

**Required rights**

Authorized user must have `ModifierCreate` [right ](/user-rights.md)assigned.

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization header with authorization token. |

#### Request Body

| Name                                     | Type     | Description     |
| ---------------------------------------- | -------- | --------------- |
| (body)<mark style="color:red;">\*</mark> | Modifier | Model to create |

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    "id": "657b20bbde0bfde5af0f59dd",
    "name": "Steak doneness",
    "displayName": "How do you like your steak cooked?",
    "minimumSelectedOptionsCount": 1,
    "maximumSelectedOptionsCount": 1,
    "maximumSelectedOptionsTotalQuantity": 1,
    "options":
    [
        {
            "id": "c0b15868-bc3d-4c63-bf58-8b0a47a613c9",
            "name": "Rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "0f74604d-8eeb-4c35-8f07-91730c7a80da",
            "name": "Medium rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 1,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "e39889b9-3f1a-4f07-9d90-97edc1f8623c",
            "name": "Medium",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "fcbad5e7-5e45-415c-bc02-90a2d5c4818c",
            "name": "Medium well",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "a2b6b6de-6a87-40a0-9d10-4be83314e5dd",
            "name": "Well done",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        }
    ],
    "_v": 1
}
```

{% endtab %}
{% endtabs %}

## Create or update modifier

<mark style="color:orange;">`PUT`</mark> `http://{server-address}/modifiers/{id}`

Updates existing or creates new modifier. Result is of type [`Modifier`](/data-models.md#modifier).

**Required rights**

Authorized user must have assigned `ModifierCreate` or `ModifierUpdate` [right](/user-rights.md).

#### Path Parameters

| Name                                 | Type   | Description                 |
| ------------------------------------ | ------ | --------------------------- |
| id<mark style="color:red;">\*</mark> | string | Unique modifier identifier. |

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization header with authorization token. |

#### Request Body

| Name                                     | Type     | Description                         |
| ---------------------------------------- | -------- | ----------------------------------- |
| (body)<mark style="color:red;">\*</mark> | Modifier | Modifier model to create or update. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": "657b20bbde0bfde5af0f59dd",
    "name": "Steak doneness",
    "displayName": "How do you like your steak cooked?",
    "minimumSelectedOptionsCount": 1,
    "maximumSelectedOptionsCount": 1,
    "maximumSelectedOptionsTotalQuantity": 1,
    "options":
    [
        {
            "id": "c0b15868-bc3d-4c63-bf58-8b0a47a613c9",
            "name": "Rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "0f74604d-8eeb-4c35-8f07-91730c7a80da",
            "name": "Medium rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 1,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "e39889b9-3f1a-4f07-9d90-97edc1f8623c",
            "name": "Medium",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "fcbad5e7-5e45-415c-bc02-90a2d5c4818c",
            "name": "Medium well",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "a2b6b6de-6a87-40a0-9d10-4be83314e5dd",
            "name": "Well done",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        }
    ],
    "_v": 2
}
```

{% endtab %}
{% endtabs %}

## Delete modifier by ID

<mark style="color:red;">`DELETE`</mark> `http://{server-address}/modifiers/{id}`

**Required rights**

Authorized user must have `ModifierDelete` [right ](/user-rights.md)assigned.

#### Path Parameters

| Name                                 | Type   | Description                 |
| ------------------------------------ | ------ | --------------------------- |
| id<mark style="color:red;">\*</mark> | string | Unique modifier identifier. |

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization header with authorization token. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": "657b20bbde0bfde5af0f59dd",
    "name": "Steak doneness",
    "displayName": "How do you like your steak cooked?",
    "minimumSelectedOptionsCount": 1,
    "maximumSelectedOptionsCount": 1,
    "maximumSelectedOptionsTotalQuantity": 1,
    "options":
    [
        {
            "id": "c0b15868-bc3d-4c63-bf58-8b0a47a613c9",
            "name": "Rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "0f74604d-8eeb-4c35-8f07-91730c7a80da",
            "name": "Medium rare",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 1,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "e39889b9-3f1a-4f07-9d90-97edc1f8623c",
            "name": "Medium",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "fcbad5e7-5e45-415c-bc02-90a2d5c4818c",
            "name": "Medium well",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        },
        {
            "id": "a2b6b6de-6a87-40a0-9d10-4be83314e5dd",
            "name": "Well done",
            "unitPrice": null,
            "isUnitPriceIncludingVat": true,
            "pluId": null,
            "defaultSelectedQuantity": 0,
            "maximumSelectedQuantity": 1
        }
    ],
    "_v": 1
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "title": "Zdroj nebol nájdený",
    "status": 404
}
```

{% endtab %}
{% endtabs %}


---

# 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://developers.portos.sk/api-reference/modifiers.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.
