JustFlows

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.

typescript
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.

EventWhen
justflows.bookings.booking.createdA booking was made.
justflows.bookings.booking.confirmedA booking became confirmed: made confirmed, approved, or paid.
justflows.bookings.booking.approvedStaff approved a booking.
justflows.bookings.booking.paidPayment confirmed a booking.
justflows.bookings.booking.rescheduledMoved to another time.
justflows.bookings.booking.reassignedGiven to another team member at the same time.
justflows.bookings.booking.cancelledCancelled.
justflows.bookings.booking.checked_inChecked in.
justflows.bookings.booking.completedCompleted.
justflows.bookings.booking.no_showMarked no-show.
justflows.bookings.booking.failedThe payment window closed unpaid.
justflows.bookings.booking.restoredA cancelled booking was restored.
justflows.bookings.booking.retriedA failed booking was sent back to payment.
justflows.bookings.booking.paid_latePayment arrived after the window closed and the time was still free.

Holds, payments, and credits

EventWhenPayload beyond the envelope
justflows.bookings.hold.createdA visitor held a time.holdId, serviceId, staffId, locationId, startsAt, endsAt, expiresAt, timezone
justflows.bookings.hold.expiredA hold lapsed.holdId
justflows.bookings.payment.linkedA commerce plugin started payment for a booking.bookingId, provider, reference
justflows.bookings.payment.appliedA 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

HookWhat Bookings does
account.sectionsAdds *Your bookings* and *Your credits* to the account page.
privacy.providersTakes part in the site's data requests: export and erasure.
staticExport.excludeKeeps /manage-booking and /booking out of static exports.