This article presents a use case and corresponding sample flow that you can support. It provides a useful starting point as you plan your implementation.
This flow shows what happens when a customer views available booking times, including when they select service variants or add-ons.
Prerequisite: Resources must exist for the services being booked. The merchant may also have configured services with service options and variants or add-ons.
services.serviceId for each service. If the customer made choices, the request also includes services.customerChoices with:
durationInMinutes: The duration selected by the customer from the service's options and variants.addOnIds: IDs of selected add-ons.duration, bufferTimeInMinutes, splitIntervalInMinutes, resourceTypes, and locations.duration.defaultInMinutes, your implementation must calculate the correct value based on the customer choices. The Time Slots API forwards customer choices to your implementation without processing them, so your implementation is responsible for using them to calculate the correct duration:
addOnIds: Calculate the total duration as the service's base duration from service.schedule.availabilityConstraints.sessionDurations plus the durationInMinutes of all selected add-ons.durationInMinutes: Use it directly as the slot duration.addOnIds and durationInMinutes: The durationInMinutes value already includes the service duration plus all selected add-on durations. Use it directly.service.schedule.availabilityConstraints.sessionDurations.