Working with Time Slots
By default, all the booking for given time slot is handled automatically for you.
When using externalBooking: false
inside config you handle your booking by yourself using helpful functions.
This is especially useful when you want to control the flow of the bookings. For example, let's say you want to reserve a time slot inside your built-in calendar integration, and confirm the reservation after the form is successfully handled.
Book
When called time slot is immediately booked.
ts
window.ZaptimePlugin.book({
email: string,
firstName?: string,
lastName?: string,
calendarId?: string
seats?: number, // Defaults to 1
}): Promise<void>
Reserve
Makes a reservation for 5 minutes to selected time slot. Needs to be confirmed.
ts
window.ZaptimePlugin.reserve({
email: string,
firstName?: string,
lastName?: string,
calendarId?: string
seats?: number, // Defaults to 1
}): Promise<void>
Confirm
Confirms previously reserved time slot.
ts
window.ZaptimePlugin.confirm(calendarId?: string): Promise<void>
Cancel
Cancels previously reserved time slot.
ts
window.ZaptimePlugin.cancel(calendarId?: string): Promise<void>