Bookings · Integrate
Events
Versioned booking, hold, payment, and credits events for your plugin, with identifiers and times only.
The envelope
Bookings emits a plugin hook after each change. Every payload is { version: 1, eventKey, occurredAt, … } and carries identifiers, times, and states only: never names, contact details, notes, answers, or amounts. eventKey names the change, so a listener can skip a repeat. A failing listener never undoes the change.
ctx.hooks.action("justflows.bookings.booking.confirmed", async (event) => {
// { version: 1, eventKey, occurredAt, kind, id, number, status, previousStatus,
// paymentState, creditState, serviceId, staffId, locationId, startsAt, endsAt,
// timezone, userId, source, seriesId, bookingVersion }
if (await alreadyHandled(event.eventKey)) return;
await syncToBackOffice(event.id, event.startsAt);
});Booking events
Each carries kind, id, number, status, previousStatus, paymentState, creditState, serviceId, staffId, locationId, startsAt, endsAt, timezone, userId, source, seriesId, and bookingVersion.
| Event | When |
|---|---|
justflows.bookings.booking.created | A booking was made. |
justflows.bookings.booking.confirmed | A booking became confirmed: made confirmed, approved, or paid. |
justflows.bookings.booking.approved | Staff approved a booking. |
justflows.bookings.booking.paid | Payment confirmed a booking. |
justflows.bookings.booking.rescheduled | Moved to another time. |
justflows.bookings.booking.reassigned | Given to another team member at the same time. |
justflows.bookings.booking.cancelled | Cancelled. |
justflows.bookings.booking.checked_in | Checked in. |
justflows.bookings.booking.completed | Completed. |
justflows.bookings.booking.no_show | Marked no-show. |
justflows.bookings.booking.failed | The payment window closed unpaid. |
justflows.bookings.booking.restored | A cancelled booking was restored. |
justflows.bookings.booking.retried | A failed booking was sent back to payment. |
justflows.bookings.booking.paid_late | Payment arrived after the window closed and the time was still free. |
Holds, payments, and credits
| Event | When | Payload beyond the envelope |
|---|---|---|
justflows.bookings.hold.created | A visitor held a time. | holdId, serviceId, staffId, locationId, startsAt, endsAt, expiresAt, timezone |
justflows.bookings.hold.expired | A hold lapsed. | holdId |
justflows.bookings.payment.linked | A commerce plugin started payment for a booking. | bookingId, provider, reference |
justflows.bookings.payment.applied | A payment outcome was applied. | bookingId, provider, outcome, result, reference, paymentState |
justflows.bookings.credits.grant (also .pause, .resume, .end, .revoke) | A credits message was applied. | provider, sourceRef, productRef, periodKey, quantity, result |
Version 1 keeps the fields the 0.1 events had at the top level, so older listeners keep working. Hook names a plugin emits must start with its own id, so Bookings’ events are always under justflows.bookings.. Read the booking itself through the routes when you need more than the payload.
Core hooks Bookings uses
| Hook | What Bookings does |
|---|---|
account.sections | Adds *Your bookings* and *Your credits* to the account page. |
privacy.providers | Takes part in the site's data requests: export and erasure. |
staticExport.exclude | Keeps /manage-booking and /booking out of static exports. |