About Business Schedules

Each business has a main schedule that defines its operating hours and availability. The business schedule always uses the externalId value 4e0579a5-491e-4e70-a872-d097eed6e520.

By default, each business has 5 recurring WORKING_HOURS events, 1 for each weekday (Monday through Friday) from 10 AM to 6 PM. These MASTER events set the recurrence pattern that Wix Calendars uses to automatically calculate INSTANCE events. Learn more about recurring events.

To identify the IDs of the 5 MASTER events, retrieve at least 1 of their corresponding INSTANCE events. Call Query Events, specifying a date range that covers at least a full week and a query filter like this:

Copy

For each weekday's INSTANCE working hour event that's returned, save its id, recurringEventId, and scheduleId. The recurringEventId is the id of the corresponding MASTER event, which defines the recurrence pattern. All 5 weekday INSTANCE events share a scheduleId, which is the business schedule's id.

To modify working hours:

  • Adjust existing hours: Call Update Event with the relevant master event ID to change the recurring pattern. For example, shift hours from 10 AM–6 PM to 9 AM–5 PM.
  • Add working hours: Call Create Event to add additional events of "type": "WORKING_HOURS", "recurrenceType": "MASTER", and the relevant recurrenceRule. Specify the business schedule id as the event's scheduleId. For example, add Saturday hours or an evening shift.
  • Remove a working day: Call Cancel Event with the master event ID to remove that day from the schedule.
  • Block holidays or time off: Choose the appropriate method based on your blocking pattern:
    • Single day: Call Cancel Event to remove the day's INSTANCE event, or Update Event to shorten its hours.
    • Longer period: Call Create Event with the business schedule ID as scheduleId and start and end dates spanning the entire period. For example, 2 weeks of summer vacation. Don't specify recurrenceType, the system creates a one-off blocking event by default.
    • Recurring pattern: Call Create Event with the business schedule ID as scheduleId, "recurrenceType": "MASTER", and the relevant recurrenceRule. The system creates a DEFAULT type event whose instances block availability.
Did this help?