> 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 # ListAddOnGroupsByServiceId # Package: services # Namespace: AddOnGroupsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/list-add-on-groups-by-service-id.md ## Permission Scopes: Read Bookings - Public Data: SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC ## Introduction Retrieves add-on groups for a service with enriched add-on details. Add-on details are returned based on their display order. If you specify `groupIds`, only those groups are returned. By default, all groups associated with the service are returned. --- ## REST API ### Schema ``` Method: listAddOnGroupsByServiceId Description: Retrieves add-on groups for a service with enriched add-on details. Add-on details are returned based on their display order. If you specify `groupIds`, only those groups are returned. By default, all groups associated with the service are returned. URL: https://www.wixapis.com/_api/bookings/v2/services/add-on-groups/list-add-on-groups-by-service-id Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: serviceId Method parameters: param name: groupIds | type: array | description: List of group GUIDs to return. By default, all groups are returned. param name: serviceId | type: serviceId | description: GUID of the service to retrieve add-on groups for. | required: true Return type: ListAddOnGroupsByServiceIdResponse - name: addOnGroupsDetails | type: array | description: List of group details with their linked add-ons. - name: groupId | type: string | description: Group GUID. - name: maxNumberOfAddOns | type: integer | description: Maximum number of add-ons customers can select from this group. - name: groupName | type: string | description: Group name displayed to customers. - name: addOns | type: array | description: Add-ons linked to this group in display order. - ONE-OF: - name: durationInMinutes | type: integer | description: Duration in minutes for duration-based add-ons that extend booking service time. - name: maxQuantity | type: integer | description: Maximum quantity customers can purchase for quantity-based add-ons. - name: addOnId | type: string | description: Add-on GUID. - name: name | type: string | description: Add-on name displayed to customers. - name: price | type: Money | description: Add-on price. - 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: nameTranslated | type: string | description: Translated add-on name. - name: prompt | type: string | description: Instructional prompt displayed to customers. For example, `Choose up to 2 relaxing spa treatments to enhance your experience`. You can also use this field as a group description. For example, `Beginner-friendly rental equipment`. - name: groupNameTranslated | type: string | description: Translated group name. - name: promptTranslated | type: string | description: Instructional translated prompt displayed to customers. For example, `Choose up to 2 relaxing spa treatments to enhance your experience`. You can also use this field as a group description. For example, `Beginner-friendly rental equipment`. ``` ### Examples ### List add-on groups by service ID ```curl curl -X POST 'https://www.wixapis.com/bookings/v2/services/add-on-groups/list-add-on-groups-by-service-id' \ -H 'Authorization: ' \ -d '{ "serviceId": "d779a301-398d-4552-aa8c-3bef0b65cedb" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.AddOnGroupsService.listAddOnGroupsByServiceId(serviceId, options) Description: Retrieves add-on groups for a service with enriched add-on details. Add-on details are returned based on their display order. If you specify `groupIds`, only those groups are returned. By default, all groups associated with the service are returned. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: serviceId Method parameters: param name: options | type: ListAddOnGroupsByServiceIdOptions none - name: groupIds | type: array | description: List of group GUIDs to return. By default, all groups are returned. param name: serviceId | type: string | description: GUID of the service to retrieve add-on groups for. | required: true Return type: PROMISE - name: addOnGroupsDetails | type: array | description: List of group details with their linked add-ons. - name: groupId | type: string | description: Group GUID. - name: maxNumberOfAddOns | type: integer | description: Maximum number of add-ons customers can select from this group. - name: groupName | type: string | description: Group name displayed to customers. - name: addOns | type: array | description: Add-ons linked to this group in display order. - ONE-OF: - name: durationInMinutes | type: integer | description: Duration in minutes for duration-based add-ons that extend booking service time. - name: maxQuantity | type: integer | description: Maximum quantity customers can purchase for quantity-based add-ons. - name: addOnId | type: string | description: Add-on GUID. - name: name | type: string | description: Add-on name displayed to customers. - name: price | type: Money | description: Add-on price. - 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: nameTranslated | type: string | description: Translated add-on name. - name: prompt | type: string | description: Instructional prompt displayed to customers. For example, `Choose up to 2 relaxing spa treatments to enhance your experience`. You can also use this field as a group description. For example, `Beginner-friendly rental equipment`. - name: groupNameTranslated | type: string | description: Translated group name. - name: promptTranslated | type: string | description: Instructional translated prompt displayed to customers. For example, `Choose up to 2 relaxing spa treatments to enhance your experience`. You can also use this field as a group description. For example, `Beginner-friendly rental equipment`. ``` ### Examples ### listAddOnGroupsByServiceId ```javascript import { services } from '@wix/bookings'; async function listAddOnGroupsByServiceId(serviceId,options) { const response = await services.listAddOnGroupsByServiceId(serviceId,options); }; ``` ### listAddOnGroupsByServiceId (with elevated permissions) ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myListAddOnGroupsByServiceIdMethod(serviceId,options) { const elevatedListAddOnGroupsByServiceId = auth.elevate(services.listAddOnGroupsByServiceId); const response = await elevatedListAddOnGroupsByServiceId(serviceId,options); } ``` ### listAddOnGroupsByServiceId (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 listAddOnGroupsByServiceId(serviceId,options) { const response = await myWixClient.services.listAddOnGroupsByServiceId(serviceId,options); }; ``` ---