Skip to navigation

Change or publish a menu

Partner key + restaurant key. The only call that puts a menu in service. { "isActive": true, "isDefault": true } makes it the main menu, and the previous default menu stops being the default in the same transaction, but only when the menu is or becomes active and has no date period. { "isActive": false } takes it out of service. Omitted fields are unchanged. priority (0–100) decides which menu is shown when several have a schedule window at the same time: the highest wins, and with equal priority all are shown. Reordering the menus in the restaurant dashboard rewrites it (top is highest).

A menu with a date period (startsOn/endsOn) is published in one of three ways:

  1. Next to the main menu in the period: a date period and isDefault: true. The main menu stays the default (defaultKept: true) and both are shown.
  2. Instead of the main menu in the period: a date period without isDefault, a priority higher than the main menu’s, and a schedule with all seven days 00:00–23:59 (PUT …/schedules). Both are needed: without the schedule the menu is never shown, and when the main menu has a schedule of its own, equal priority shows both and a lower one shows only the main menu.
  3. A new main menu: isDefault: true without a date period. The previous main menu stops being the default.

A menu with a date period but without isDefault and without a schedule is never shown while another menu is the default.

warnings says when no menu is visible afterwards, or when another menu becomes visible. name is cleaned like category names (textCleaned in the response). Menus have no updatedAt: a change that collides with a concurrent change gives 409 CHANGED. GET /api/v1/menu is CDN-cached (s-maxage=30, stale-while-revalidate=300, at most 330 seconds), so the website can show the old menu for up to six minutes. Among the active menus inside their date period: when one or more have a schedule window right now, only those are shown (the highest priority; equal priority shows all), also instead of the default menu. Otherwise the default menu is shown, also when it has a schedule of its own and is outside it. A menu with a schedule that is not the default is therefore shown only inside its windows, and the main menu must be the default to be shown the rest of the time. With no active default menu, all active menus are shown outside the windows. isLiveNow says whether the menu is shown right now. The response has notice with this when the change puts the menu in or out of service, and the CDN text for any other change to an active menu.

Authentication

AuthorizationBearer

The partner key (lbp_test_… or lbp_live_…), sent as Authorization: Bearer lbp_… and created in LettBestilt Partner under Partner key. It belongs to the whole partner, not to a restaurant, and only works against /api/v1/partner. Server to server only: a request with an Origin header is rejected with 403 FORBIDDEN, and the key must never be in a browser. A TEST key sees and creates only sandboxes; LIVE keys work once LettBestilt Partner is open. A suspended or archived partner, a revoked key and a restaurant key (lbs_…) here give 401 UNAUTHORIZED; an expired key gives 401 KEY_EXPIRED.

X-LettBestilt-Restaurant-Keystring

The restaurant’s own key (lbs_test_… or lbs_live_…) for calls about one restaurant in the partner API, sent together with the partner key. The key must have full access (scope *, otherwise 403 INSUFFICIENT_SCOPE), belong to a restaurant the partner owns and be in the same environment as the partner key. A restaurant that does not exist, belongs to another partner or does not match the key always gives the same 404 RESTAURANT_NOT_FOUND. Older keys without an environment in the prefix (lbs_<random>) are not accepted here; rotate them in LettBestilt Partner.

Path parameters

slugstringRequired

The restaurant’s slug. It must match the restaurant key in X-LettBestilt-Restaurant-Key.

menuIdstringRequired

The menu’s id.

Request

This endpoint expects an object.
namestringOptional1-100 characters

Cleaned like category names: links, email addresses, HTML, javascript: and invisible direction marks are removed (textCleaned in the response). Empty after cleaning gives 422.

isActivebooleanOptional
isDefaultbooleanOptional

true makes the other default menus non-default in the same transaction, but only when the menu is or becomes active and has no date period (startsOn and endsOn null). A menu with a date period never takes the default from the main menu (defaultKept: true in the response). A menu with a date period (startsOn/endsOn) is published in one of three ways:

  1. Next to the main menu in the period: a date period and isDefault: true. The main menu stays the default (defaultKept: true) and both are shown.
  2. Instead of the main menu in the period: a date period without isDefault, a priority higher than the main menu’s, and a schedule with all seven days 00:00–23:59 (PUT …/schedules). Both are needed: without the schedule the menu is never shown, and when the main menu has a schedule of its own, equal priority shows both and a lower one shows only the main menu.
  3. A new main menu: isDefault: true without a date period. The previous main menu stops being the default.

A menu with a date period but without isDefault and without a schedule is never shown while another menu is the default.

startsOndate or nullOptional

YYYY-MM-DD (Europe/Oslo), inclusive. null = no limit.

endsOndate or nullOptional

Cannot be before startsOn (checked against the stored menu).

priorityintegerOptional0-100

The menu’s priority (0–100). When several menus have a schedule window at the same time, the one with the highest priority is shown; with equal priority all are shown. Reordering the menus in the restaurant dashboard rewrites the priority (top = highest).

Response

The menu after the change.
dataobject

A menu in list form. Among the active menus inside their date period: when one or more have a schedule window right now, only those are shown (the highest priority; equal priority shows all), also instead of the default menu. Otherwise the default menu is shown, also when it has a schedule of its own and is outside it. A menu with a schedule that is not the default is therefore shown only inside its windows, and the main menu must be the default to be shown the rest of the time. With no active default menu, all active menus are shown outside the windows. isLiveNow says whether the menu is shown right now. Menu has no updatedAt: a change that collides with a concurrent change gives 409 CHANGED.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error