Order webhooks
Delitero is launching soon. Join the waitlist and we will email you when it opens.
An order webhook sends each order to your own system, such as a POS bridge or a kitchen printer service, the moment it reaches a step you pick. Every request is signed with a secret only you and your system hold. If you received a request from Delitero-Webhooks and followed the link here, this page explains what it is and how to check it. Use it to feed a point-of-sale system, a kitchen printer service, a spreadsheet tool or your own software. If you do not have a developer or an integration tool that gives you a webhook address, you do not need this.
Add a webhook
- In the admin, open Settings, then Data & integrations. The Order webhooks card is for the owner.
- Choose Add webhook.
- Enter the address your system receives webhooks at. It must start with https://, and cannot contain a password or a #fragment.
- Tick the order steps to send (all of them, or some).
- Copy the signing secret. It is shown only once. If you lose it, remove the webhook and add a new one.
Each business can have up to 5 webhooks. Send test sends one test request now, and Deliveries shows the last 100 requests with their status. A test is never retried.
The events
A webhook fires when an order reaches one of these steps:
- order.paid: the payment is confirmed. This is a new order.
- order.accepted
- order.ready
- order.picked_up
- order.out_for_delivery
- order.delivered
- order.cancelled
- order.refunded: the order became Refunded (a full refund).
Each fires once per order, when the step is reached. Preparing sends nothing. A checkout that was never paid sends nothing at all, not even a cancel. A partial refund that keeps the order going sends nothing, because the order's step does not change.
The request
Every request is a POST with a JSON body and these headers:
POST /your/endpoint Content-Type: application/json User-Agent: Delitero-Webhooks/1.0 (+https://delitero.com/docs/webhooks) Delitero-Event: order.paid Delitero-Delivery: whd_… Delitero-Signature: t=1791234567890,v1=5f2b…
{
"id": "whe_…",
"type": "order.paid",
"createdAt": 1791234567890,
"restaurantId": "rst_…",
"order": { "id": "ord_…", "number": 1042, "state": "PAID", … }
}order is the full order as your admin sees it: items, money, the customer's name and contact details, the delivery address, the booked time, and the driver. It never contains card details beyond the brand and last four digits. A test request has "type": "webhook.test" and no order.
The body is fixed when the event happens, so a retry sends exactly the same bytes. Use the event's id to ignore a repeat: the same event can arrive more than once.
Check the signature
Delitero-Signature carries t, the time it was signed in milliseconds, and v1, an HMAC-SHA256 of t, a full stop, and the raw request body, keyed with your signing secret and written in hex. To check a request:
- Read the raw body as received. Do not parse and re-serialise the JSON first.
- Compute the HMAC over t.body with your secret and compare it to v1 in constant time.
- Reject the request if t is more than 5 minutes away from your clock.
import crypto from 'node:crypto'
// rawBody: the request body exactly as received, before any JSON parsing
function verifyDelitero(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')))
const t = Number(parts.t)
if (!t || Math.abs(Date.now() - t) > 5 * 60 * 1000) return false
const expected = crypto
.createHmac('sha256', secret)
.update(`${t}.${rawBody}`)
.digest('hex')
const got = Buffer.from(parts.v1 ?? '', 'hex')
return got.length === 32 && crypto.timingSafeEqual(got, Buffer.from(expected, 'hex'))
}Answer, and retries
- Answer with any 2xx status within 10 seconds. The response body is ignored.
- Redirects are not followed: a 3xx counts as a failure.
- A failed request is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, about 14 hours in all. After that it stops, and the delivery log shows it as Gave up.
- Because of retries, events for one order can arrive out of order. Use the order's state in the body rather than the arrival order.
The delivery log's statuses: Queued (not sent yet), Delivered (your system answered 2xx), Retrying (failed, with the next try time), Failed (a test that failed), and Gave up. The last response code or error is shown, never your system's response body.
Write your ticket number back
If your system creates its own ticket for an order, it can write the ticket number back to Delitero. The order then shows "POS ticket" with that number in your admin. Authenticate with whk1., the webhook's id, a full stop, and its signing secret. The webhook's id is the webhookId in the body of a test request. Send null to clear it.
curl -X PATCH https://api.delitero.com/v1/restaurants/rst_…/orders/ord_…/external \
-H 'Authorization: Bearer whk1.<webhook id>.<signing secret>' \
-H 'Content-Type: application/json' \
-d '{"externalTicketId":"4471"}'Remove a webhook
Remove on the card stops all requests to that address immediately, and deletes its delivery log. To change the address or the steps it sends, remove it and add a new one. Adding and removing webhooks is recorded in the activity log.
Related
- The public ordering API reads menus and places orders from your own software.
- For a one-off copy of your orders, use Export CSV instead.
Did not find what you needed? Search the guides, or see common problems and what to do.