> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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.

## Provide duration range configurations for flexible-duration services

This flow shows what happens when a customer views available booking times for a service that supports a bookable duration range. Instead of fixed durations, the customer selects how long they want to book within a minimum and maximum range.

> **Prerequisite:** [Resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) must exist for the services being booked.

1. A customer opens the Bookings calendar on a site for a flexible-duration service (for example, a conference room that can be booked for 1 to 4 hours).
2. 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 the service.
3. Your implementation returns a configuration that includes both `duration` and `durationUnit`. For an hourly service:
    - `duration.defaultInMinutes`: The minimum bookable duration in minutes. For example, `60` for a 1-hour minimum. Wix uses this to calculate available start times.
    - `durationUnit.unitType`: `HOUR`
    - `durationUnit.minDuration`: Minimum bookable duration in minutes. For example, `60` for a 1-hour minimum.
    - `durationUnit.maxDuration`: Maximum bookable duration in minutes. For example, `240` for a 4-hour maximum.
4. Wix uses `duration.defaultInMinutes` to calculate available start times and displays them to the customer.
5. After the customer selects a start time, Wix uses `durationUnit` to calculate available end times based on the maximum duration and resource availability.
6. The customer selects an end time and proceeds to book.

For daily services, return only `durationUnit` and leave `duration` empty. Set `durationUnit.unitType` to `DAY` and specify `minDuration` and `maxDuration` in days. For example, `1` for a 1-day minimum and `5` for a 5-day maximum. Wix then calculates availability as full-day windows instead of time slots.