wix_bookings_create_update_service id: wix_bookings_create_update_service Content
Below are the recommended steps to successfully create or update a Wix Bookings service (or several at once) on Wix, with real-world troubleshooting and fixes for common API issues.
https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/wix_bookings_create_update_service
Before creating services, ensure Wix Bookings is installed on the site:
If you encounter app-related errors, install the required apps using the Apps Installer API.
Steps:
For detailed app installation procedures, refer to:
A Bookings service defines a time based offering and includes the following considerations:
APPOINTMENT - Appointments allow customers to book services at their preferred time during the business hours. For example, a hair salon might offer different appointment-based hair cutting and styling services. Appointments appear in the booking calendar once they're booked by a customer. Not-yet-booked times during the business hours are displayed as available slots to potential customers while booking. The availability of the service is based on the availability of the staff member providing itCLASS - A class is a single event or a series of recurring events that multiple customers can book. For example, a yoga studio might offer a twice-weekly vinyasa flow class. Classes may have a set end date or continue indefinitely. If a class includes more than a single event, customers can sign up for 1, several, or all of the events. Upon creation, classes are listed immediately in the booking calendar.COURSE - A course starts and ends on pre-defined dates with a limited number of events that multiple customers can book. For example, a yoga studio might offer a teacher training course with 5 events. In contrast to classes, customers must book the entire course. Upon creation, courses are displayed immediately in the booking calendar.assignWorkingHoursSchedule which allows the staff member to have its own availability. The property staffMember.usesDefaultWorkingHours defines whether the default hours (business hours) are used.Events (SDK | REST) defined on a schedule.service.staffMemberIds which is mapped to staffMember.resourceId). In order to fetch the staff schedule you should retrieve the staff memeber with RESOURCE_DETAILS fieldmask and read the schedule id from the staffMember.resource.eventsSchedule.id - This is needed if you wish to define the staff member's availability as part of the processservice.schedule)staffMemberIds, ensure you are using the staff member's resourceId, not their primary staff member id.service.media.mainMedia - presented in the services list, service.media.coverMedia - presented in the service page and service.media.items - array of images presented as a gallery in the service page for site visitors.item.id -> service.media.mainMedia.id) there is no need to set the entire object.APPOINTMENT Services:
staffMemberIds array with staff member resourceId valuesCLASS and COURSE Services:
staffMemberIds has no effect on service creationservice.schedule), not staff schedulesThis is a critical API limitation that affects service planning and staff resource management.
CLASS or COURSE I MUST read the full articles service's schedule
and events mentioned beforeAPPOINTMENT I MUST read the relevant full article about staff members (SDK | REST) in order to determine whether I should create a new staff memeber (or members)service.payment.rateType as "NO_FEE" and service.payment.online as falseservice.payment.fixed.price.value (must be above 0) as well as service.payment.fixed.price.currencyIMPORTANT: Services without categories may not appear in category-based UI filters, which are commonly used in booking interfaces.
Service Category Considerations:
category.id, hiding uncategorized servicesCategory Management Steps:
category.id in the service objectCommon Category Filter Patterns:
{
"filter": {
"category.id": {
"$exists": true
}
}
}
This filter will only show services with assigned categories, making uncategorized services invisible to users.
You can retrieve a list of existing booking services using the Query Services endpoint. This allows you to filter, sort, and page through up to 100 services at a time, making it easy to find and manage your current offerings.
queryCategories API (REST) to identify available categoriescreateCategory API (REST) if no suitable category existscreateStaffMember API (SDK | REST) and keep the response staffMember.id (staff member ID) and resourceId (to be used in service.staffMemberIds in APPOINTMENT service)getStaffMember API
(SDK | REST) in order to their resource.eventsSchedule.id (schedule ID).queryStaffMembers API
(SDK | REST), specifying RESOURCE_DETAILS in the fields parameter. Save the relevant staff member ID, resourceId (for service.staffMemberIds) and their resource.eventsSchedule.id.Note for Service Type Planning:
Based on the information gathered above, use the relevant API based on the desired outcome,
In case you wish to create a service (one or more) use the bulkCreateServices endpoint (SDK | REST), in order to update a service, you can update several services at once, using bulkUpdateServices (SDK | REST) and if you wish to update serval services by a criteria (without even retrieving them) you can use bulkUpdateServicesByFilter (SDK | REST).
CRITICAL: Include Category Assignment
service.category.id when creating services to ensure UI visibility{
"service": {
"name": "Your Service Name",
"type": "APPOINTMENT",
"category": {
"id": "your-category-id-here"
},
// ... other service properties
}
}
Service Type Specific Considerations:
staffMemberIds with staff resourceId values AND category.idstaffMemberIds or expect them to be ignored; focus on service.schedule configuration AND category.idOnce the service and staff member are available, you can define when the service is available,
assignWorkingHoursSchedule
(SDK | REST).
specify the staffMember.id and use the resource.eventsSchedule.id retrieved previously as the scheduleId and define new availability for this staff member.service.schedule.id from the service created/updatedbulkCreateEvents (SDK | REST) to create the events that dictates the availability or bulkUpdateEvents (SDK | REST) to update existing schedule events.event.resources array, it should be the resourceId of the staff member defined previously.event.scheduleId should include the schedule Id of the staff member when setting APPOINTMENT availability and the service.schedule.id for CLASS or COURSE.event.type should be according to the created event - for staff member working hours it should be WORKING_HOURS when creating a CLASS it should be CLASS and when creating a COURSE it should be COURSEServices Not Appearing in UI Filters:
category.id existence or specific category valuesStaff Assignment Not Working for CLASS/COURSE Services:
staffMemberIds in CLASS or COURSE services appears to be ignoredApp Not Installed Errors:
Resource ID vs Staff ID Confusion:
staffMemberIds arraystaffMember.resourceId, not staffMember.idRESOURCE_DETAILS fieldMask to get correct IDsService Schedule vs Staff Schedule Confusion:
staffMember.resource.eventsSchedule.id)service.schedule.id)onlineBooking Field: The onlineBooking object (e.g., {"enabled": true}) is a required field when creating services, even if not explicitly highlighted as mandatory in the high-level overview. This is a schema-level requirement.event.type as WORKING_HOURS (APPOINTMENT) I MUST call assignWorkingHoursSchedule BEFORE CREATING THE EVENTS so that the staff member is no longer linked to the business working hoursevent.type as CLASS or COURSE I MUST use the service schedule id, so the service has to exist (created/updated) before setting the availability of it