cloneService( )


Clones a service.

Connected entities

By default, not all entities connected to the service are cloned.

Schedule

Wix Bookings automatically creates a new active schedule (SDK | REST) for the cloned service. If Wix Bookings can't create this schedule, the Clone Service* call fails.

  • For appointment-based services: Future appointments aren't added to the cloned service's schedule. Use the Events API (SDK | REST) to add them as needed.
  • For classes and courses: Future one-time events aren't added to the cloned service's schedule, while future recurring events are added asynchronously. The Clone Service call always succeeds, whether or not recurring events are added. If the response includes RECURRING_EVENTS in the errors array, it means the cloned service doesn't have future recurring events, even though the original service does. You can either delete the cloned service and try again or use the Events API (SDK | REST) to add missing events to the schedule.

Wix Bookings never adds past events to the cloned service's schedule.

Service options and variants

If the original service has variants (SDK | REST), they're cloned asynchronously. The Clone Service call always succeeds, regardless of whether variants were cloned.

If the response includes OPTIONS_AND_VARIANTS in the errors array, the cloned service doesn't have variants, even though the original service does. You can delete the cloned service and call Clone Service again, or use the Service Options And Variants API* (SDK | REST) to add variants.

Booking form

The original service's booking form isn't cloned, whether it's the default or a custom booking form.

Pricing plans

If the original service's accepts payments via pricing plans (SDK | REST), the cloned service's payment.options.pricingPlan is also set to true. To accept specific pricing plans, call Enable Pricing Plans For Service (SDK | REST), after cloning the service. If the original service accepts only pricing plan payments and you don't call Enable Pricing Plans For Service after cloning the service, customers will be unable to book the service.

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 cloneService(sourceServiceId: string): Promise<CloneServiceResponse>;
Method Parameters
sourceServiceIdstringRequired

ID of the service to clone.

Returns
Return Type:Promise<CloneServiceResponse>
JavaScript
import { services } from "@wix/bookings"; async function cloneService(sourceServiceId) { const response = await services.cloneService(sourceServiceId); }
Errors

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

Did this help?