> 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 # DeleteService # Package: services # Namespace: ServicesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/delete-service.md ## Permission Scopes: Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS ## Introduction Deletes a service. Specify `{"preserveFutureSessionsWithParticipants": true}` to retain all future sessions for the service. By default, all future sessions are canceled. --- ## REST API ### Schema ``` Method: deleteService Description: Deletes a service. Specify `{"preserveFutureSessionsWithParticipants": true}` to retain all future sessions for the service. By default, all future sessions are canceled. URL: https://www.wixapis.com/_api/bookings/v2/services/{serviceId} Method: DELETE # 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: participantNotification | type: ParticipantNotification - name: notifyParticipants | type: boolean | description: Whether to send a message about the changes to the customer. Default: `false` - name: message | type: string | description: Custom message to send to the participants about the changes to the booking. query param name: preserveFutureSessionsWithParticipants | type: preserveFutureSessionsWithParticipants | description: Whether to preserve future sessions with participants. Default: `false` param name: serviceId | type: none | required: true Return type: DeleteServiceResponse EMPTY-OBJECT {} ``` ### Examples ### Delete a service ```curl curl -X DELETE 'https://www.wixapis.com/bookings/v2/services/d779a301-398d-4552-aa8c-3bef0b65cedb' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.ServicesService.deleteService(serviceId, options) Description: Deletes a service. Specify `{"preserveFutureSessionsWithParticipants": true}` to retain all future sessions for the service. By default, all future sessions are canceled. # 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: DeleteServiceOptions none - name: preserveFutureSessionsWithParticipants | type: boolean | description: Whether to preserve future sessions with participants. Default: `false` - name: participantNotification | type: ParticipantNotification | description: Whether to notify participants about the change and an optional custom message. - name: notifyParticipants | type: boolean | description: Whether to send a message about the changes to the customer. Default: `false` - name: message | type: string | description: Custom message to send to the participants about the changes to the booking. param name: serviceId | type: string | description: GUID of the service to delete. | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### Delete a service (with elevated permissions) ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; /* * Sample serviceID value: 'ff61204b-b19a-5cc8-823b-7eed8ae5fc28' */ const elevatedDeleteService = auth.elevate(services.deleteService); async function deleteService(serviceID) { await elevatedDeleteService(serviceID); console.log('Deleted the service'); } /* Promise resolves to void */ ``` ### Delete a service ```javascript import { services } from '@wix/bookings'; /* * Sample serviceID value: 'ff61204b-b19a-5cc8-823b-7eed8ae5fc28' */ async function deleteService(serviceID) { await services.deleteService(serviceID); console.log('Deleted the service'); } /* Promise resolves to void */ ``` ### deleteService (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 deleteService(serviceId,options) { const response = await myWixClient.services.deleteService(serviceId,options); }; ``` ---