Calendar V3: Sample Use Cases and Flows

This article shares possible use cases your app could support, along with sample flows that could guide each use case. Use this as a starting point as you plan your app's implementation.

Manage a calendar

Allow business owners to manage schedules within your app.

To manage a calendar:

  1. Call createSchedule() to set your new calendar. Provide your appId, we recommend to also pass name. Save the ID of the created schedule.
  2. Use createEvent() for every event you want in the calendar. Pass the scheduleId, start, and end times.
  3. To display the calendar to the business owner, use queryEvents(), filtering by your appId.
  4. When the calendar owner clicks on an event, you could display more details and allow editing and canceling the event.
  5. Optional: Use updateEvent() and cancelEvent() as necessary.

Sync calendars to an external system

Your app can help business owners keep their external calendar up to date with their Wix calendars.

To synchronize to the external system:

  1. Subscribe to onEventsViewProjectionUpdated().
  2. Based on the domain event's actionEvent type, create, update, or delete the corresponding event in the external calendar:
    • eventAddedOrUpdated: Create or update the event in the external calendar if its revision is higher than that of the event stored in the external calendar.
    • eventRemoved: Soft delete the event in the external calendar to avoid inconsistencies, as a hard delete might cause a mismatch if an updated event arrives later than a delete event.
  3. Use getEventsView() to retrieve the endDate of the Wix calendar's event view.
  4. Use queryEvents() to retrieve information about all events in the current event view.
    • Provide the endDate value from the event view as toLocalDate.
    • You may pass fromLocalDate as needed.
    • You can provide additional query filters based on your use case.
  5. Continue listening to onEventsViewProjectionUpdated(). Create, update, or soft delete events in the external calendar as described in step 2.

Create a participant dashboard

Enable business owners to manage their events' participation details through a dashboard. Note that Wix Bookings automatically provides this functionality.

To create a participant dashboard:

  1. Use queryEvents(), applying fromLocalDate and toLocalDate as filters.
  2. Display the events to the business owner and let them select an event for participation management.
  3. Call queryParticipations(), providing the event ID as filter.
  4. Display the participant list to the business owner, enabling them to modify it as needed.
  5. Use createParticipation(), updateParticipation(), or deleteParticipation() to adjust the list as necessary.

Block Wix Bookings resources

Your app could extend Wix Bookings functionality by blocking time across multiple Bookings resources.

To block Bookings resources:

  1. Use queryResources()) to retrieve the schedule IDs of the relevant resources.
  2. Set up a combined schedule for all affected resources using createSchedule(). Provide a descriptive name and the Bookings appId. Then, save the returned scheduleId.
  3. Call createEvent(). Provide a start and end time, the scheduleId, and all relevant resourceIds. To make the blocked time recurring, also provide a recurrenceRule.

Integrate Google Meet with Wix Bookings appointments

Your app can add Google Meet conferencing to Wix Bookings appointments. This enables business owners to offer additional video conferencing options for their services. Note that Wix Bookings supports Zoom conferencing out of the box.

To integrate Google Meet with Wix bookings:

  1. Subscribe to onEventsViewProjectionUpdated().
  2. Based on the domain event's actionEvent type, create, update, or delete the corresponding Google Meet meeting:
    • eventAddedOrUpdated: Create or update the Google Meet meeting if the event should have conferencing and doesn't already have conferencing details.
      • Update the Google Meet meeting when participants are added or removed, or when the meeting is rescheduled.
      • After creating or updating the Google Meet meeting using Google's APIs, use updateEvent() to add or update the Google Meet conferencing details to the calendar event.
      • Provide the event id, revision, and conferencingDetails with type set to CUSTOM, along with the meeting URLs. Optionally, you can also set conferencingDetails.externalId for your own management purposes.
    • eventRemoved: Delete the corresponding Google Meet meeting.

Important: For the integration to work properly, the service must be set with conferencing.enabled set to false. This prevents Wix Bookings from automatically adding default conferencing details to the service.

Did this help?