> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/availability-time-slots-configuration-service-plugin/sample-flows.md ## Article Content: # Sample Flows 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. ## Provide custom time slot configurations during booking This flow shows what happens when a customer views available booking times, including when they select service variants or add-ons. > **Prerequisite:** [Resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) must exist for the services being booked. The merchant may also have configured services with [service options and variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md) or [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md). 1. A customer opens the Bookings calendar on a site. 2. The customer selects a service, and optionally chooses a duration variant and/or add-ons. 3. Wix calls your [List Availability Time Slot Configurations](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/availability-time-slots-configuration-service-plugin/list-availability-time-slot-configurations.md) implementation with `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](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). - `addOnIds`: IDs of selected [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md). 4. Your implementation returns a configuration for each service, specifying `duration`, `bufferTimeInMinutes`, `splitIntervalInMinutes`, `resourceTypes`, and `locations`. 5. To set `duration.defaultInMinutes`, your implementation must calculate the correct value based on the customer choices. The [Time Slots API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/introduction.md) forwards customer choices to your implementation without processing them, so your implementation is responsible for using them to calculate the correct duration: - **Only `addOnIds`:** Calculate the total duration as the service's base duration from [`service.schedule.availabilityConstraints.sessionDurations`](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) plus the [`durationInMinutes`](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) of all selected add-ons. - **Only `durationInMinutes`:** Use it directly as the slot duration. - **Both `addOnIds` and `durationInMinutes`:** The `durationInMinutes` value already includes the service duration plus all selected add-on durations. Use it directly. - **Neither:** Use the service's default duration from [`service.schedule.availabilityConstraints.sessionDurations`](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md). 6. Wix calculates available time slots based on your configuration, resource [schedules](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction.md), and existing [bookings](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-reader-v2/introduction.md). 7. The customer selects a slot and proceeds to book.