POST

Clone Service Options And Variants


Clones a serviceOptionsAndVariants object and connects it to a service (SDK | REST).

The call fails if the service already has a connected serviceOptionsAndVariants object.

The cloned serviceOptionsAndVariants object gets a new, unique option ID. The option ID of the existing serviceOptionsAndVariants object isn't reused.

For example, you may call this method after cloning a service (SDK | REST).

Authentication

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

Permissions
Manage Bookings Services and Settings
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/bookings/v1/serviceOptionsAndVariants/{cloneFromId}/clone

Path Params
cloneFromIdstringRequired

ID of the serviceOptionsAndVariants object to clone.

Body Params
targetServiceIdstringRequiredformat GUID

ID of the service to which the cloned serviceOptionsAndVariants are connected.

Response Object
serviceOptionsAndVariantsServiceOptionsAndVariants

Cloned serviceOptionsAndVariants object.

Clone options and variants for a service
Request
cURL
curl -X POST \ 'https://wixapis.com/bookings/v1/serviceOptionsAndVariants/0cf0c708-58f0-408b-a10f-a6d9b6e2a6de/clone' \ -H 'Authorization: <AUTH>' \ -d '{ "targetServiceId": "cea2bc29-9f05-4523-a4d7-cd52983b43dc" }'
Response
JSON
{ "serviceOptionsAndVariants": { "id": "6f6a0b65-dd9f-497f-8e29-88518b6aed26", "serviceId": "cea2bc29-9f05-4523-a4d7-cd52983b43dc", "options": { "values": [ { "id": "e60a6e55-bd30-4610-8d7e-dfa8ecd2293a", "type": "STAFF_MEMBER" } ] }, "variants": { "values": [ { "choices": [ { "optionId": "e60a6e55-bd30-4610-8d7e-dfa8ecd2293a", "staffMemberId": "5a79026c-36f9-4839-ad4a-9a3132af5895" } ], "price": { "value": "55", "currency": "EUR" } }, { "choices": [ { "optionId": "e60a6e55-bd30-4610-8d7e-dfa8ecd2293a", "staffMemberId": "963c5a66-e4be-490c-9e79-556c9a4d8807" } ], "price": { "value": "105", "currency": "EUR" } }, { "choices": [ { "optionId": "e60a6e55-bd30-4610-8d7e-dfa8ecd2293a", "staffMemberId": "59581285-876b-4581-8f4c-cf90452d94e9" } ], "price": { "value": "50", "currency": "EUR" } }, { "choices": [ { "optionId": "e60a6e55-bd30-4610-8d7e-dfa8ecd2293a", "staffMemberId": "9a3d4d6c-0ff9-4671-9fad-0aa2cbcd8b0f" } ], "price": { "value": "60", "currency": "EUR" } } ] }, "minPrice": { "value": "50", "currency": "EUR" }, "maxPrice": { "value": "105", "currency": "EUR" }, "revision": "1" } }
Errors

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

Event TriggersThis method triggers the following events:
Did this help?