> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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.  | validation: maxLength 2000
   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: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.bookings.services.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: serviceId | type: string | description: GUID of the service to delete. | required: true | validation: format GUID
   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.  | validation: maxLength 2000
 Return type: PROMISE<DeleteServiceResponse>
  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-managed)
Self-managed 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);
};
```

---