Skip to navigation

Sign up for the newsletter

Adds the customer to the restaurant’s newsletter and returns the welcome coupon. Signing up again with the same email is safe: it returns the welcome coupon again and keeps the address subscribed.

The newsletter popup must be enabled in the restaurant’s dashboard and linked to an active coupon. Otherwise the response is 404 POPUP_NOT_AVAILABLE and nothing is stored. Check restaurant.newsletterPopup in GET /restaurant before you show a signup form; it also holds the popup’s texts.

Rate limits: 5 requests per 60 seconds per IP, and 200 per hour per restaurant.

Authentication

AuthorizationBearer

Either this or a trusted browser origin. The restaurant’s API key, sent as Authorization: Bearer lbs_…. Use it from your server only, never in browser code. Keys are issued per restaurant by LettBestilt.

OR
Originstring

Either this or an API key. No key is needed when the request’s Origin header is trusted for this restaurant: https://{slug}.lettbestilt.no, a verified domain of the restaurant, or a partner origin LettBestilt has bound to the restaurant. Browsers set Origin themselves; it is not something you configure. Not accepted by GET /site-gate, which requires an API key.

Query parameters

slugstringRequired
The restaurant's slug.

Request

This endpoint expects an object.
emailstringRequiredformat: "email"<=200 characters
namestringOptional<=120 characters

Response

The customer is subscribed. Show the welcome coupon.
couponCodestringOptional
The welcome code. Show it to the customer.
discountTypeenumOptional
The kind of discount the code gives.
Allowed values:
discountValueintegerOptional

PERCENT: percent. FIXED: øre.

successMessagestringOptional

The restaurant’s thank-you text. Replace {{code}} and {{discount}} before you show it.

Errors

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