> 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 # UpdateAddOnGroup # Package: services # Namespace: AddOnGroupsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/update-add-on-group.md ## Permission Scopes: Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS ## Introduction Updates an add-on group. To update only the display order for add-ons, call [Set Add Ons For Group](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/set-add-ons-for-group.md) instead. You can't change which service an add-on group belongs to. Each add-on group is permanently associated with the service it was created for. To use the same add-ons with a different service, create a new add-on group for that service. --- ## REST API ### Schema ``` Method: updateAddOnGroup Description: Updates an add-on group. To update only the display order for add-ons, call [Set Add Ons For Group](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/set-add-ons-for-group.md) instead. You can't change which service an add-on group belongs to. Each add-on group is permanently associated with the service it was created for. To use the same add-ons with a different service, create a new add-on group for that service. URL: https://www.wixapis.com/_api/bookings/v2/services/add-on-groups/update Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: addOnGroup, addOnGroup.id, serviceId Method parameters: param name: addOnGroup | type: AddOnGroup | required: true - 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. | required: true - 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. param name: serviceId | type: serviceId | description: GUID of the service that contains the add-on group. | required: true Return type: UpdateAddOnGroupResponse - name: addOnGroup | type: AddOnGroup | description: Updated add-on group. - 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. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: GROUP_NOT_ON_SERVICE | Description: none ``` ### Examples ### Update an add-on group ```curl curl -X POST 'https://www.wixapis.com/bookings/v2/services/add-on-groups/update' \ -H 'Authorization: ' \ -d '{ "addOnGroup": { "id": "f8e7d6c5-b4a3-9281-7605-948372615038", "name": "Premium Spa Treatments", "maxNumberOfAddOns": 3, "prompt": "Select up to 3 luxurious spa treatments for the ultimate relaxation" }, "serviceId": "d779a301-398d-4552-aa8c-3bef0b65cedb", "mask": { "paths": ["name", "maxNumberOfAddOns", "prompt"] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.AddOnGroupsService.updateAddOnGroup(addOnGroup, options) Description: Updates an add-on group. To update only the display order for add-ons, call [Set Add Ons For Group](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/set-add-ons-for-group.md) instead. You can't change which service an add-on group belongs to. Each add-on group is permanently associated with the service it was created for. To use the same add-ons with a different service, create a new add-on group for that service. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: addOnGroup, addOnGroup._id, options.serviceId, options Method parameters: param name: addOnGroup | type: AddOnGroup | required: true - 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. | required: true - 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. param name: options | type: UpdateAddOnGroupOptions none | required: true - name: serviceId | type: string | description: GUID of the service that contains the add-on group. | required: true Return type: PROMISE - name: addOnGroup | type: AddOnGroup | description: Updated add-on group. - 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. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: GROUP_NOT_ON_SERVICE | Description: none ``` ### Examples ### updateAddOnGroup ```javascript import { services } from '@wix/bookings'; async function updateAddOnGroup(addOnGroup,options) { const response = await services.updateAddOnGroup(addOnGroup,options); }; ``` ### updateAddOnGroup (with elevated permissions) ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myUpdateAddOnGroupMethod(addOnGroup,options) { const elevatedUpdateAddOnGroup = auth.elevate(services.updateAddOnGroup); const response = await elevatedUpdateAddOnGroup(addOnGroup,options); } ``` ### updateAddOnGroup (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 updateAddOnGroup(addOnGroup,options) { const response = await myWixClient.services.updateAddOnGroup(addOnGroup,options); }; ``` ---