API and webhooks
Webhooks
An owner adds an address in Settings → Developers, and Plumslot sends it the booking events chosen for it.
Open this in PlumslotSteps
- Go to Settings → Developers.
- Add a public https address.
- Choose which events to send and how much about the client they carry.
- Copy the signing secret: it is shown only once.
- Check the signature on every request you receive.
What a message holds
Ids, times, the status and the price. Nothing about the client unless you choose it: first name, or first name, email and phone. Those two need a passkey sign-in.
Checking the signature
The Plumslot-Signature header is t=[unix seconds],v1=[signature]. Compute the HMAC-SHA256 of [t].[body] over the raw bytes of the body as they arrived, before any JSON parsing. The key is the whole secret, including whsec_. Compare in constant time, and refuse a t more than 5 minutes old, so an old request cannot be played again.
In Node: const sent = Buffer.from(v1, 'hex'); const ok = sent.length === 32 && crypto.timingSafeEqual(sent, crypto.createHmac('sha256', secret).update(t + '.').update(rawBody).digest());
When your server does not answer
Answer with any 2xx within 5 seconds. Otherwise we try again: 6 attempts in all, the first and up to 5 retries over 8 hours 36 minutes. If it keeps failing we switch the address off and email the owners. Redirects are not followed.