MenuModifier
A modifier for menu items, such as a topping.
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
GET |
/v1/stores/{storeId}/menu/modifier/{modifierId} |
load |
OK |
DELETE |
/v1/stores/{storeId}/menu/modifier/{modifierId} |
remove |
No Content |
PUT |
/v1/stores/{storeId}/menu/modifier/{modifierId} |
update |
No Content |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
menu_modifier, err := client.MenuModifier(nil).Load(map[string]any{"id": "example_id", "store_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(menu_modifier)
updated, err := client.MenuModifier(nil).Update(map[string]any{"id": "example_id", "store_id": "example", "contains_alcohol": true}, nil)
if err != nil {
panic(err)
}
fmt.Println(updated)
removed, err := client.MenuModifier(nil).Remove(map[string]any{"id": "example_id", "store_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local menu_modifier, err = client:MenuModifier():load({ id = "example_id", store_id = "example" })
local updated, err = client:MenuModifier():update({ id = "example_id", store_id = "example", contains_alcohol = true })
local removed, err = client:MenuModifier():remove({ id = "example_id", store_id = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$menu_modifier = $client->MenuModifier()->load(["id" => "example_id", "store_id" => "example"]);
$updated = $client->MenuModifier()->update(["id" => "example_id", "store_id" => "example", "contains_alcohol" => true]);
$client->MenuModifier()->remove(["id" => "example_id", "store_id" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
menu_modifier = client.MenuModifier().load({"id": "example_id", "store_id": "example"})
updated = client.MenuModifier().update({"id": "example_id", "store_id": "example", "contains_alcohol": True})
client.MenuModifier().remove({"id": "example_id", "store_id": "example"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
menu_modifier = client.MenuModifier.load({ "id" => "example_id", "store_id" => "example" })
updated = client.MenuModifier.update({ "id" => "example_id", "store_id" => "example", "contains_alcohol" => true })
client.MenuModifier.remove({ "id" => "example_id", "store_id" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const menu_modifier = await client.MenuModifier().load({ id: "example_id", store_id: "example" })
const updated = await client.MenuModifier().update({ id: "example_id", store_id: "example", contains_alcohol: true })
await client.MenuModifier().remove({ id: "example_id", store_id: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
contains_alcohol |
boolean |
No | This is to specify if the item contains alcohol content or not |
contains_tobacco |
boolean |
No | This is to specify if the item contains tobacco content or not |
dietary_labels |
array |
No | Dietary Labels |
id |
string |
No | Modifier ID (controlled by partners) |
image |
string |
No | Image that should be displayed along side this modifier. |
is_tax_included |
boolean |
No | Setting to true assumes tax is included in the price. |
max_permitted |
number |
No | Maximum quantity allowed (inclusive). |
min_permitted |
number |
No | Minimum quantity allowed (inclusive) -- Cannot be negative. |
name |
string |
No | Modifier Name |
name_localized |
string |
No | Second Language Name |
nutrition_info |
object |
No | Defines nutritional details for an item, and modifier. |
offer |
string |
No | Offer Type |
pre_selected |
string |
No | Enable preselected modifier |
price |
integer |
No | Item Modifier price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc. |
price_for_half |
integer |
No | Item Modifier custom price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc. |
sequence |
integer |
No | The sequence field orders addons for display or application. |
show_online |
boolean |
No | Enable or Disable whether this category shown on Foodhub platform. |
tax_percentage |
number |
No | This will only work when tax included is false. |
tax_percentage_1e4 |
integer |
No | The tax rate value expressed as an integer. |
load
GET /v1/stores/{storeId}/menu/modifier/{modifierId}
Operation ID: GET/v1/stores/{storeId}/menu/modifier/{modifierId}.
Authentication: oauth2 (AccessToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
modifierId |
path |
string |
Yes | |
storeId |
path |
string |
Yes | Store Identifier |
Responses
200: OK
application/json
| Property | Type | Required | Description |
|---|---|---|---|
data |
object and object |
No |
400: Bad Request
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error |
401: Unauthorized
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials. |
403: Forbidden
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource. |
404: Not Found
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 404 Not Found is the status code that indicates a server could not find a client-requested webpage |
429: Too Many Requests
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time |
remove
DELETE /v1/stores/{storeId}/menu/modifier/{modifierId}
Operation ID: DELETE/v1/stores/{storeId}/menu/modifier/{modifierId}.
Authentication: oauth2 (AccessToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
modifierId |
path |
string |
Yes | |
storeId |
path |
string |
Yes | Store Identifier |
Responses
204: No Content
400: Bad Request
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error |
401: Unauthorized
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials. |
403: Forbidden
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource. |
404: Not Found
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 404 Not Found is the status code that indicates a server could not find a client-requested webpage |
429: Too Many Requests
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time |
update
PUT /v1/stores/{storeId}/menu/modifier/{modifierId}
Operation ID: PUT/v1/stores/{storeId}/menu/modifier/{modifierId}.
Authentication: oauth2 (AccessToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
modifierId |
path |
string |
Yes | |
storeId |
path |
string |
Yes | Store Identifier |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
contains_alcohol |
boolean |
No | This is to specify if the item contains alcohol content or not |
contains_tobacco |
boolean |
No | This is to specify if the item contains tobacco content or not |
dietary_labels |
array of enum: VEGAN, VEGETARIAN, GLUTEN_FREE, NON-VEGETARIAN |
No | |
image |
string |
No | Image that should be displayed along side this modifier. |
is_tax_included |
boolean |
No | Setting to true assumes tax is included in the price. Otherwise you will be able to set tax_percentage. |
name |
string |
No | Modifier Name |
name_localized |
string |
No | Second Language Name |
nutrition_info |
object |
No | Defines nutritional details for an item, and modifier. Allows updates only as a complete object. |
nutrition_info.additive |
array of enum: UNSPECIFIED, COLORANT_UNSPECIFIED, COLORANT_ADVERSE_EFFECT, PRESERVATIVES_UNSPECIFIED, PRESERVATIVES_NITRITE_CURING_SALT, PRESERVATIVES_NITRATE, ... |
No | List of additive in the product. Allow multiple values |
nutrition_info.allergens |
array of enum: NO ALLERGENS, GLUTEN, CEREAL_UNSPECIFIED, CEREAL_WHEAT, CEREAL_RYE, CEREAL_BARLEY, ... |
No | List of allergens in the product. Allow multiple values |
nutrition_info.calories |
object |
No | |
nutrition_info.calories.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.calories.upper_range |
number |
Yes | The upper range of the energy content. |
nutrition_info.carbohydrates |
object |
No | |
nutrition_info.carbohydrates.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.carbohydrates.upper_range |
number |
Yes | The upper range of the energy content. |
nutrition_info.dietary_restriction |
enum: VEGETARIAN, VEGAN, GLUTEN_FREE, NON-VEGETARIAN |
No | List of dietary restriction in the product. Allow single value. |
nutrition_info.kilojoules |
object |
No | |
nutrition_info.kilojoules.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.kilojoules.upper_range |
number |
Yes | The upper range of the energy content. |
nutrition_info.protein |
object |
No | |
nutrition_info.protein.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.protein.upper_range |
number |
Yes | The upper range of the energy content. |
nutrition_info.salt |
object |
No | |
nutrition_info.salt.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.salt.upper_range |
number |
Yes | The upper range of the energy content. |
nutrition_info.saturated_fat |
object |
No | |
nutrition_info.saturated_fat.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.saturated_fat.upper_range |
number |
Yes | The upper range of the energy content. |
nutrition_info.spiciness |
enum: UNKNOWN, MILD, MEDIUM, HOT, VERY_HOT |
No | List of spiciness in the product.Allow single value. |
nutrition_info.sugar |
object |
No | |
nutrition_info.sugar.lower_range |
number |
Yes | The lower range of the energy content. |
nutrition_info.sugar.upper_range |
number |
Yes | The upper range of the energy content. |
offer |
enum: BOGOF, BOGOH |
No | Offer Type |
pre_selected |
enum: YES, NO |
No | Enable preselected modifier |
price |
integer |
No | Item Modifier price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc. |
price_for_half |
integer |
No | Item Modifier custom price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc. Only applicable for Half_N_Half modifiers |
sequence |
integer |
No | The sequence field orders addons for display or application. It's a numeric value indicating the preferred order, with lower values shown first. |
show_online |
boolean |
No | Enable or Disable whether this category shown on Foodhub platform. |
tax_percentage |
number |
No | This will only work when tax included is false. |
tax_percentage_1e4 |
integer |
No | The tax rate value expressed as an integer. An integer representing a tax value scaled by a factor of 10,000. |
Responses
204: No Content
400: Bad Request
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 400 Bad Request is the status code that indicates the server cannot or will not process the request due to something that is perceived to be a client error |
401: Unauthorized
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 401 Unauthorized is the status code to return when the client provides no credentials or invalid credentials. |
403: Forbidden
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 403 Forbidden is the status code to return when a client has valid credentials but not enough privileges to perform an action on a resource. |
404: Not Found
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 404 Not Found is the status code that indicates a server could not find a client-requested webpage |
429: Too Many Requests
application/json
| Property | Type | Required | Description |
|---|---|---|---|
error |
string |
Yes | 429 Too Many Requests is the status code that indicates the client application has surpassed its rate limit, or number of requests they can send in a given period of time |