deleteService( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a service.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Bookings
Manage Bookings - all permissions
Learn more about app permissions.
Method Declaration
Copy
function deleteService(
  serviceId: string,
  options: DeleteServiceOptions,
): Promise<void>;
Method Parameters
serviceIdstringRequired

ID of the service to delete.


optionsDeleteServiceOptions

Allows you to configure how to handle the deleted service's future sessions and how to notify the sessions participants.

Delete a service @description:
JavaScript
import { services } from "wix-bookings.v2"; /* * 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 */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?