Creates a service.
When creating a service you must specify the following fields:
type:
Whether it's an appointment-based service, class, or course.name: Service name that's displayed to customers.onlineBooking:
Settings determining whether customers can book online, whether the business
must manually confirm bookings, and whether customers can request to book an
appointment time slot that already has a booking request awaiting business
confirmation.payment:
How customers can pay when signing up for the service.defaultCapacity: The maximum number of customers that can book the service. Required for all service types. For appointment-based services, it must be 1.Depending on which type of service you're creating, you may also need to specify supported session durations.
Classes and courses
Don't specify schedule.availabilityConstraints.sessionDurations.
Appointment-based services without varied pricing based on session length
Specify the single supported session duration in the
schedule.availabilityConstraints.sessionDurations array.
Appointment-based services with varied pricing based on session length
schedule.availabilityConstraints.sessionDurations.schedule.availabilityConstraints.sessionDurations,
even though these values are ignored.Don't specify existing add-on groups when calling Create Service. Instead, use dedicated add-on group and add-on creation methods to ensure proper validation and maintain referential integrity between services and their optional extras. You can follow this sample flow (SDK | [REST](https://dev. wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/sample-flows#create-bookable-add-ons-for-a-new-group)) to create bookable add-ons.
You can only call this method when authenticated as a Wix app or Wix user identity.
There are 21 errors with this status code.
This method may also return standard errors. Learn more about standard Wix errors.