View Categories

Tours and staff for developers

3 min read

The tours and staff features have REST routes under wc-sibooking/v1 and hooks. The REST API uses the same authentication as the rest of the plugin’s API (see REST API overview and authentication).

Departures #

A departure is named by its id, or, before it has a row of its own, by <product id>@<YYYYMMDDHHMM> (for example 123@202610181000).

RouteWhat it does
GET /departuresThe coming departures, with seats, status and staff.
POST /departuresAdd a one-off departure.
GET /departures/{key}One departure.
PATCH /departures/{key}Change its capacity, sales, cut-off, minimum or notes, or its time (every booking moves with it).
POST /departures/{key}/cancelCancel it with a refund or an offer to move.
GET /departures/{key}/manifestIts manifest.
GET / POST /departures/{key}/checkinsRead check-ins, or check a guest or a booking in.

Staff assigned to a departure can read its manifest and check guests in.

Staff and resources #

RouteWhat it does
/staff, /staff/{id}, /staff/{id}/restore, /staff/freeStaff, and who is free for a time.
/skills, /skills/{code}The skill list.
/resources, /resources/{id}, /resources/{id}/restore, /resources/freeResources, and which are free.
/jobs, /jobs/{ref}, /jobs/{ref}/assignments, /jobs/{ref}/auto-assignJobs and their assignments. A departure’s job is departure:{id}.
/assignments, /assignments/{id}, …/accept, …/decline, …/check-in, …/noteAssignments, and what staff do on My schedule.
/conflicts, /unassignedClashes, and jobs still missing someone.
/board, /board/changes, /board/candidates, /board/assign, /board/reassign, /board/unassign, /board/auto-fill, /board/apply-fillThe Staff schedule.
POST /my-schedule/scanAnswer a scanned or typed code.

Hooks #

HookTypeWhen
sibooking_departure_changedactionA departure row was written (added, updated, moved, status).
sibooking_departure_time_changedactionA departure’s time was changed and its bookings moved.
sibooking_departure_cancelledactionA departure was cancelled and its guests refunded or offered another date.
sibooking_departure_cancelled_notifyactionTell a customer their departure was cancelled (the Departure cancelled email listens).
sibooking_departure_below_minimumactionA departure is short of its minimum, 24 hours before its deadline or at it.
sibooking_departure_guaranteedactionA departure is guaranteed to run.
sibooking_departure_customer_movedactionA customer moved their booking to another departure in My Account.
sibooking_departure_card_returnedfilterHow much of a cancelled departure’s gift card part the gift card plugin put back on its card; the rest is noted to re-issue by hand.
sibooking_departure_phonefilterThe phone number “Call us to book” shows.
sibooking_departure_schemafilterThe schema.org Event markup of a tour’s page.
sibooking_participant_checked_in, sibooking_participant_no_showactionA guest was checked in, or marked a no-show.
sibooking_participant_names_savedactionA booking’s guest names were saved.
sibooking_participant_sign_urlfilterWhere staff open a guest’s waiver to sign on their phone.
sibooking_staff_assigned, sibooking_staff_unassigned, sibooking_staff_assignment_changedactionAn assignment was made, cancelled or changed.
sibooking_staff_assignment_accepted, sibooking_staff_assignment_declined, sibooking_staff_checked_inactionA staff member accepted, declined or checked in on My schedule.
sibooking_staff_booking_jobfilterA booking’s staff job before it is saved.
sibooking_staff_job_typesfilterThe kinds of jobs that need people or resources.
sibooking_staff_requirement_savedactionA product’s Staff & resources requirement was saved.
sibooking_staff_scan, sibooking_staff_scan_enabledfilterAnswer a code scanned on My schedule; show the Scan button.
sibooking_staff_locations, sibooking_staff_scope_locations, sibooking_staff_opening_hoursfilterLocations and opening hours (Multi Location Inventory answers them).
sibooking_staff_understaffed_hoursfilterHow many hours ahead an understaffed job is reported (48).
sibooking_my_schedule_cardsfilterAdd a card to the top of My schedule.

The plugin’s docs/hooks.md has every parameter.