Skip to navigation

Quickstart

Make your first calls in five minutes

This page gets you from an API key to a working menu. The ordering flow guide takes it from there to a paid order.

1

Get an API key

LettBestilt issues one API key per restaurant. It starts with lbs_ and is shown only once, so store it right away as a server-side environment variable, for example LETTBESTILT_API_KEY.

Never put the API key in browser code. Anything in a client bundle is public.

2

Fetch the restaurant

Check that the key works and see what the restaurant offers:

curl "https://www.lettbestilt.no/api/v1/restaurant?slug=pizzaroma" \
-H "Authorization: Bearer $LETTBESTILT_API_KEY"

restaurant.capabilities tells you which flows to offer:

{
"pickup": true,
"delivery": false,
"reservations": true,
"payment": { "online": true, "cash": true }
}

Build your UI from this object. If delivery is false, do not offer delivery.

3

Fetch the menu

curl "https://www.lettbestilt.no/api/v1/menu?slug=pizzaroma" \
-H "Authorization: Bearer $LETTBESTILT_API_KEY"

Prices are integers in øre, so 12900 is kr 129,00. The response also has the restaurant’s opening hours, delivery zones, coupons, promotions and allergens. It is cached for about 30 seconds and supports ETag / If-None-Match.

4

Show the preparation time

The kitchen can turn on rush mode, which adds minutes to the preparation time. Show the live number from /prep-time instead of the cached one in the menu:

curl "https://www.lettbestilt.no/api/v1/prep-time?slug=pizzaroma" \
-H "Authorization: Bearer $LETTBESTILT_API_KEY"

If you get 404 RESTAURANT_NOT_FOUND for a slug you know exists, the restaurant has not been set live in LettBestilt yet. The API only answers for live restaurants.

Next steps