POST whenever a booking changes at your venue. Gift card events are coming soon. Each request is signed, so you can check it came from NowBookIt.
Setting up
There are two ways to get a webhook:- With your API key: create one with Create a Webhook. Your key needs the
webhooks:managepermission, plusreservations:readfor booking events andgiftcards:readfor gift card events (coming soon). - From the venue: the venue’s staff add a webhook in NowBookIt and give you its signing secrets.
Webhooks must be switched on for the venue’s organisation. Until they are, every webhook endpoint returns
404. Contact NowBookIt to switch them on.Your endpoint
Your endpoint must:- use
https://on a public address. Private, loopback and link-local addresses are refused. - answer with any
2xxstatus within 10 seconds. Answer first and process afterwards: queue the event, reply200, then do the work. - be the final URL. Redirects are not followed.
Signing secrets
A secret iswhsec_ followed by 43 characters. It is shown only once, when it is created or rotated. Store it like a password and always use the whole secret, whsec_ included.
- Per venue: each venue has its own secret. Webhooks created with your API key are always this kind. When a venue’s staff set up one webhook for several venues, there is one secret per venue: pick the secret for the event’s
nbiVenueIdbefore checking the signature. - Group: a venue’s staff can instead set up one webhook for a group of venues with one secret for all of them. Check every request with that secret, whatever its
nbiVenueId.
Order and duplicates
- Events can arrive out of order, and a retried event can arrive after newer ones. Keep the latest
occurredAtyou’ve applied for eachbookingId(orgiftCardId), and ignore anything older. - An event can arrive more than once, even after you’ve answered
2xx. Skip aneventIdyou’ve already handled, and still answer2xxso it isn’t retried.
Ignoring your own changes
You receive every change, including the ones your system made through the NowBookIt API. To ignore your own, skip events whosesource.integrationId is your integration’s id.
Retries
A delivery that doesn’t get a2xx within 10 seconds is retried up to 6 more times over about 3 days: after 5 minutes, 30 minutes, 2 hours, 8 hours, 24 hours and 36 hours. Each gap varies by up to 10%. Every attempt is signed again with a fresh timestamp and keeps the same eventId. After the last attempt the event is not sent again.
Testing
Send a Test Event sends one signedwebhook.test event to your endpoint straight away and returns your endpoint’s answer. Use it to check your signature verification before real events arrive.
Endpoints
List Event Types
GET the events you can subscribe toList Webhooks
GET your webhooks at a venueCreate a Webhook
POST a webhook and get its secretGet a Webhook
GET one webhookDelete a Webhook
DELETE a webhookAdd an Endpoint
POST another URL with the same secretUpdate an Endpoint
PATCH an endpoint’s events or switch it offDelete an Endpoint
DELETE one URLRotate the Secret
POST for a new signing secretSend a Test Event
POST a signed test event now