This guide provides step-by-step examples for creating custom booking flows using the Wix Bookings APIs. These flows cover appointments, class sessions, and courses. You'll also learn how to handle payments using Wix eCommerce or a custom checkout. Use these flows as a starting point to implement tailored booking experiences.
You can display available time slots for appointment-based services to customers, let them choose a slot, and create the booking.
To book an appointment:
properties.timeZone.{"type": "APPOINTMENT"} as a filter to retrieve all appointment-based services.serviceId, timeZone, fromLocalDate, and toLocalDate as filters.slot.
Save the relevant time slot details.localStartDate and localEndDate.To handle payments, refer to the Handle Payments section.
You could display available class sessions to customers, let them choose the session, and create the booking.
To book a class session:
timeZone of the business location.{"type": "CLASS"} as a filter to retrieve all classes.serviceId, timeZone, fromLocalDate, toLocalDate, and the number of openSpots the customer intends to book as filters.eventId from the selected time slot.eventId to get detailed information about the class session.To handle payments, refer to the Handle Payments section.
You could display available courses to customers, let them choose a service, and create the booking.
To book a course:
{"type": "COURSE"} as a filter to retrieve all courses.id, defaultCapacity, and schedule.id.bookedEntity.item.schedule.serviceId as a filter.attendance.numberOfAttendees from all extended bookings. Then, subtract this total from the service's defaultCapacity to determine the number of remaining spots.numberOfParticipants doesn't exceed the remaining places.To handle payments, refer to the Handle Payments section.
Once you've created a booking, you can handle payments using one of the following methods:
catalogReference.appId and the relevant booking ID as catalogReference.catalogItemId. Save the checkout ID and totalAfterGiftCard.amount.options.paymentStatus to PAID to update the booking status to CONFIRMED.