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 Create Schedule to set your new calendar. Provide your appId, we recommend to also pass name. Save the ID of the created schedule.
  2. Use Create Event 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 Query Events, 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 Update Event and Cancel Event 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 the Events View Projection Updated webhook.
  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 Get Events View to retrieve the endDate of the Wix calendar's event view.
  4. Use Query Events 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. See the filtering article for more details.
  5. Continue listening to the Events View Projection Updated webhook. 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 Query Events, applying fromLocalDate and toLocalDate as filters. For additional filter options, refer to the filtering article.
  2. Display the events to the business owner and let them select an event for participation management.
  3. Call Query Participations, providing the event ID as filter.
  4. Display the participant list to the business owner, enabling them to modify it as needed.
  5. Use Create Participation, Update Participation, or Delete Participation 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 Query Resources to retrieve the schedule IDs of the relevant resources.
  2. Set up a combined schedule for all affected resources using Create Schedule. Provide a descriptive name and the Bookings appId. Then, save the returned scheduleId.
  3. Call Create Event. Provide a start and end time, the scheduleId, and all relevant resourceIds. To make the blocked time recurring, also provide a recurrenceRule.
Did this help?