Webhooks
LettBestilt sends an HTTPS POST to your endpoint when something happens to a restaurant’s orders or reservations. Use webhooks for your own systems, such as a back office, a CRM or notifications, instead of polling.
Getting a subscription
Webhooks are set up per restaurant by LettBestilt. Tell us:
- the URL. It must be a public
https://address. - which events you want.
You then receive a signing secret, starting with whsec_. It is shown only once, so store it as a secret on your server.
Events
There is no event for a payment that fails or is abandoned. Such an order never gets ORDER_PAID.
Payload
Every event has the same envelope:
data always has orderId, orderNumber and publicToken. The rest depends on the event:
Times are ISO 8601 in UTC. For reservations, orderId is the same value as reservationId from POST /reservations. Need more than the payload? Fetch the order with GET /orders/{publicToken}.
Headers
Verify the signature
The signature is an HMAC-SHA256 of {timestamp}.{raw body}, keyed with your signing secret and hex-encoded. Verify it before you trust the payload, and compute it over the raw request body, not over JSON you have parsed and serialized again.
A complete handler, for example a Next.js route:
Answering 401 to a bad signature stops retries for that delivery, which is what you want.
Delivery and retries
- Respond with any
2xxwithin 5 seconds. Do slow work after you respond. - Redirects are not followed. Answer from the URL you registered.
5xx,408,429, redirects, timeouts and network errors count as temporary. LettBestilt tries up to 7 times in total: right away, then 1 minute, 5 minutes, 15 minutes, 1 hour, 4 hours and 12 hours after the previous attempt (about 17 hours in all). After the seventh failure the delivery is given up.- Any other
4xxis treated as permanent, and the delivery is not retried. - Deliveries can arrive more than once and out of order. Skip
X-LettBestilt-Delivery-Idvalues you have already handled, and usecreatedAtto order events.

