> 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/meetings/sample-flows.md

## Article Content:

# Wix Meetings: Sample Flows

This article presents sample flows for common Wix Meetings developer scenarios. You're not limited to these use cases, but they can be a helpful starting point for planning your implementation.

## Set up Wix Meetings

If your code relies on Wix Meetings, provision the required infrastructure, set up a host, and create a scheduling link.

1. Call [Provision Meetings App](https://dev.wix.com/docs/api-reference/business-solutions/meetings/provisioning-v1/provision-meetings-app.md). This creates:
   - A [headless OAuth client](https://dev.wix.com/docs/go-headless/self-managed-headless/authentication/oauth/create-a-client-for-authentication-with-oauth.md) for Wix Meetings.
   - A [booking form](https://dev.wix.com/docs/api-reference/business-solutions/bookings/wix-forms-integration.md#booking-forms) using the `wix.meetings.form` namespace.
   - A default [booking policy](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/introduction.md) with cancellation enabled and a 24-hour cancellation window.
   - A default [schedule](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction.md) with 30-minute meeting duration.
   - A default [service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/introduction.md) (scheduling link) of type `APPOINTMENT` with the Wix Meetings `appId`.
1. Call [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) and filter by `"appId": "6646a75c-2027-4f49-976c-58f3d713ed0f"` to retrieve the default service created by provisioning. Save the service ID, `mainSlug.name`, `schedule.id`, `form.id`, and `bookingPolicy.id`.
1. Optional: If you don't want to use the default service, call [Create Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/create-service.md) with the Wix Meetings [field values and restrictions](https://dev.wix.com/docs/api-reference/business-solutions/meetings/introduction.md#services). Save the service ID, `mainSlug.name`, and `schedule.id` from the response.
1. Optional: To change the default 30-minute meeting duration, call [Update Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-service.md) with the service ID and `schedule.availabilityConstraints.sessionDurations` set to the desired duration in minutes.
1. Call [Query Site Contributors](https://dev.wix.com/docs/api-reference/account-level/user-management/contributors/query-site-contributors.md).
   Save the `accountOwnerId` of the collaborator you want to assign as a host.
   Admins (co-owners) and backoffice managers have full access, while website managers, development site managers, and bookings admins can only manage their own meetings.
1. Call [Create Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/create-staff-member.md) to create the host's staff member record. Save the staff member ID.
1. Call [Connect Staff Member to User](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/connect-staff-member-to-user.md) with the staff member ID and the `accountOwnerId`.
1. Optional: By default, the host is available during the site's business hours. To set custom availability, see [Assign a Staff Working Hour Schedule](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/sample-flows.md#assign-a-staff-working-hour-schedule).

## Set up a paid meeting

By default, meetings are free. To charge customers, configure pricing on the service entity.

1. Call [Update Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-service.md) with the service ID. Set `payment.rateType` to `FIXED` and `payment.fixed.price` to the desired amount and currency.
1. Optional: To require a deposit instead of full payment upfront, set `payment.options.deposit` with the deposit amount.

Once payment is configured, the Meetings scheduling page automatically guides customers through the Wix eCommerce checkout flow. For a custom checkout, see [Handle Payments with a Custom Checkout](https://dev.wix.com/docs/api-reference/business-solutions/bookings/handle-payments-with-a-custom-checkout.md).

Learn more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md).

## Connect a host's external calendar

Connecting a host's external calendar prevents double-bookings across Google, Outlook, and iCloud calendars.

1. Call [List Providers](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/list-providers.md) to retrieve supported external calendar providers. Save the relevant provider's `id` and `features.connectMethods` to determine whether to use OAuth or credentials.
1. Call [Get Staff Member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/get-staff-member.md) with `fields: ["RESOURCE_DETAILS"]`. Save the host's schedule ID from `resource.eventsSchedule.id`.
1. Connect the calendar based on the provider's supported connection method:
   - **OAuth**: Call [Connect By OAuth](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/connect-by-o-auth.md), specifying the `scheduleId`, `providerId`, and a `redirectUrl`. Redirect the host to the returned `oAuthUrl`. After authorization, the host is redirected to your `redirectUrl` with a `connectionId` query parameter.
   - **Credentials**: Call [Connect By Credentials](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/connect-by-credentials.md), specifying the `scheduleId`, `providerId`, `email`, and `password`.
1. Call [Get Connection](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/get-connection.md) to verify the connection status. Check `syncConfig.listEventFromCalendars.enabled` for import and `syncConfig.syncToCalendar.enabled` for export to confirm sync directions.
1. Optional: Call [Update Sync Config](https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/update-sync-config.md) to adjust import and export settings.

## Schedule a meeting

To let customers book meetings, share the scheduling link URL. When a customer opens the link, the Meetings scheduling page handles the full booking flow automatically, including time slot selection, form submission, and payment if applicable. You don't need to call [Create Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/create-booking.md) unless you're building a fully custom booking experience.

1. Call [Get Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/get-service.md) with the relevant service ID. The response includes the scheduling page URL in `urls.bookingPage.url` and the service's URL identifier in `mainSlug.name`.
1. Share `urls.bookingPage.url` with customers through email, WhatsApp, QR code, or your app's UI.

## Deactivate a scheduling link

To temporarily stop bookings for a specific scheduling link, update the service and set `onlineBooking.enabled` to `false`.

1. Call [Get Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/get-service.md) to retrieve the current service and its latest `revision`.
1. Call [Update Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-service.md) with:
   - `id`: the service ID.
   - `revision`: the latest service revision.
   - `onlineBooking.enabled: false`.
1. Optional: To redirect visitors instead of showing an unavailable notice, set `extendedFields.namespaces["@services/meetings"].deactivatedRedirectUrl` to the target URL.

To reactivate the link, call [Update Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-service.md) again with `onlineBooking.enabled: true`.

## Reschedule a meeting

To reschedule an existing meeting to a new time slot:

1. Call [Query Extended Bookings](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-reader-v2/query-extended-bookings.md) to retrieve the meeting details. Save the service ID from `bookedEntity.slot.serviceId` and the current `revision`.
1. Call [List Availability Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots.md), specifying the `serviceId`, `timeZone`, `fromLocalDate`, and `toLocalDate`. Display the available slots for the customer to select.
1. Call [Get Availability Time Slot](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/get-availability-time-slot.md), specifying the selected slot's `localStartDate` and `localEndDate`, to verify it's still available.
1. Call [Reschedule Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/reschedule-booking.md) with the booking ID, the new slot details (`startDate`, `endDate`, `scheduleId`, `resource`, and `location`), and the current `revision`.

## Cancel a meeting

To cancel a meeting:

1. Call [Query Extended Bookings](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-reader-v2/query-extended-bookings.md) to retrieve the booking and confirm it can be canceled. Save the booking ID and current `revision`.
1. Call [Cancel Booking](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/cancel-booking.md) with the booking ID. If the meeting was paid, use `flowControlSettings` to handle the refund:
   - Set `withRefund` to `true` to refund [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/plans-v3/introduction.md) payments.
   - Set `waiveCancellationFee` to `true` to waive any [cancellation fee](https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/booking-fees/introduction.md).
1. For meetings paid through Wix eCommerce, issue a refund using the [eCommerce Orders API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/introduction.md). Learn more about [order billing sample flows](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-billing/sample-flows.md).