API

NForPriceNDeal

An n-for-the-price-of-n deal.

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}/deals/n-for-price-n/{id} load OK
PUT /v1/stores/{storeId}/deals/n-for-price-n/{id} update OK

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:

n_for_price_n_deal, err := client.NForPriceNDeal(nil).Load(map[string]any{"id": "example_id", "store_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(n_for_price_n_deal)
updated, err := client.NForPriceNDeal(nil).Update(map[string]any{"id": "example_id", "store_id": "example", "availability": []any{}}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)

Lua

Construct client as shown in the Lua setup, then call the operations:

local n_for_price_n_deal, err = client:NForPriceNDeal():load({ id = "example_id", store_id = "example" })
local updated, err = client:NForPriceNDeal():update({ id = "example_id", store_id = "example", availability = {} })

PHP

Construct client as shown in the PHP setup, then call the operations:

$n_for_price_n_deal = $client->NForPriceNDeal()->load(["id" => "example_id", "store_id" => "example"]);
$updated = $client->NForPriceNDeal()->update(["id" => "example_id", "store_id" => "example", "availability" => []]);

Python

Construct client as shown in the Python setup, then call the operations:

n_for_price_n_deal = client.NForPriceNDeal().load({"id": "example_id", "store_id": "example"})
updated = client.NForPriceNDeal().update({"id": "example_id", "store_id": "example", "availability": []})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

n_for_price_n_deal = client.NForPriceNDeal.load({ "id" => "example_id", "store_id" => "example" })
updated = client.NForPriceNDeal.update({ "id" => "example_id", "store_id" => "example", "availability" => [] })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const n_for_price_n_deal = await client.NForPriceNDeal().load({ id: "example_id", store_id: "example" })
const updated = await client.NForPriceNDeal().update({ id: "example_id", store_id: "example", availability: [] })

Fields

Field Type Required Description
availability array No Availability
buy_qty integer No Buy N Item.
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
description string No Item Description
dietary_labels array No Dietary Labels
free_qty integer No Get Free N Item.only for n-for-n type
fulfillment_modes array No Fulfillment Modes
id string No Deal ID (controlled by partners)
image string No Image that should be displayed along side this item.
is_tax_included boolean No Setting to true assumes tax is included in the price.
name string No Deal Name
name_localized string No Second Language Name
number_of_servings number No Describes the Number of servings for a item
nutrition_info object Yes Nutrition Info
price integer No Menu item price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc.
schedule object Yes Schedule
selections array No Selections
sequence integer No The sequence field orders items for display or application.
show_online boolean No Enable or Disable whether this category shown on Foodhub platform.
subcategory_id string No Pass the ref id of subcategory it mapped with deals
tax_percentage integer No This will only work when tax included is false.
type string No Deals Type

load

GET /v1/stores/{storeId}/deals/n-for-price-n/{id}

Operation ID: GET/v1/stores/{storeId}/deals/n-for-price-n/{id}.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier
id path string Yes

Responses

200: OK

application/json

Property Type Required Description
data object No
data.availability array of enum: MO, TU, WE, TH, FR, SA, ... No
data.buy_qty integer No Buy N Item. only for n-for-n and n-for-price-n types
data.contains_alcohol boolean No This is to specify if the item contains alcohol content or not
data.contains_tobacco boolean No This is to specify if the item contains tobacco content or not
data.description string No Item Description
data.dietary_labels array of enum: VEGAN, VEGETARIAN, GLUTEN_FREE, NON-VEGETARIAN No
data.free_qty integer No Get Free N Item.only for n-for-n type
data.fulfillment_modes array of enum: DELIVERY, COLLECTION No
data.id string No Deal ID (controlled by partners)
data.image string No Image that should be displayed along side this item. If the field is missing - any existing image will be removed.
data.is_tax_included boolean No Setting to true assumes tax is included in the price. Otherwise you will be able to set tax_percentage.
data.name string No Deal Name
data.name_localized string No Second Language Name
data.number_of_servings number No Describes the Number of servings for a item
data.nutrition_info object No
data.nutrition_info.lower_range number Yes The lower range of the energy content.
data.nutrition_info.upper_range number Yes The upper range of the energy content.
data.price integer No Menu item price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc.
data.schedule object No
data.schedule.end_date string No The date at which the menu ceases to be available, in YYYY-MM-DD format eg 2024-12-01 leave empty always visible
data.schedule.end_time string Yes The time at which the menu ceases to be available, in 24-hour HH:MM format, for example “08:30”, “23:00”
data.schedule.start_date string No The date at which the menu becomes available, in YYYY-MM-DD format eg 2024-01-01 leave empty always visible
data.schedule.start_time string Yes The time at which the menu becomes available, in 24-hour HH:MM format, for example “08:30”, “23:00”
data.selections array of object No
data.selections[].max_permitted number No Maximum quantity allowed (inclusive). max_permitted cannot be less than min_permitted.
data.selections[].min_permitted number No Minimum quantity allowed (inclusive) -- Cannot be negative.
data.selections[].modifier_group_id string Yes Modifier Group reference ID
data.selections[].modifiers array of object Yes
data.selections[].modifiers[].max_permitted number No Maximum quantity allowed (inclusive). max_permitted cannot be less than min_permitted.
data.selections[].modifiers[].min_permitted number No Minimum quantity allowed (inclusive) -- Cannot be negative.
data.selections[].modifiers[].modifier_id string Yes Modifier reference ID
data.selections[].modifiers[].price integer No Override price for the modifier, represented in the lowest currency unit, such as pence, paise, cents, yen, etc.
data.selections[].modifiers[].selections array of any No Nested selections for the modifier groups
data.selections[].modifiers[].show_online boolean No Show the modifier online or not praticular item
data.sequence integer No The sequence field orders items for display or application. It's a numeric value indicating the preferred order, with lower values shown first.
data.show_online boolean No Enable or Disable whether this category shown on Foodhub platform.
data.subcategory_id string No Pass the ref id of subcategory it mapped with deals
data.tax_percentage integer No This will only work when tax included is false.
data.type enum: n-for-n, n-for-price-n, meals, flat, percent No Deals Type
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

update

PUT /v1/stores/{storeId}/deals/n-for-price-n/{id}

Operation ID: PUT/v1/stores/{storeId}/deals/n-for-price-n/{id}.

Authentication: oauth2 (AccessToken).

Parameters

Parameter In Type Required Description
storeId path string Yes Store Identifier
id path string Yes

Request body

application/json

Property Type Required Description
availability array of enum: MO, TU, WE, TH, FR, SA, ... No
buy_qty integer No Buy N Item. only for n-for-n and n-for-price-n types
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
description string No Item Description
dietary_labels array of enum: VEGAN, VEGETARIAN, GLUTEN_FREE, NON-VEGETARIAN No
free_qty integer No Get Free N Item.only for n-for-n type
fulfillment_modes array of enum: DELIVERY, COLLECTION No
id string Yes Deal ID (controlled by partners)
image string No Image that should be displayed along side this item. If the field is missing - any existing image will be removed.
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 Deal Name
name_localized string No Second Language Name
number_of_servings number No Describes the Number of servings for a item
nutrition_info object No
nutrition_info.lower_range number Yes The lower range of the energy content.
nutrition_info.upper_range number Yes The upper range of the energy content.
price integer No Menu item price value, represented in the lowest currency unit, such as pence, paise, cents, yen, etc.
schedule object No
schedule.end_date string No The date at which the menu ceases to be available, in YYYY-MM-DD format eg 2024-12-01 leave empty always visible
schedule.end_time string Yes The time at which the menu ceases to be available, in 24-hour HH:MM format, for example “08:30”, “23:00”
schedule.start_date string No The date at which the menu becomes available, in YYYY-MM-DD format eg 2024-01-01 leave empty always visible
schedule.start_time string Yes The time at which the menu becomes available, in 24-hour HH:MM format, for example “08:30”, “23:00”
selections array of object No
selections[].max_permitted number No Maximum quantity allowed (inclusive). max_permitted cannot be less than min_permitted.
selections[].min_permitted number No Minimum quantity allowed (inclusive) -- Cannot be negative.
selections[].modifier_group_id string Yes Modifier Group reference ID
selections[].modifiers array of object Yes
selections[].modifiers[].max_permitted number No Maximum quantity allowed (inclusive). max_permitted cannot be less than min_permitted.
selections[].modifiers[].min_permitted number No Minimum quantity allowed (inclusive) -- Cannot be negative.
selections[].modifiers[].modifier_id string Yes Modifier reference ID
selections[].modifiers[].price integer No Override price for the modifier, represented in the lowest currency unit, such as pence, paise, cents, yen, etc.
selections[].modifiers[].selections array of any No Nested selections for the modifier groups
selections[].modifiers[].show_online boolean No Show the modifier online or not praticular item
sequence integer No The sequence field orders items 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.
subcategory_id string No Pass the ref id of subcategory it mapped with deals
tax_percentage integer No This will only work when tax included is false.
type enum: n-for-n, n-for-price-n, meals, flat, percent Yes Deals Type

Responses

200: OK
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