Skip to navigation

Preview the automatic promotion

Returns the discount the server would apply when the order is created, if the customer uses no coupon code. Use it to show a line such as “Offer: −50 kr” in the cart. The server evaluates promotions again in POST /orders, so this is for display only.

If no automatic promotion matches, the response is { "applies": false, "discount": 0 }.

For this endpoint, slug goes in the body. Rate limit: 30 requests per 60 seconds per slug and IP. Guide: Coupons and promotions.

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.

Request

This endpoint expects an object.
slugstringRequired<=64 characters
The restaurant's slug. Sent in the body for this endpoint.
subtotalintegerRequired>=0

Cart subtotal in øre.

cartlist of objectsRequired
fulfillmentenumOptional

PICKUP or DELIVERY. Send it so promotions limited to one of them are evaluated correctly.

Allowed values:
deliveryFeeintegerOptional>=0

The delivery fee in øre. Needed for free-delivery promotions.

requestedPickupAtdatetimeOptional

Optional. The pickup time the customer selected for a pre-order (same value you send as requestedPickupAt to POST /api/v1/orders). Day-of-week and time-of-day restrictions on the coupon (and its expiry) are evaluated against THIS moment, not the moment of the request — a Monday/Tuesday offer must not apply to an order placed on Tuesday for a Thursday pickup. Omit for as-soon-as-possible orders. Send the same value here and on the order, or the cart will show a discount the order rejects.

Response

The best matching automatic promotion, or applies: false and discount: 0 when none matches.

object
OR
object

Errors

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