Skip to navigation

Create a menu from a proposal (always turned off)

Partner key + restaurant key. Creates a new menu that is turned off (isActive: false) and is not the default menu, with categories, products, variants and allergens in one transaction, from the same proposal menu-imports/{importId}/commit takes. An AI tool that has read the menu itself can send the proposal directly. Names and descriptions are cleaned like the parser’s text (links, email addresses, HTML, javascript: and invisible direction marks are removed; the count is in textCleaned). No existing menu is changed. Every product in the proposal is active and counts against the restaurant’s product limit (800 active, 2000 in all), like …/products/batch. The proposal is validated before the quota is used, so an invalid proposal does not use it up. Publish it with PATCH …/menus/{menuId} (isActive, isDefault) or give it a schedule.

Not idempotent: a retry after a lost response can create a second menu, so check GET …/menus before you try again. 10 per hour per restaurant (shared with menu import commits) and 30 changes per minute per partner. Applies to sandboxes and real restaurants. At most 60 categories per menu (the proposal’s non-empty categories; other menus do not count). A price above 0 and below 500 øre (5 kr) is saved, but gives a warning in warnings ([{ path, message }]): it looks like kroner.

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.

Request

This endpoint expects an object.
proposalobjectRequired

In the proposal a price is at most 1000000 øre (10 000 kr) and a product name at most 195 characters, as in menu import; …/products and …/products/batch take prices up to 10000000 øre (100 000 kr) and names up to 200 characters.

namestringOptional<=100 characters

The menu name. Called name here (not menuName as in menu-imports/{importId}/commit). Default: «Ny meny DD.MM.ÅÅÅÅ» (“New menu” with today’s date in Oslo time).

Response

The menu is created and turned off.
dataobject

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