Planned events
The first release focuses on the six events that power the most common merchant automations:| Event | Fires when | What merchants automate with it |
|---|---|---|
appointment.created | A new booking is made | CRM sync, welcome and confirmation flows |
order.paid | Payment is captured for an order | Fulfillment, accounting entries |
appointment.canceled | A booking is canceled | Waitlist backfill, freeing resources |
appointment.rescheduled | A booking is moved to a new slot | Calendar updates, staff notifications |
appointment.completed | A booking’s end time passes | Review requests, follow-up sequences |
order.refunded | A refund is issued on an order | Accounting corrections, inventory release |
How delivery will work
A webhook is an HTTPPOST from Opencals to an endpoint you host. Each delivery:
- is sent as JSON to the URL you register,
- identifies its event type so one endpoint can handle many events,
- is signed, so you can verify the request really came from Opencals,
- expects a
2xxresponse. Non-2xx responses are treated as failures and retried with backoff, so make your handler idempotent — the same event may be delivered more than once.
Verifying signatures
Deliveries will follow the standard HMAC pattern: a signature header computed over the raw request body with your endpoint’s secret. The verification you’d write today won’t change:Verify against the raw, unparsed request body — re-serialized JSON can reorder keys and break the comparison. In Next.js route handlers, use
await request.text() before parsing.Keeping data fresh today
Until webhooks ship, two patterns keep an integration accurate:- Poll customer-scoped endpoints on your own schedule.
GET /storefront/appointmentsandGET /storefront/ordersreturn current state, so a periodic sync job covers CRM, accounting, and follow-up automations. Respect the rate limits — a sync every few minutes is well within them. - Time-based revalidation for catalog data. Products, staff, and locations change rarely — Next.js ISR (
revalidate) or a short CDN cache of a few minutes is usually enough for a headless booking site. - Always fetch availability live. Time slots change with every booking, so call the availability endpoints at request time rather than caching them. The booking flow is also self-correcting:
POST /storefront/cart/checkout/startre-validates every cart item and reports invalid ones before any payment is taken.
Related
- Build a booking page — where cached catalog data and live availability fit in the flow.
- API reference — every endpoint the planned events map to.