> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # UpdateService # Package: services # Namespace: ServicesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-service.md ## Permission Scopes: Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS ## Introduction Updates a service. Each time the service is updated, `revision` increments by 1. You must include the number of the existing revision when updating the service. This ensures you're working with the latest service information and prevents unintended overwrites. --- ## REST API ### Schema ``` Method: updateService Description: Updates a service. Each time the service is updated, `revision` increments by 1. You must include the number of the existing revision when updating the service. This ensures you're working with the latest service information and prevents unintended overwrites. ### Session durations Specify `schedule.availabilityConstraints.sessionDurations` only if you want to update it for appointment-based services without varied pricing based on session length. Don't specify `schedule.availabilityConstraints.sessionDurations` for all other appointment-based services, classes, or courses. See [Create Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/create-service.md#session-durations) for more details. ### Service locations Don't call Update Service to adjust service locations, call [Set Service Locations](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/set-service-locations.md) instead. ### Add-on groups Don't use Update Service to modify service add-on groups. Use these dedicated methods instead: - **Update add-on group properties**: Call Update Add On Group ([SDK](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-add-on-group?apiView=SDK.md) | [REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-add-on-group.md)). - **Update add-on display order**: Call Set Add Ons For Group ([SDK](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/set-add-ons-for-group?apiView=SDK.md) | [REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/set-add-ons-for-group.md)). URL: https://www.wixapis.com/_api/bookings/v2/services/{service.id} Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: service, service.id, service.revision Method parameters: param name: service | type: Service | description: The `service` object represents an offering that a business provides to its customers. | required: true - name: id | type: string | description: Service GUID. | required: true - name: appId | type: string | description: GUID of the app associated with the service. You can't update `appId`. Services are displayed in Wix Bookings only if they are associated with the Wix Bookings appId or have no associated app GUID. Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app GUID) For services from Wix apps, the following values apply: - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"` - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`. [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: type | type: ServiceType | description: Service type. Learn more about [service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types.md). - enum: - APPOINTMENT: Appointment-based service. - CLASS: Class service. - COURSE: Course service. - name: sortOrder | type: integer | description: Order of the service within a [category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v1/category-object.md). - name: name | type: string | description: Service name. - name: description | type: string | description: Service description. For example, `High-class hair styling, cuts, straightening and color`. - name: tagLine | type: string | description: Short service description, such as `Hair styling`. - name: defaultCapacity | type: integer | description: Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity. - name: media | type: Media | description: Media associated with the service. - name: items | type: array | description: Media items associated with the service. - ONE-OF: - name: image | type: Image | description: Details of the image associated with the service, such as URL and size. - name: id | type: string | description: WixMedia image GUID. (e.g. "4b3901ffcb8d7ad81a613779d92c9702.jpg") - name: url | type: string | description: Image URL. (similar to image.id e.g. "4b3901ffcb8d7ad81a613779d92c9702.jpg") - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: mainMedia | type: MediaItem | description: Primary media associated with the service. - name: coverMedia | type: MediaItem | description: Cover media associated with the service. - name: hidden | type: boolean | description: Whether the service is hidden from Wix Bookings pages and widgets. - name: category | type: Category | description: [Category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/introduction.md) the service is associated with. Services aren't automatically assigned to a category. Without an associated category, the service isn't visible on the live site. - name: id | type: string | description: Category GUID. - name: form | type: Form | description: Form the customer filled out when booking the service. - name: id | type: string | description: GUID of the form associated with the service. The form information that you submit when booking includes contact details, participants, and other form fields set up for the service. You can manage the service booking form fields using the Bookings Forms API. - name: payment | type: Payment | description: Payment options for booking the service. Learn more about [service payments](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments.md). - ONE-OF: - name: fixed | type: FixedPayment | description: The details for the fixed price of the service. Required when: `rateType` is `FIXED` - name: price | type: Money | description: The fixed price required to book the service. Required when: `rateType` is `FIXED` - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator. For example `25.05`. - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format. For example, `1 000,30`. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `FIXED` and `paymentOptions.deposit` is `true` - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: custom | type: CustomPayment | description: The details for the custom price of the service. Required when: `rateType` is `CUSTOM` - name: description | type: string | description: A custom description explaining to the customer how to pay for the service. - name: varied | type: VariedPayment | description: The details for the varied pricing of the service. Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options). Required when: `rateType` is `VARIED` - name: defaultPrice | type: Money | description: The default price for the service without any variants. It will also be used as the default price for any new variant. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `VARIED` and `paymentOptions.deposit` is `true` - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: rateType | type: RateType | description: The rate the customer is expected to pay for the service. - enum: - FIXED: The service has a fixed price. - CUSTOM: The service has a custom price, expressed as a price description. - VARIED: This service is offered with a set of different prices based on different terms. - NO_FEE: This service is offered free of charge. - name: options | type: PaymentOptions | description: The payment options a customer can use to pay for the service. - name: online | type: boolean | description: Customers can pay for the service online. When `true`: + `rateType` must be `FIXED` or `VARIED`. + `fixed.price` or `varied.defaultPrice` must be specified respectively. Read more about [getting paid online](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online). - name: inPerson | type: boolean | description: Customers can pay for the service in person. - name: deposit | type: boolean | description: This service requires a deposit to be made online in order to book it. When `true`: + `rateType` must be `VARIED` or `FIXED`. + A `deposit` must be specified. - name: pricingPlan | type: boolean | description: Whether customers can pay for the service using a pricing plan. Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md). - name: addOnOption | type: AddOnPaymentOptions | description: How customers can pay for add-ons when paying for the related booking with a [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/pricing-plans/introduction.md). If customers pay for the booking using any method other than a pricing plan, the value of this field is ignored. - enum: - ONLINE: Customers are required to pay online for add-ons when the booking is paid for with a pricing plan. - IN_PERSON: Customers are required to pay in person for add-ons when the booking is paid for with a pricing plan. - name: onlineBooking | type: OnlineBooking | description: Online booking settings. - name: enabled | type: boolean | description: Whether the service can be booked online. When set to `true`, customers can book the service online. Configure the payment options via the `service.payment` property. When set to `false`, customers cannot book the service online, and the service can only be paid for in person. - name: requireManualApproval | type: boolean | description: Booking the service requires approval by the Wix user. - name: allowMultipleRequests | type: boolean | description: Multiple customers can request to book the same time slot. This is relevant when `requireManualApproval` is `true`. - name: conferencing | type: Conferencing | description: Conferencing options for the service. - name: enabled | type: boolean | description: Whether a conference link is generated for the service's sessions. - name: locations | type: array | description: The locations this service is offered at. Read more about [service locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md). - ONE-OF: - name: business | type: BusinessLocationOptions | description: Information about business locations. - name: id | type: string | description: GUID of the business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). When setting a business location, specify only the location GUID. Other location details are overwritten. - name: custom | type: CustomLocationOptions | description: Information about custom locations. - name: address | type: Address | description: Address of the custom location. - ONE-OF: - name: streetAddress | type: StreetAddress | description: Street name and number. - name: number | type: string | description: Street number. - name: name | type: string | description: Street name. - name: apt | type: string | description: Apartment number. - name: addressLine | type: string | description: - name: country | type: string | description: 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. - name: city | type: string | description: City name. - name: postalCode | type: string | description: Postal or zip code. - name: formattedAddress | type: string | description: Full address of the location. - name: type | type: LocationType | description: Location type. Default: `CUSTOM` - enum: - CUSTOM: Location set by the business that is not a standard business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - BUSINESS: Business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - CUSTOMER: The customer specifies any address when booking. Available only for appointment-based services. - name: bookingPolicy | type: BookingPolicy | description: [Policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction.md) determining under what conditions this service can be booked. For example, whether the service can only be booked up to 30 minutes before it begins. - name: id | type: string | description: The GUID to the policy for the booking. - name: schedule | type: Schedule | description: The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md), which can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md). - name: availabilityConstraints | type: AvailabilityConstraints | description: Limitations affecting the service availability. - name: sessionDurations | type: array | description: List of supported session durations in minutes. - For appointment-based services, specify `sessionDurations` when creating a service. - For appointment-based services with varied pricing by session length, you must still specify `sessionDurations`, but the values are ignored. Actual durations are taken from the [service variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). - For classes or courses, don't specify `sessionDurations` when creating a service. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: timeBetweenSessions | type: integer | description: The number of minutes between the end of a session and the start of the next. Min: `0` minutes Max: `720` minutes - name: staffMemberIds | type: array | description: IDs of the [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the [staff members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md) providing the service. Note that these are the resource GUIDs, not the staff member GUIDs. For appointment-based services, set this field when creating or updating the service. For classes and courses, this field is read-only and is automatically derived from staff assigned to the service's recurring scheduled sessions. Staff assigned only to single, non-recurring events are not included. Once all of a staff member's upcoming recurring sessions have ended, their GUID is removed from this field. To retrieve the full list of staff for classes or courses, query the service's calendar events instead. Learn more about [retrieving staff for classes and courses](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/sample-flows.md#retrieve-staff-members-for-a-class-or-course). - name: staffMemberDetails | type: StaffMemberDetails | description: Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified. - name: staffMembers | type: array | description: Staff members providing the service. For appointments only. - name: serviceResources | type: array | description: Information about which resources must be available so customers can book the service. For example, a meeting room or equipment. Some nested fields are only returned when specific conditional fields are requested: pass `RESOURCE_TYPE_DETAILS` to retrieve `resourceType.name`, and `RESOURCE_DETAILS` to retrieve `resourceDetails.resources`. - name: resourceType | type: ResourceType | description: Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md). - name: id | type: string | description: The type of the resource. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the service. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: seoData | type: SeoSchema | description: Custom SEO data for the service. - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: revision | type: string | description: Revision number, which increments by 1 each time the service is updated. To prevent conflicting changes, the existing revision must be used when updating a service. | required: true - name: addOnGroups | type: array | description: Information about the [add-on groups](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-add-on-groups.md) associated with the service. - name: name | type: string | description: Name of the add-on group. - name: maxNumberOfAddOns | type: integer | description: Maximum number of different [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) from the group customers can add when booking the service. When empty, there's no upper limit. - name: addOnIds | type: array | description: List of GUIDs of all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) included in the group. - name: prompt | type: string | description: Description or instructional prompt of the add-on group that's displayed to customers when booking the service. - name: taxableAddress | type: TaxableAddress | description: Taxable address used to calculate tax - name: taxableAddressType | type: TaxableAddressType | description: Taxable address type. - enum: BUSINESS, BILLING Return type: UpdateServiceResponse - name: service | type: Service | description: Updated service. - name: id | type: string | description: Service GUID. - name: appId | type: string | description: GUID of the app associated with the service. You can't update `appId`. Services are displayed in Wix Bookings only if they are associated with the Wix Bookings appId or have no associated app GUID. Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app GUID) For services from Wix apps, the following values apply: - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"` - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`. [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: createdByAppId | type: string | description: GUID of the app that created the service. This field is used for analytics, auditing, and tracking creation sources. This read-only field is automatically populated during service creation by checking these sources in order: 1. The caller's App GUID from the request identity context. 2. The service's `appId` field. 3. The Wix Bookings App GUID (`13d21c63-b5ec-5912-8397-c3a5ddb27a97`) as the final fallback. - name: type | type: ServiceType | description: Service type. Learn more about [service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types.md). - enum: - APPOINTMENT: Appointment-based service. - CLASS: Class service. - COURSE: Course service. - name: sortOrder | type: integer | description: Order of the service within a [category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v1/category-object.md). - name: name | type: string | description: Service name. - name: description | type: string | description: Service description. For example, `High-class hair styling, cuts, straightening and color`. - name: tagLine | type: string | description: Short service description, such as `Hair styling`. - name: defaultCapacity | type: integer | description: Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity. - name: media | type: Media | description: Media associated with the service. - name: items | type: array | description: Media items associated with the service. - ONE-OF: - name: image | type: Image | description: Details of the image associated with the service, such as URL and size. - name: id | type: string | description: WixMedia image GUID. (e.g. "4b3901ffcb8d7ad81a613779d92c9702.jpg") - name: url | type: string | description: Image URL. (similar to image.id e.g. "4b3901ffcb8d7ad81a613779d92c9702.jpg") - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image file name. - name: mainMedia | type: MediaItem | description: Primary media associated with the service. - name: coverMedia | type: MediaItem | description: Cover media associated with the service. - name: hidden | type: boolean | description: Whether the service is hidden from Wix Bookings pages and widgets. - name: category | type: Category | description: [Category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/introduction.md) the service is associated with. Services aren't automatically assigned to a category. Without an associated category, the service isn't visible on the live site. - name: id | type: string | description: Category GUID. - name: name | type: string | description: Category name. - name: sortOrder | type: integer | description: Order of a category within a category list. - name: form | type: Form | description: Form the customer filled out when booking the service. - name: id | type: string | description: GUID of the form associated with the service. The form information that you submit when booking includes contact details, participants, and other form fields set up for the service. You can manage the service booking form fields using the Bookings Forms API. - name: payment | type: Payment | description: Payment options for booking the service. Learn more about [service payments](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments.md). - ONE-OF: - name: fixed | type: FixedPayment | description: The details for the fixed price of the service. Required when: `rateType` is `FIXED` - name: price | type: Money | description: The fixed price required to book the service. Required when: `rateType` is `FIXED` - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator. For example `25.05`. - name: currency | type: string | description: Currency code in [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217). For example, `USD`. - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format. For example, `1 000,30`. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `FIXED` and `paymentOptions.deposit` is `true` - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: custom | type: CustomPayment | description: The details for the custom price of the service. Required when: `rateType` is `CUSTOM` - name: description | type: string | description: A custom description explaining to the customer how to pay for the service. - name: varied | type: VariedPayment | description: The details for the varied pricing of the service. Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options). Required when: `rateType` is `VARIED` - name: defaultPrice | type: Money | description: The default price for the service without any variants. It will also be used as the default price for any new variant. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `VARIED` and `paymentOptions.deposit` is `true` - name: minPrice | type: Money | description: The minimal price a customer may pay for this service, based on its variants. - name: maxPrice | type: Money | description: The maximum price a customer may pay for this service, based on its variants. - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: rateType | type: RateType | description: The rate the customer is expected to pay for the service. - enum: - FIXED: The service has a fixed price. - CUSTOM: The service has a custom price, expressed as a price description. - VARIED: This service is offered with a set of different prices based on different terms. - NO_FEE: This service is offered free of charge. - name: options | type: PaymentOptions | description: The payment options a customer can use to pay for the service. - name: online | type: boolean | description: Customers can pay for the service online. When `true`: + `rateType` must be `FIXED` or `VARIED`. + `fixed.price` or `varied.defaultPrice` must be specified respectively. Read more about [getting paid online](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online). - name: inPerson | type: boolean | description: Customers can pay for the service in person. - name: deposit | type: boolean | description: This service requires a deposit to be made online in order to book it. When `true`: + `rateType` must be `VARIED` or `FIXED`. + A `deposit` must be specified. - name: pricingPlan | type: boolean | description: Whether customers can pay for the service using a pricing plan. Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md). - name: pricingPlanIds | type: array | description: IDs of pricing plans that can be used as payment for the service. Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md). - name: addOnOption | type: AddOnPaymentOptions | description: How customers can pay for add-ons when paying for the related booking with a [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/pricing-plans/introduction.md). If customers pay for the booking using any method other than a pricing plan, the value of this field is ignored. - enum: - ONLINE: Customers are required to pay online for add-ons when the booking is paid for with a pricing plan. - IN_PERSON: Customers are required to pay in person for add-ons when the booking is paid for with a pricing plan. - name: discountInfo | type: DiscountInfo | description: Estimated discount information for the service based on active [eCommerce discounts](https://dev.wix.com/docs/rest/business-solutions/e-commerce/extensions/discounts/introduction.md). The final discount is determined during eCommerce checkout and may differ from the estimate, for example when discounts depend on cart totals. A discount is considered active when its start time has passed and its end time hasn't. If multiple active discounts apply, the most recently created one is returned. Returned only when `DISCOUNT_INFO_DETAILS` is requested. - name: discountName | type: string | description: Name of the discount. For example, `Summer Sale - 20% Off`. - name: priceAfterDiscount | type: Money | description: Estimated price after applying the discount. The final price is determined at checkout and may differ when additional discounts are applied or rules are re-evaluated with complete booking information. Not returned when the discount depends on booking or cart context, for example a discount that applies to a service only when booked together with another service, or when the discount requires information only available at checkout. - name: onlineBooking | type: OnlineBooking | description: Online booking settings. - name: enabled | type: boolean | description: Whether the service can be booked online. When set to `true`, customers can book the service online. Configure the payment options via the `service.payment` property. When set to `false`, customers cannot book the service online, and the service can only be paid for in person. - name: requireManualApproval | type: boolean | description: Booking the service requires approval by the Wix user. - name: allowMultipleRequests | type: boolean | description: Multiple customers can request to book the same time slot. This is relevant when `requireManualApproval` is `true`. - name: conferencing | type: Conferencing | description: Conferencing options for the service. - name: enabled | type: boolean | description: Whether a conference link is generated for the service's sessions. - name: locations | type: array | description: The locations this service is offered at. Read more about [service locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md). - ONE-OF: - name: business | type: BusinessLocationOptions | description: Information about business locations. - name: id | type: string | description: GUID of the business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). When setting a business location, specify only the location GUID. Other location details are overwritten. - name: name | type: string | description: Business location name. - name: default | type: boolean | description: Whether this is the default location. There can only be a single default location per site. - name: address | type: Address | description: Business location address. - ONE-OF: - name: streetAddress | type: StreetAddress | description: Street name and number. - name: number | type: string | description: Street number. - name: name | type: string | description: Street name. - name: apt | type: string | description: Apartment number. - name: addressLine | type: string | description: - name: country | type: string | description: 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. - name: city | type: string | description: City name. - name: postalCode | type: string | description: Postal or zip code. - name: formattedAddress | type: string | description: Full address of the location. - name: email | type: string | description: Business location email. - name: phone | type: string | description: Business location phone. - name: custom | type: CustomLocationOptions | description: Information about custom locations. - name: id | type: string | description: GUID of the custom location. - name: address | type: Address | description: Address of the custom location. - name: id | type: string | description: Location GUID. - name: type | type: LocationType | description: Location type. Default: `CUSTOM` - enum: - CUSTOM: Location set by the business that is not a standard business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - BUSINESS: Business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - CUSTOMER: The customer specifies any address when booking. Available only for appointment-based services. - name: calculatedAddress | type: Address | description: Location address. Empty for `{"type": "CUSTOMER"}`. - name: bookingPolicy | type: BookingPolicy | description: [Policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction.md) determining under what conditions this service can be booked. For example, whether the service can only be booked up to 30 minutes before it begins. - name: id | type: string | description: The GUID to the policy for the booking. - name: createdDate | type: string | description: Date and time the policy was created. - name: updatedDate | type: string | description: Date and time the policy was updated. - name: name | type: string | description: Name of the policy. - name: customPolicyDescription | type: PolicyDescription | description: Custom description for the policy. This policy is displayed to the participant. - name: enabled | type: boolean | description: Whether the description should be displayed. If `true`, the description is displayed. Default: `false` - name: description | type: string | description: The description to display. Default: Empty Max length: 2500 characters - name: default | type: boolean | description: Whether the policy is the default for the meta site. - name: limitEarlyBookingPolicy | type: LimitEarlyBookingPolicy | description: Policy for limiting early bookings. - name: enabled | type: boolean | description: Whether there is a limit on how early a customer can book. When `false`, there is no limit on the earliest booking time and customers can book in advance, as early as they like. Default: `false` - name: earliestBookingInMinutes | type: integer | description: Maximum number of minutes before the start of the session that a booking can be made. This value must be greater than `latest_booking_in_minutes` in the `LimitLateBookingPolicy` policy. Default: 10080 minutes (7 days) Min: 1 minute - name: limitLateBookingPolicy | type: LimitLateBookingPolicy | description: Policy for limiting late bookings. - name: enabled | type: boolean | description: Whether there is a limit on how late a customer can book. When `false`, there is no limit on the latest booking time and customers can book up to the last minute. Default: `false` - name: latestBookingInMinutes | type: integer | description: Minimum number of minutes before the start of the session that a booking can be made. For a schedule, this is relative to the start time of the next booked session, excluding past-booked sessions. This value must be less than `earliest_booking_in_minutes` in the `LimitEarlyBookingPolicy` policy. Default: 1440 minutes (1 day) Min: 1 minute - name: bookAfterStartPolicy | type: BookAfterStartPolicy | description: Policy on booking an entity after the start of the schedule. - name: enabled | type: boolean | description: Whether booking is allowed after the start of the schedule. When `true`, customers can book after the start of the schedule. Default: `false` - name: cancellationPolicy | type: CancellationPolicy | description: Policy for canceling a booked entity. - name: enabled | type: boolean | description: Whether canceling a booking is allowed. When `true`, customers can cancel the booking. Default: `false` - name: limitLatestCancellation | type: boolean | description: Whether there is a limit on the latest cancellation time. When `true`, a time limit is enforced. Default: `false` - name: latestCancellationInMinutes | type: integer | description: Minimum number of minutes before the start of the booked session that the booking can be canceled. Default: 1440 minutes (1 day) Min: 1 minute - name: allowAnonymous | type: boolean | description: Whether this cancellation policy allows anonymous cancellations. **Important**: This flag only applies when `enabled` is `true`. If the cancellation policy itself is disabled (`enabled` = `false`), anonymous users cannot cancel regardless of this flag's value. When not set (null), defaults to disabled. Default: `null` (treated as disabled) - name: reschedulePolicy | type: ReschedulePolicy | description: Policy for rescheduling a booked entity. - name: enabled | type: boolean | description: Whether rescheduling a booking is allowed. When `true`, customers can reschedule the booking. Default: `false` - name: limitLatestReschedule | type: boolean | description: Whether there is a limit on the latest reschedule time. When `true`, a time limit is enforced. Default: `false` - name: latestRescheduleInMinutes | type: integer | description: Minimum number of minutes before the start of the booked session that the booking can be rescheduled. Default: 1440 minutes (1 day) Min: 1 minute - name: allowAnonymous | type: boolean | description: Whether this reschedule policy allows anonymous rescheduling. **Important**: This flag only applies when `enabled` is `true`. If the reschedule policy itself is disabled (`enabled` = `false`), anonymous users cannot reschedule regardless of this flag's value. When not set (null), defaults to disabled. Default: `null` (treated as disabled) - name: waitlistPolicy | type: WaitlistPolicy | description: Waitlist policy for the service. - name: enabled | type: boolean | description: Whether the session has a waitlist. If `true`, there is a waitlist. Default: `false` - name: capacity | type: integer | description: Number of spots available in the waitlist. Default: 10 spots Min: 1 spot - name: reservationTimeInMinutes | type: integer | description: Amount of time a participant is given to book, once notified that a spot is available. Default: 10 minutes Min: 1 spot - name: participantsPolicy | type: ParticipantsPolicy | description: Policy regarding the participants per booking. - name: maxParticipantsPerBooking | type: integer | description: Maximum number of participants allowed. Default: 1 participant Min: 1 participant - name: resourcesPolicy | type: ResourcesPolicy | description: Policy for allocating resources. - name: enabled | type: boolean | description: `true` if this policy is enabled, `false` otherwise. When `false` then the client must always select a resource when booking an appointment. - name: autoAssignAllowed | type: boolean | description: `true`, if it is allowed to automatically assign a resource when booking an appointment, `false`, if the client must always select a resource. Default: `false` - name: cancellationFeePolicy | type: CancellationFeePolicy | description: Rules for cancellation fees. - name: enabled | type: boolean | description: Whether canceling a booking will result in a cancellation fee Default: `false` - name: cancellationWindows | type: array | description: Cancellation windows describing the time of cancellation and the fee to charge. - ONE-OF: - name: amount | type: Money | description: Amount to be charged as a cancellation fee. - name: percentage | type: string | description: Percentage of the original price to be charged as a cancellation fee. - name: startInMinutes | type: integer | description: The fee will be applied if the booked session starts within this start time in minutes. - name: autoCollectFeeEnabled | type: boolean | description: Whether the cancellation fee should not be automatically collected when customer cancels the booking. Default: `true` - name: saveCreditCardPolicy | type: SaveCreditCardPolicy | description: Rule for saving credit card. - name: enabled | type: boolean | description: Default: `false` - name: schedule | type: Schedule | description: The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md), which can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md). - name: id | type: string | description: GUID of the [schedule](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction.md) to which the service's events belong. - name: firstSessionStart | type: string | description: Start time of the first session in the schedule. For courses only. - name: lastSessionEnd | type: string | description: End time of the last session in the schedule. For courses only. - name: availabilityConstraints | type: AvailabilityConstraints | description: Limitations affecting the service availability. - name: durations | type: array | description: Calculated list of all supported session durations for the service. For appointment-based services without varied pricing based on session length, it matches the single value in the `sessionDurations` array. For appointment-based services with varied pricing based on session length, it includes session durations for all [variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md), while ignoring `sessionDurations`. For courses and classes, it includes durations for all future recurring sessions but excludes durations for one-off or past recurring sessions. - name: minutes | type: integer | description: The duration of the service in minutes. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: sessionDurations | type: array | description: List of supported session durations in minutes. - For appointment-based services, specify `sessionDurations` when creating a service. - For appointment-based services with varied pricing by session length, you must still specify `sessionDurations`, but the values are ignored. Actual durations are taken from the [service variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). - For classes or courses, don't specify `sessionDurations` when creating a service. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: timeBetweenSessions | type: integer | description: The number of minutes between the end of a session and the start of the next. Min: `0` minutes Max: `720` minutes - name: staffMemberIds | type: array | description: IDs of the [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the [staff members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md) providing the service. Note that these are the resource GUIDs, not the staff member GUIDs. For appointment-based services, set this field when creating or updating the service. For classes and courses, this field is read-only and is automatically derived from staff assigned to the service's recurring scheduled sessions. Staff assigned only to single, non-recurring events are not included. Once all of a staff member's upcoming recurring sessions have ended, their GUID is removed from this field. To retrieve the full list of staff for classes or courses, query the service's calendar events instead. Learn more about [retrieving staff for classes and courses](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/sample-flows.md#retrieve-staff-members-for-a-class-or-course). - name: staffMemberDetails | type: StaffMemberDetails | description: Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified. - name: staffMembers | type: array | description: Staff members providing the service. For appointments only. - name: staffMemberId | type: string | description: GUID of the [resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the staff member providing the service. Despite the field name, this is the resource GUID, not the staff member GUID. This value matches the staff member's `resourceId` from the [Staff Members API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md) and corresponds to the GUIDs in the service's `staffMemberIds` field. - name: name | type: string | description: Name of the staff member - name: mainMedia | type: StaffMediaItem | description: Main media associated with the service. - ONE-OF: - name: image | type: Image | description: Details of the image associated with the staff, such as URL and size. - name: serviceResources | type: array | description: Information about which resources must be available so customers can book the service. For example, a meeting room or equipment. Some nested fields are only returned when specific conditional fields are requested: pass `RESOURCE_TYPE_DETAILS` to retrieve `resourceType.name`, and `RESOURCE_DETAILS` to retrieve `resourceDetails.resources`. - name: resourceType | type: ResourceType | description: Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md). - name: id | type: string | description: The type of the resource. - name: name | type: string | description: The name of the resource type. - name: supportedSlugs | type: array | description: A slug is the last part of the URL address that serves as a unique identifier of the service. The list of supported slugs includes past service names for backwards compatibility, and a custom slug if one was set by the business owner. - name: name | type: string | description: The unique part of service's URL that identifies the service's information page. For example, `service-1` in `https:/example.com/services/service-1`. - name: custom | type: boolean | description: Whether the slug was generated or customized. If `true`, the slug was customized manually by the business owner. Otherwise, the slug was automatically generated from the service name. - name: createdDate | type: string | description: Date and time the slug was created. This is a system field. - name: mainSlug | type: Slug | description: Active slug for the service. Learn more about [service slugs](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-slugs.md). - name: urls | type: URLs | description: URLs to various service-related pages, such as the calendar page and the booking page. - name: servicePage | type: PageUrlV2 | description: The URL for the service page. - name: relativePath | type: string | description: The relative path for the page within the site. For example, `/product-page/a-product`. - name: url | type: string | description: The page's full URL. For example, `https://mysite.com/product-page/a-product`. - name: bookingPage | type: PageUrlV2 | description: The URL for the booking entry point. It can be either to the calendar or to the service page. - name: calendarPage | type: PageUrlV2 | description: The URL for the calendar. Can be empty if no calendar exists. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the service. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: seoData | type: SeoSchema | description: Custom SEO data for the service. - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: createdDate | type: string | description: Date and time the service was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: updatedDate | type: string | description: Date and time the service was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: revision | type: string | description: Revision number, which increments by 1 each time the service is updated. To prevent conflicting changes, the existing revision must be used when updating a service. - name: addOnGroups | type: array | description: Information about the [add-on groups](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-add-on-groups.md) associated with the service. - name: id | type: string | description: GUID of the add-on group. Wix Bookings automatically populates this field when creating or updating an add-on group. - name: name | type: string | description: Name of the add-on group. - name: maxNumberOfAddOns | type: integer | description: Maximum number of different [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) from the group customers can add when booking the service. When empty, there's no upper limit. - name: addOnIds | type: array | description: List of GUIDs of all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) included in the group. - name: prompt | type: string | description: Description or instructional prompt of the add-on group that's displayed to customers when booking the service. - name: addOnDetails | type: array | description: Details about all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) customers can choose when booking the service. - name: addOnId | type: string | description: GUID of the add-on. - name: durationInMinutes | type: integer | description: Duration in minutes for add-ons that extend service time. Empty for [quantity-based add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md#terminology). - name: taxableAddress | type: TaxableAddress | description: Taxable address used to calculate tax - name: taxableAddressType | type: TaxableAddressType | description: Taxable address type. - enum: BUSINESS, BILLING Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SESSION_DURATION | Description: Appointment-based services require at least 1 session duration in `schedule.availabilityConstraints.sessionDurations`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_APPOINTMENT_CAPACITY | Description: Appointment-based services can only have a `defaultCapacity` of `1`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_DEFAULT_CAPACITY | Description: Service `defaultCapacity` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_MANUAL_APPROVAL_WITH_PRICING_PLANS | Description: Services that require manual approval can't be paid using pricing plans. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_UNKNOWN_LOCATION | Description: Location must have a valid `type` property. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CUSTOMER_LOCATION | Description: Locations with `type` set to `CUSTOMER` can only be set on appointment-based services. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CUSTOM_LOCATION | Description: Locations with `type` set to `CUSTOM` can only have custom location options. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BUSINESS_LOCATION | Description: Locations with `type` set to `BUSINESS` can only have business location options. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_LOCATIONS | Description: Service `locations` are invalid. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BUSINESS_LOCATIONS | Description: Some of the specified business location GUIDs don't exist. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_PAYMENT_OPTIONS | Description: Service `payment.options` are invalid. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_RATE | Description: Service `payment.rate` is invalid. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_PAYMENT_TYPE | Description: Service `payment.rateType` must be set to `FIXED`, `VARIED`, `CUSTOM`, or `NO_FEE`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PAYMENT_REQUIRED | Description: Service `payment` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_STAFF_MEMBER_IDS | Description: Appointment-based services require at least 1 resource GUID associated with a staff member in `staffMemberIds`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ONLINE_BOOKING | Description: Service `onlineBooking` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SERVICE_NAME | Description: Service `name` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SERVICE_TYPE | Description: Service `type` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BOOKING_POLICY | Description: Couldn't find the booking policy. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CATEGORY | Description: Couldn't find the category. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FORM | Description: Couldn't find the form. ``` ### Examples ### Update a service ```curl curl -X PATCH 'https://www.wixapis.com/bookings/v2/services/d779a301-398d-4552-aa8c-3bef0b65cedb' \ -H 'Authorization: ' \ -d '{ "service": { "id": "d779a301-398d-4552-aa8c-3bef0b65cedb", "name": "Group Cat Hugging", "revision": "1" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.ServicesService.updateService(_id, service) Description: Updates a service. Each time the service is updated, `revision` increments by 1. You must include the number of the existing revision when updating the service. This ensures you're working with the latest service information and prevents unintended overwrites. ### Session durations Specify `schedule.availabilityConstraints.sessionDurations` only if you want to update it for appointment-based services without varied pricing based on session length. Don't specify `schedule.availabilityConstraints.sessionDurations` for all other appointment-based services, classes, or courses. See [Create Service](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/create-service.md#session-durations) for more details. ### Service locations Don't call Update Service to adjust service locations, call [Set Service Locations](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/set-service-locations.md) instead. ### Add-on groups Don't use Update Service to modify service add-on groups. Use these dedicated methods instead: - **Update add-on group properties**: Call Update Add On Group ([SDK](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-add-on-group?apiView=SDK.md) | [REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-add-on-group.md)). - **Update add-on display order**: Call Set Add Ons For Group ([SDK](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/set-add-ons-for-group?apiView=SDK.md) | [REST](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/set-add-ons-for-group.md)). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: service, _id, service.revision Method parameters: param name: _id | type: string | description: Service GUID. | required: true param name: service | type: UpdateService | description: The `service` object represents an offering that a business provides to its customers. | required: true - name: appId | type: string | description: GUID of the app associated with the service. You can't update `appId`. Services are displayed in Wix Bookings only if they are associated with the Wix Bookings appId or have no associated app GUID. Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app GUID) For services from Wix apps, the following values apply: - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"` - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`. [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: type | type: ServiceType | description: Service type. Learn more about [service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types.md). - enum: - APPOINTMENT: Appointment-based service. - CLASS: Class service. - COURSE: Course service. - name: sortOrder | type: integer | description: Order of the service within a [category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v1/category-object.md). - name: name | type: string | description: Service name. - name: description | type: string | description: Service description. For example, `High-class hair styling, cuts, straightening and color`. - name: tagLine | type: string | description: Short service description, such as `Hair styling`. - name: defaultCapacity | type: integer | description: Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity. - name: media | type: Media | description: Media associated with the service. - name: items | type: array | description: Media items associated with the service. - ONE-OF: - name: image | type: string | description: Details of the image associated with the service, such as URL and size. - name: mainMedia | type: MediaItem | description: Primary media associated with the service. - name: coverMedia | type: MediaItem | description: Cover media associated with the service. - name: hidden | type: boolean | description: Whether the service is hidden from Wix Bookings pages and widgets. - name: category | type: Category | description: [Category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/introduction.md) the service is associated with. Services aren't automatically assigned to a category. Without an associated category, the service isn't visible on the live site. - name: _id | type: string | description: Category GUID. - name: form | type: Form | description: Form the customer filled out when booking the service. - name: _id | type: string | description: GUID of the form associated with the service. The form information that you submit when booking includes contact details, participants, and other form fields set up for the service. You can manage the service booking form fields using the Bookings Forms API. - name: payment | type: Payment | description: Payment options for booking the service. Learn more about [service payments](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments.md). - ONE-OF: - name: fixed | type: FixedPayment | description: The details for the fixed price of the service. Required when: `rateType` is `FIXED` - name: price | type: Money | description: The fixed price required to book the service. Required when: `rateType` is `FIXED` - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator. For example `25.05`. - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format. For example, `1 000,30`. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `FIXED` and `paymentOptions.deposit` is `true` - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: custom | type: CustomPayment | description: The details for the custom price of the service. Required when: `rateType` is `CUSTOM` - name: description | type: string | description: A custom description explaining to the customer how to pay for the service. - name: varied | type: VariedPayment | description: The details for the varied pricing of the service. Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options). Required when: `rateType` is `VARIED` - name: defaultPrice | type: Money | description: The default price for the service without any variants. It will also be used as the default price for any new variant. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `VARIED` and `paymentOptions.deposit` is `true` - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: rateType | type: RateType | description: The rate the customer is expected to pay for the service. - enum: - FIXED: The service has a fixed price. - CUSTOM: The service has a custom price, expressed as a price description. - VARIED: This service is offered with a set of different prices based on different terms. - NO_FEE: This service is offered free of charge. - name: options | type: PaymentOptions | description: The payment options a customer can use to pay for the service. - name: online | type: boolean | description: Customers can pay for the service online. When `true`: + `rateType` must be `FIXED` or `VARIED`. + `fixed.price` or `varied.defaultPrice` must be specified respectively. Read more about [getting paid online](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online). - name: inPerson | type: boolean | description: Customers can pay for the service in person. - name: deposit | type: boolean | description: This service requires a deposit to be made online in order to book it. When `true`: + `rateType` must be `VARIED` or `FIXED`. + A `deposit` must be specified. - name: pricingPlan | type: boolean | description: Whether customers can pay for the service using a pricing plan. Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md). - name: addOnOption | type: AddOnPaymentOptions | description: How customers can pay for add-ons when paying for the related booking with a [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/pricing-plans/introduction.md). If customers pay for the booking using any method other than a pricing plan, the value of this field is ignored. - enum: - ONLINE: Customers are required to pay online for add-ons when the booking is paid for with a pricing plan. - IN_PERSON: Customers are required to pay in person for add-ons when the booking is paid for with a pricing plan. - name: onlineBooking | type: OnlineBooking | description: Online booking settings. - name: enabled | type: boolean | description: Whether the service can be booked online. When set to `true`, customers can book the service online. Configure the payment options via the `service.payment` property. When set to `false`, customers cannot book the service online, and the service can only be paid for in person. - name: requireManualApproval | type: boolean | description: Booking the service requires approval by the Wix user. - name: allowMultipleRequests | type: boolean | description: Multiple customers can request to book the same time slot. This is relevant when `requireManualApproval` is `true`. - name: conferencing | type: Conferencing | description: Conferencing options for the service. - name: enabled | type: boolean | description: Whether a conference link is generated for the service's sessions. - name: locations | type: array | description: The locations this service is offered at. Read more about [service locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md). - ONE-OF: - name: business | type: BusinessLocationOptions | description: Information about business locations. - name: _id | type: string | description: GUID of the business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). When setting a business location, specify only the location GUID. Other location details are overwritten. - name: custom | type: CustomLocationOptions | description: Information about custom locations. - name: address | type: Address | description: Address of the custom location. - name: city | type: string | description: none - name: subdivision | type: string | description: none - name: country | type: string | description: none - name: postalCode | type: string | description: none - name: addressLine1 | type: string | description: none - name: type | type: LocationType | description: Location type. Default: `CUSTOM` - enum: - CUSTOM: Location set by the business that is not a standard business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - BUSINESS: Business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - CUSTOMER: The customer specifies any address when booking. Available only for appointment-based services. - name: bookingPolicy | type: BookingPolicy | description: [Policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction.md) determining under what conditions this service can be booked. For example, whether the service can only be booked up to 30 minutes before it begins. - name: _id | type: string | description: The GUID to the policy for the booking. - name: schedule | type: Schedule | description: The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md), which can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md). - name: availabilityConstraints | type: AvailabilityConstraints | description: Limitations affecting the service availability. - name: sessionDurations | type: array | description: List of supported session durations in minutes. - For appointment-based services, specify `sessionDurations` when creating a service. - For appointment-based services with varied pricing by session length, you must still specify `sessionDurations`, but the values are ignored. Actual durations are taken from the [service variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). - For classes or courses, don't specify `sessionDurations` when creating a service. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: timeBetweenSessions | type: integer | description: The number of minutes between the end of a session and the start of the next. Min: `0` minutes Max: `720` minutes - name: staffMemberIds | type: array | description: IDs of the [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the [staff members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md) providing the service. Note that these are the resource GUIDs, not the staff member GUIDs. For appointment-based services, set this field when creating or updating the service. For classes and courses, this field is read-only and is automatically derived from staff assigned to the service's recurring scheduled sessions. Staff assigned only to single, non-recurring events are not included. Once all of a staff member's upcoming recurring sessions have ended, their GUID is removed from this field. To retrieve the full list of staff for classes or courses, query the service's calendar events instead. Learn more about [retrieving staff for classes and courses](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/sample-flows.md#retrieve-staff-members-for-a-class-or-course). - name: staffMemberDetails | type: StaffMemberDetails | description: Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified. - name: staffMembers | type: array | description: Staff members providing the service. For appointments only. - name: serviceResources | type: array | description: Information about which resources must be available so customers can book the service. For example, a meeting room or equipment. Some nested fields are only returned when specific conditional fields are requested: pass `RESOURCE_TYPE_DETAILS` to retrieve `resourceType.name`, and `RESOURCE_DETAILS` to retrieve `resourceDetails.resources`. - name: resourceType | type: ResourceType | description: Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md). - name: _id | type: string | description: The type of the resource. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the service. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: seoData | type: SeoSchema | description: Custom SEO data for the service. - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: revision | type: string | description: Revision number, which increments by 1 each time the service is updated. To prevent conflicting changes, the existing revision must be used when updating a service. | required: true - name: addOnGroups | type: array | description: Information about the [add-on groups](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-add-on-groups.md) associated with the service. - name: name | type: string | description: Name of the add-on group. - name: maxNumberOfAddOns | type: integer | description: Maximum number of different [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) from the group customers can add when booking the service. When empty, there's no upper limit. - name: addOnIds | type: array | description: List of GUIDs of all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) included in the group. - name: prompt | type: string | description: Description or instructional prompt of the add-on group that's displayed to customers when booking the service. - name: taxableAddress | type: TaxableAddress | description: Taxable address used to calculate tax - name: taxableAddressType | type: TaxableAddressType | description: Taxable address type. - enum: BUSINESS, BILLING Return type: PROMISE - name: _id | type: string | description: Service GUID. - name: appId | type: string | description: GUID of the app associated with the service. You can't update `appId`. Services are displayed in Wix Bookings only if they are associated with the Wix Bookings appId or have no associated app GUID. Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app GUID) For services from Wix apps, the following values apply: - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"` - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`. [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: createdByAppId | type: string | description: GUID of the app that created the service. This field is used for analytics, auditing, and tracking creation sources. This read-only field is automatically populated during service creation by checking these sources in order: 1. The caller's App GUID from the request identity context. 2. The service's `appId` field. 3. The Wix Bookings App GUID (`13d21c63-b5ec-5912-8397-c3a5ddb27a97`) as the final fallback. - name: type | type: ServiceType | description: Service type. Learn more about [service types](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-types.md). - enum: - APPOINTMENT: Appointment-based service. - CLASS: Class service. - COURSE: Course service. - name: sortOrder | type: integer | description: Order of the service within a [category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v1/category-object.md). - name: name | type: string | description: Service name. - name: description | type: string | description: Service description. For example, `High-class hair styling, cuts, straightening and color`. - name: tagLine | type: string | description: Short service description, such as `Hair styling`. - name: defaultCapacity | type: integer | description: Default maximum number of customers that can book the service. The service cannot be booked beyond this capacity. - name: media | type: Media | description: Media associated with the service. - name: items | type: array | description: Media items associated with the service. - ONE-OF: - name: image | type: string | description: Details of the image associated with the service, such as URL and size. - name: mainMedia | type: MediaItem | description: Primary media associated with the service. - name: coverMedia | type: MediaItem | description: Cover media associated with the service. - name: hidden | type: boolean | description: Whether the service is hidden from Wix Bookings pages and widgets. - name: category | type: Category | description: [Category](https://dev.wix.com/docs/rest/business-solutions/bookings/services/categories-v2/introduction.md) the service is associated with. Services aren't automatically assigned to a category. Without an associated category, the service isn't visible on the live site. - name: _id | type: string | description: Category GUID. - name: name | type: string | description: Category name. - name: sortOrder | type: integer | description: Order of a category within a category list. - name: form | type: Form | description: Form the customer filled out when booking the service. - name: _id | type: string | description: GUID of the form associated with the service. The form information that you submit when booking includes contact details, participants, and other form fields set up for the service. You can manage the service booking form fields using the Bookings Forms API. - name: payment | type: Payment | description: Payment options for booking the service. Learn more about [service payments](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments.md). - ONE-OF: - name: fixed | type: FixedPayment | description: The details for the fixed price of the service. Required when: `rateType` is `FIXED` - name: price | type: Money | description: The fixed price required to book the service. Required when: `rateType` is `FIXED` - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator. For example `25.05`. - name: currency | type: string | description: Currency code in [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217). For example, `USD`. - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format. For example, `1 000,30`. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `FIXED` and `paymentOptions.deposit` is `true` - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: custom | type: CustomPayment | description: The details for the custom price of the service. Required when: `rateType` is `CUSTOM` - name: description | type: string | description: A custom description explaining to the customer how to pay for the service. - name: varied | type: VariedPayment | description: The details for the varied pricing of the service. Read more about [varied price options](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online#offering-varied-price-options). Required when: `rateType` is `VARIED` - name: defaultPrice | type: Money | description: The default price for the service without any variants. It will also be used as the default price for any new variant. - name: deposit | type: Money | description: The deposit price required to book the service. Required when: `rateType` is `VARIED` and `paymentOptions.deposit` is `true` - name: minPrice | type: Money | description: The minimal price a customer may pay for this service, based on its variants. - name: maxPrice | type: Money | description: The maximum price a customer may pay for this service, based on its variants. - name: fullUpfrontPaymentAllowed | type: boolean | description: Whether customers can choose to pay the full service price upfront instead of only the deposit. Used only when a `deposit` amount is set. Default: `false`. - name: rateType | type: RateType | description: The rate the customer is expected to pay for the service. - enum: - FIXED: The service has a fixed price. - CUSTOM: The service has a custom price, expressed as a price description. - VARIED: This service is offered with a set of different prices based on different terms. - NO_FEE: This service is offered free of charge. - name: options | type: PaymentOptions | description: The payment options a customer can use to pay for the service. - name: online | type: boolean | description: Customers can pay for the service online. When `true`: + `rateType` must be `FIXED` or `VARIED`. + `fixed.price` or `varied.defaultPrice` must be specified respectively. Read more about [getting paid online](https://support.wix.com/en/article/wix-bookings-about-getting-paid-online). - name: inPerson | type: boolean | description: Customers can pay for the service in person. - name: deposit | type: boolean | description: This service requires a deposit to be made online in order to book it. When `true`: + `rateType` must be `VARIED` or `FIXED`. + A `deposit` must be specified. - name: pricingPlan | type: boolean | description: Whether customers can pay for the service using a pricing plan. Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md). - name: pricingPlanIds | type: array | description: IDs of pricing plans that can be used as payment for the service. Read more about [service payment options](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-service-payments.md). - name: addOnOption | type: AddOnPaymentOptions | description: How customers can pay for add-ons when paying for the related booking with a [pricing plan](https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/pricing-plans/introduction.md). If customers pay for the booking using any method other than a pricing plan, the value of this field is ignored. - enum: - ONLINE: Customers are required to pay online for add-ons when the booking is paid for with a pricing plan. - IN_PERSON: Customers are required to pay in person for add-ons when the booking is paid for with a pricing plan. - name: discountInfo | type: DiscountInfo | description: Estimated discount information for the service based on active [eCommerce discounts](https://dev.wix.com/docs/rest/business-solutions/e-commerce/extensions/discounts/introduction.md). The final discount is determined during eCommerce checkout and may differ from the estimate, for example when discounts depend on cart totals. A discount is considered active when its start time has passed and its end time hasn't. If multiple active discounts apply, the most recently created one is returned. Returned only when `DISCOUNT_INFO_DETAILS` is requested. - name: discountName | type: string | description: Name of the discount. For example, `Summer Sale - 20% Off`. - name: priceAfterDiscount | type: Money | description: Estimated price after applying the discount. The final price is determined at checkout and may differ when additional discounts are applied or rules are re-evaluated with complete booking information. Not returned when the discount depends on booking or cart context, for example a discount that applies to a service only when booked together with another service, or when the discount requires information only available at checkout. - name: onlineBooking | type: OnlineBooking | description: Online booking settings. - name: enabled | type: boolean | description: Whether the service can be booked online. When set to `true`, customers can book the service online. Configure the payment options via the `service.payment` property. When set to `false`, customers cannot book the service online, and the service can only be paid for in person. - name: requireManualApproval | type: boolean | description: Booking the service requires approval by the Wix user. - name: allowMultipleRequests | type: boolean | description: Multiple customers can request to book the same time slot. This is relevant when `requireManualApproval` is `true`. - name: conferencing | type: Conferencing | description: Conferencing options for the service. - name: enabled | type: boolean | description: Whether a conference link is generated for the service's sessions. - name: locations | type: array | description: The locations this service is offered at. Read more about [service locations](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-locations.md). - ONE-OF: - name: business | type: BusinessLocationOptions | description: Information about business locations. - name: _id | type: string | description: GUID of the business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). When setting a business location, specify only the location GUID. Other location details are overwritten. - name: name | type: string | description: Business location name. - name: default | type: boolean | description: Whether this is the default location. There can only be a single default location per site. - name: address | type: Address | description: Business location address. - name: city | type: string | description: none - name: subdivision | type: string | description: none - name: country | type: string | description: none - name: postalCode | type: string | description: none - name: addressLine1 | type: string | description: none - name: email | type: string | description: Business location email. - name: phone | type: string | description: Business location phone. - name: custom | type: CustomLocationOptions | description: Information about custom locations. - name: _id | type: string | description: GUID of the custom location. - name: address | type: Address | description: Address of the custom location. - name: _id | type: string | description: Location GUID. - name: type | type: LocationType | description: Location type. Default: `CUSTOM` - enum: - CUSTOM: Location set by the business that is not a standard business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - BUSINESS: Business [location](https://dev.wix.com/docs/api-reference/business-management/locations/introduction.md). - CUSTOMER: The customer specifies any address when booking. Available only for appointment-based services. - name: calculatedAddress | type: Address | description: Location address. Empty for `{"type": "CUSTOMER"}`. - name: bookingPolicy | type: BookingPolicy | description: [Policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction.md) determining under what conditions this service can be booked. For example, whether the service can only be booked up to 30 minutes before it begins. - name: _id | type: string | description: The GUID to the policy for the booking. - name: _createdDate | type: Date | description: Date and time the policy was created. - name: _updatedDate | type: Date | description: Date and time the policy was updated. - name: name | type: string | description: Name of the policy. - name: customPolicyDescription | type: PolicyDescription | description: Custom description for the policy. This policy is displayed to the participant. - name: enabled | type: boolean | description: Whether the description should be displayed. If `true`, the description is displayed. Default: `false` - name: description | type: string | description: The description to display. Default: Empty Max length: 2500 characters - name: default | type: boolean | description: Whether the policy is the default for the meta site. - name: limitEarlyBookingPolicy | type: LimitEarlyBookingPolicy | description: Policy for limiting early bookings. - name: enabled | type: boolean | description: Whether there is a limit on how early a customer can book. When `false`, there is no limit on the earliest booking time and customers can book in advance, as early as they like. Default: `false` - name: earliestBookingInMinutes | type: integer | description: Maximum number of minutes before the start of the session that a booking can be made. This value must be greater than `latest_booking_in_minutes` in the `LimitLateBookingPolicy` policy. Default: 10080 minutes (7 days) Min: 1 minute - name: limitLateBookingPolicy | type: LimitLateBookingPolicy | description: Policy for limiting late bookings. - name: enabled | type: boolean | description: Whether there is a limit on how late a customer can book. When `false`, there is no limit on the latest booking time and customers can book up to the last minute. Default: `false` - name: latestBookingInMinutes | type: integer | description: Minimum number of minutes before the start of the session that a booking can be made. For a schedule, this is relative to the start time of the next booked session, excluding past-booked sessions. This value must be less than `earliest_booking_in_minutes` in the `LimitEarlyBookingPolicy` policy. Default: 1440 minutes (1 day) Min: 1 minute - name: bookAfterStartPolicy | type: BookAfterStartPolicy | description: Policy on booking an entity after the start of the schedule. - name: enabled | type: boolean | description: Whether booking is allowed after the start of the schedule. When `true`, customers can book after the start of the schedule. Default: `false` - name: cancellationPolicy | type: CancellationPolicy | description: Policy for canceling a booked entity. - name: enabled | type: boolean | description: Whether canceling a booking is allowed. When `true`, customers can cancel the booking. Default: `false` - name: limitLatestCancellation | type: boolean | description: Whether there is a limit on the latest cancellation time. When `true`, a time limit is enforced. Default: `false` - name: latestCancellationInMinutes | type: integer | description: Minimum number of minutes before the start of the booked session that the booking can be canceled. Default: 1440 minutes (1 day) Min: 1 minute - name: allowAnonymous | type: boolean | description: Whether this cancellation policy allows anonymous cancellations. **Important**: This flag only applies when `enabled` is `true`. If the cancellation policy itself is disabled (`enabled` = `false`), anonymous users cannot cancel regardless of this flag's value. When not set (null), defaults to disabled. Default: `null` (treated as disabled) - name: reschedulePolicy | type: ReschedulePolicy | description: Policy for rescheduling a booked entity. - name: enabled | type: boolean | description: Whether rescheduling a booking is allowed. When `true`, customers can reschedule the booking. Default: `false` - name: limitLatestReschedule | type: boolean | description: Whether there is a limit on the latest reschedule time. When `true`, a time limit is enforced. Default: `false` - name: latestRescheduleInMinutes | type: integer | description: Minimum number of minutes before the start of the booked session that the booking can be rescheduled. Default: 1440 minutes (1 day) Min: 1 minute - name: allowAnonymous | type: boolean | description: Whether this reschedule policy allows anonymous rescheduling. **Important**: This flag only applies when `enabled` is `true`. If the reschedule policy itself is disabled (`enabled` = `false`), anonymous users cannot reschedule regardless of this flag's value. When not set (null), defaults to disabled. Default: `null` (treated as disabled) - name: waitlistPolicy | type: WaitlistPolicy | description: Waitlist policy for the service. - name: enabled | type: boolean | description: Whether the session has a waitlist. If `true`, there is a waitlist. Default: `false` - name: capacity | type: integer | description: Number of spots available in the waitlist. Default: 10 spots Min: 1 spot - name: reservationTimeInMinutes | type: integer | description: Amount of time a participant is given to book, once notified that a spot is available. Default: 10 minutes Min: 1 spot - name: participantsPolicy | type: ParticipantsPolicy | description: Policy regarding the participants per booking. - name: maxParticipantsPerBooking | type: integer | description: Maximum number of participants allowed. Default: 1 participant Min: 1 participant - name: resourcesPolicy | type: ResourcesPolicy | description: Policy for allocating resources. - name: enabled | type: boolean | description: `true` if this policy is enabled, `false` otherwise. When `false` then the client must always select a resource when booking an appointment. - name: autoAssignAllowed | type: boolean | description: `true`, if it is allowed to automatically assign a resource when booking an appointment, `false`, if the client must always select a resource. Default: `false` - name: cancellationFeePolicy | type: CancellationFeePolicy | description: Rules for cancellation fees. - name: enabled | type: boolean | description: Whether canceling a booking will result in a cancellation fee Default: `false` - name: cancellationWindows | type: array | description: Cancellation windows describing the time of cancellation and the fee to charge. - ONE-OF: - name: amount | type: Money | description: Amount to be charged as a cancellation fee. - name: percentage | type: string | description: Percentage of the original price to be charged as a cancellation fee. - name: startInMinutes | type: integer | description: The fee will be applied if the booked session starts within this start time in minutes. - name: autoCollectFeeEnabled | type: boolean | description: Whether the cancellation fee should not be automatically collected when customer cancels the booking. Default: `true` - name: saveCreditCardPolicy | type: SaveCreditCardPolicy | description: Rule for saving credit card. - name: enabled | type: boolean | description: Default: `false` - name: schedule | type: Schedule | description: The service's [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/introduction.md), which can be used to manage the service's [events](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/introduction.md). - name: _id | type: string | description: GUID of the [schedule](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction.md) to which the service's events belong. - name: firstSessionStart | type: Date | description: Start time of the first session in the schedule. For courses only. - name: lastSessionEnd | type: Date | description: End time of the last session in the schedule. For courses only. - name: availabilityConstraints | type: AvailabilityConstraints | description: Limitations affecting the service availability. - name: durations | type: array | description: Calculated list of all supported session durations for the service. For appointment-based services without varied pricing based on session length, it matches the single value in the `sessionDurations` array. For appointment-based services with varied pricing based on session length, it includes session durations for all [variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md), while ignoring `sessionDurations`. For courses and classes, it includes durations for all future recurring sessions but excludes durations for one-off or past recurring sessions. - name: minutes | type: integer | description: The duration of the service in minutes. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: sessionDurations | type: array | description: List of supported session durations in minutes. - For appointment-based services, specify `sessionDurations` when creating a service. - For appointment-based services with varied pricing by session length, you must still specify `sessionDurations`, but the values are ignored. Actual durations are taken from the [service variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). - For classes or courses, don't specify `sessionDurations` when creating a service. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: timeBetweenSessions | type: integer | description: The number of minutes between the end of a session and the start of the next. Min: `0` minutes Max: `720` minutes - name: staffMemberIds | type: array | description: IDs of the [resources](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the [staff members](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md) providing the service. Note that these are the resource GUIDs, not the staff member GUIDs. For appointment-based services, set this field when creating or updating the service. For classes and courses, this field is read-only and is automatically derived from staff assigned to the service's recurring scheduled sessions. Staff assigned only to single, non-recurring events are not included. Once all of a staff member's upcoming recurring sessions have ended, their GUID is removed from this field. To retrieve the full list of staff for classes or courses, query the service's calendar events instead. Learn more about [retrieving staff for classes and courses](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/sample-flows.md#retrieve-staff-members-for-a-class-or-course). - name: staffMemberDetails | type: StaffMemberDetails | description: Staff members details. Returned only if `STAFF_MEMBER_DETAILS` conditional field was specified. - name: staffMembers | type: array | description: Staff members providing the service. For appointments only. - name: staffMemberId | type: string | description: GUID of the [resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the staff member providing the service. Despite the field name, this is the resource GUID, not the staff member GUID. This value matches the staff member's `resourceId` from the [Staff Members API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-members/introduction.md) and corresponds to the GUIDs in the service's `staffMemberIds` field. - name: name | type: string | description: Name of the staff member - name: mainMedia | type: StaffMediaItem | description: Main media associated with the service. - ONE-OF: - name: image | type: string | description: Details of the image associated with the staff, such as URL and size. - name: serviceResources | type: array | description: Information about which resources must be available so customers can book the service. For example, a meeting room or equipment. Some nested fields are only returned when specific conditional fields are requested: pass `RESOURCE_TYPE_DETAILS` to retrieve `resourceType.name`, and `RESOURCE_DETAILS` to retrieve `resourceDetails.resources`. - name: resourceType | type: ResourceType | description: Details about the required [resource type](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md). - name: _id | type: string | description: The type of the resource. - name: name | type: string | description: The name of the resource type. - name: supportedSlugs | type: array | description: A slug is the last part of the URL address that serves as a unique identifier of the service. The list of supported slugs includes past service names for backwards compatibility, and a custom slug if one was set by the business owner. - name: name | type: string | description: The unique part of service's URL that identifies the service's information page. For example, `service-1` in `https:/example.com/services/service-1`. - name: custom | type: boolean | description: Whether the slug was generated or customized. If `true`, the slug was customized manually by the business owner. Otherwise, the slug was automatically generated from the service name. - name: _createdDate | type: Date | description: Date and time the slug was created. This is a system field. - name: mainSlug | type: Slug | description: Active slug for the service. Learn more about [service slugs](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-slugs.md). - name: urls | type: URLs | description: URLs to various service-related pages, such as the calendar page and the booking page. - name: servicePage | type: string | description: The URL for the service page. - name: bookingPage | type: string | description: The URL for the booking entry point. It can be either to the calendar or to the service page. - name: calendarPage | type: string | description: The URL for the calendar. Can be empty if no calendar exists. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the service. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: seoData | type: SeoSchema | description: Custom SEO data for the service. - name: tags | type: array | description: SEO tag information. - name: type | type: string | description: SEO tag type. Supported values: `title`, `meta`, `script`, `link`. - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`. - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`. - name: children | type: string | description: SEO tag inner content. For example, ` inner content `. - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. - name: settings | type: Settings | description: SEO general settings. - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled. Default: `false` (automatical redirect is enabled). - name: keywords | type: array | description: User-selected keyword terms for a specific page. - name: term | type: string | description: Keyword value. - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword. - name: origin | type: string | description: The source that added the keyword terms to the SEO settings. - name: _createdDate | type: Date | description: Date and time the service was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: _updatedDate | type: Date | description: Date and time the service was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: revision | type: string | description: Revision number, which increments by 1 each time the service is updated. To prevent conflicting changes, the existing revision must be used when updating a service. - name: addOnGroups | type: array | description: Information about the [add-on groups](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/about-add-on-groups.md) associated with the service. - name: _id | type: string | description: GUID of the add-on group. Wix Bookings automatically populates this field when creating or updating an add-on group. - name: name | type: string | description: Name of the add-on group. - name: maxNumberOfAddOns | type: integer | description: Maximum number of different [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) from the group customers can add when booking the service. When empty, there's no upper limit. - name: addOnIds | type: array | description: List of GUIDs of all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) included in the group. - name: prompt | type: string | description: Description or instructional prompt of the add-on group that's displayed to customers when booking the service. - name: addOnDetails | type: array | description: Details about all [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) customers can choose when booking the service. - name: addOnId | type: string | description: GUID of the add-on. - name: durationInMinutes | type: integer | description: Duration in minutes for add-ons that extend service time. Empty for [quantity-based add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md#terminology). - name: taxableAddress | type: TaxableAddress | description: Taxable address used to calculate tax - name: taxableAddressType | type: TaxableAddressType | description: Taxable address type. - enum: BUSINESS, BILLING Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SESSION_DURATION | Description: Appointment-based services require at least 1 session duration in `schedule.availabilityConstraints.sessionDurations`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_APPOINTMENT_CAPACITY | Description: Appointment-based services can only have a `defaultCapacity` of `1`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_DEFAULT_CAPACITY | Description: Service `defaultCapacity` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_MANUAL_APPROVAL_WITH_PRICING_PLANS | Description: Services that require manual approval can't be paid using pricing plans. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_UNKNOWN_LOCATION | Description: Location must have a valid `type` property. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CUSTOMER_LOCATION | Description: Locations with `type` set to `CUSTOMER` can only be set on appointment-based services. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CUSTOM_LOCATION | Description: Locations with `type` set to `CUSTOM` can only have custom location options. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BUSINESS_LOCATION | Description: Locations with `type` set to `BUSINESS` can only have business location options. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_LOCATIONS | Description: Service `locations` are invalid. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BUSINESS_LOCATIONS | Description: Some of the specified business location GUIDs don't exist. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_PAYMENT_OPTIONS | Description: Service `payment.options` are invalid. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_RATE | Description: Service `payment.rate` is invalid. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_PAYMENT_TYPE | Description: Service `payment.rateType` must be set to `FIXED`, `VARIED`, `CUSTOM`, or `NO_FEE`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PAYMENT_REQUIRED | Description: Service `payment` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_STAFF_MEMBER_IDS | Description: Appointment-based services require at least 1 resource GUID associated with a staff member in `staffMemberIds`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ONLINE_BOOKING | Description: Service `onlineBooking` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SERVICE_NAME | Description: Service `name` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_SERVICE_TYPE | Description: Service `type` is required. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_BOOKING_POLICY | Description: Couldn't find the booking policy. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CATEGORY | Description: Couldn't find the category. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FORM | Description: Couldn't find the form. ``` ### Examples ### Update a service with a partial update (with elevated permissions) Update a service given only the fields that need to be updated. For example, update only the service name. ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; /* * Sample serviceId value: 'ff61204b-b19a-5cc8-823b-7eed8ae5fc28' * Sample serviceName value: 'Cat Hugging Training - Advanced' * Sample serviceRevision value: 1 */ const elevatedUpdateService = auth.elevate(services.updateService); async function updateServiceName(serviceId, serviceName, serviceRevision) { const updatedService = await elevatedUpdateService(serviceId, { name: serviceName, revision: serviceRevision }); console.log('Success! Updated the service name:', updatedService, serviceName); return updatedService; } /* Promise resolves to: * { "type": "CLASS", "sortOrder": 0, "name": "Cat Hugging Training - Advanced", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "8bf39bc0-a05a-49ff-9ee3-fc29d698988d" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, { "name": "cat-hugging-training-1", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://www.example.com/services-v2-test/service-page/cat-hugging-training-advanced", "bookingPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced", "calendarPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced" }, "revision": "2", "_id": "a262b133-e7a1-4498-a722-8340ed3f3db3", "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)", "_updatedDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" } */ ``` ### Update a service with a partial update Update a service given only the fields that need to be updated. For example, update only the service name. ```javascript import { services } from '@wix/bookings'; /* * Sample serviceId value: 'ff61204b-b19a-5cc8-823b-7eed8ae5fc28' * Sample serviceName value: 'Cat Hugging Training - Advanced' * Sample serviceRevision value: 1 */ async function updateServiceName(serviceId, serviceName, serviceRevision) { const updatedService = await services.updateService(serviceId, { name: serviceName, revision: serviceRevision }); console.log('Success! Updated the service name:', updatedService, serviceName); return updatedService; } /* Promise resolves to: * { "type": "CLASS", "sortOrder": 0, "name": "Cat Hugging Training - Advanced", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "8bf39bc0-a05a-49ff-9ee3-fc29d698988d" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, { "name": "cat-hugging-training-1", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://www.example.com/services-v2-test/service-page/cat-hugging-training-advanced", "bookingPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced", "calendarPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced" }, "revision": "2", "_id": "a262b133-e7a1-4498-a722-8340ed3f3db3", "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)", "_updatedDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" } */ ``` ### Update a service with a full update (with elevated permissions) Update a service given the entire service, with the changes applied. ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; const elevatedUpdateService = auth.elevate(services.updateService); async function updateService() { const serviceToBeCreated = { type: services.ServiceType.APPOINTMENT, name: "Cat Hugging Training", description: "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", tagLine: "Get some purr therapy training with our cat hugging experts", defaultCapacity: 30, payment: { rateType: services.RateType.FIXED, fixed: { price: { value: "150", currency: "USD" } }, options: { online: true, inPerson: false, deposit: false, pricingPlan: false }, }, onlineBooking: { enabled: true }, } const newName = "Cat Hugging Training - Advanced"; const createdService = await services.createService(serviceToBeCreated); const updatedService = await elevatedUpdateService(createdService._id, {...createdService, name: newName}); console.log('Success! Updated a service:', updatedService); return updatedService; } /* Promise resolves to: * { "type": "CLASS", "sortOrder": 0, "name": "Cat Hugging Training - Advanced", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "8bf39bc0-a05a-49ff-9ee3-fc29d698988d" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, { "name": "cat-hugging-training-1", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://www.example.com/services-v2-test/service-page/cat-hugging-training-advanced", "bookingPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced", "calendarPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced" }, "revision": "2", "_id": "a262b133-e7a1-4498-a722-8340ed3f3db3", "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)", "_updatedDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" } */ ``` ### Update a service with a full update Update a service given the entire service, with the changes applied. ```javascript import { services } from '@wix/bookings'; async function updateService() { const serviceToBeCreated = { type: services.ServiceType.APPOINTMENT, name: "Cat Hugging Training", description: "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", tagLine: "Get some purr therapy training with our cat hugging experts", defaultCapacity: 30, payment: { rateType: services.RateType.FIXED, fixed: { price: { value: "150", currency: "USD" } }, options: { online: true, inPerson: false, deposit: false, pricingPlan: false }, }, onlineBooking: { enabled: true }, } const newName = "Cat Hugging Training - Advanced"; const createdService = await services.createService(serviceToBeCreated); const updatedService = await services.updateService(createdService._id, {...createdService, name: newName}); console.log('Success! Updated a service:', updatedService); return updatedService; } /* Promise resolves to: * { "type": "CLASS", "sortOrder": 0, "name": "Cat Hugging Training - Advanced", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "8bf39bc0-a05a-49ff-9ee3-fc29d698988d" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, { "name": "cat-hugging-training-1", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training-advanced", "custom": false, "_createdDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://www.example.com/services-v2-test/service-page/cat-hugging-training-advanced", "bookingPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced", "calendarPage": "https://www.example.com/services-v2-test/booking-calendar/cat-hugging-training-advanced" }, "revision": "2", "_id": "a262b133-e7a1-4498-a722-8340ed3f3db3", "_createdDate": "Wed Jan 17 2024 09:37:27 GMT+0100 (Central European Standard Time)", "_updatedDate": "Wed Jan 17 2024 09:37:28 GMT+0100 (Central European Standard Time)" } */ ``` ### updateService (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { services } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { services }, // Include the auth strategy and host as relevant }); async function updateService(_id,service) { const response = await myWixClient.services.updateService(_id,service); }; ``` ---