validateSlug( )


Checks whether a custom slug is validate for the service.

The checks include:

  • The slug adheres to the supported format.
  • No other service is currently using the slug.
  • No other service has used the slug in the past.

The call fails if at least one of the checks fails.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

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

IO of the service to check custom slug validity for.


optionsValidateSlugOptions
Returns
Return Type:Promise<ValidateSlugResponse>
JavaScript
import { services } from "@wix/bookings"; async function validateSlug(serviceId, options) { const response = await services.validateSlug(serviceId, options); }
Errors

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

Did this help?