This article shares basic flows your app could support. You're certainly not limited to these use cases, but they can be a helpful jumping-off point for your planning. Your app could add bookings to the business calendar. These bookings can be for all types of services: appointment-based, classes, and courses. You can also use all Wix eCommerce-supported payment methods, along with Wix Pricing Plans.
Your app could display available time slots for appointment-based services to customers, let them choose a slot, create the related booking, and handle the payment process using Wix eCommerce.
timeZone
of the business location.{"type": "APPOINTMENT"}
as a filter to retrieve all appointment-based services.serviceId
, the business timezone
,
startDate
and endDate
as filters.slot
.startDate
, endDate
, resource
and location
from the selected slot
in booking.bookedEntity.slot
. If the slot's availability hasn't changed
since running Query Availability, the function succeeds and the status of
the booking is CREATED
.catalogReference.appId
and the relevant booking ID as
catalogReference.catalogItemId
. Save the checkout ID and totalAfterGiftCard.amount
.Alternatively, you could follow these steps to handle the payment process with a custom checkout.
Your app could display available class sessions to customers, let them choose the session, create the booking, and handle the payment process with a custom checkout.
timeZone
of the business location.{"type": "CLASS"}
as a filter to retrieve all classes.serviceId
, the business timezone
, startDate
and
endDate
as filters.sessionId
.sessionId
in booking.bookedEntity.slot.sessionId
.
If the class session's availability hasn't changed since running
Query Availability, the call succeeds and the status of the booking is
CREATED
.options.paymentStatus
to PAID
to update the booking status to
CONFIRMED
.Alternatively, you could follow these steps to handle the payment process with Wix eCommerce.
Your app 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.defaultCapacity
.bookedEntity.item.schedule.serviceId
as a filter.attendance.numberOfAttendees
from all returned extended
bookings. This lets you know how many people have already booked a place in
the course.defaultCapacity
to calculate the remaining spots.numberOfParticipants
doesn't exceed the number of
remaining places.booking.bookedEntity.scheduleId
. If
the course's availability hasn't changed since running Query Extended Bookings,
the call succeeds and the status of the booking is CREATED
.Then, you could handle the payment process with Wix eCommerce or with a custom checkout.
Important:
Calling Create Booking
can fail if the service is no longer available. You
can ensure success, for example if you want to create a booking on behalf
of the business owner. Then, use Create Booking with
options.flowControlSettings.skipAvailabilityValidation
set to true
. Using other
flowControlSettings
lets you override the maximum number of participants per
session, or allow payment methods that aren't supported for the service.