PATCH

Update Service Options And Variants


Updates a serviceOptionsAndVariants object.

Currently, only a single option is supported per serviceOptionsAndVariants object.

If you want to update variants, you must pass the entire list of supported variants, not only newly added variants.

If you want to update options, you must pass the entire list of supported options, not only newly added options.

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
PATCH
https://www.wixapis.com/bookings/v1/serviceOptionsAndVariants/{serviceOptionsAndVariants.id}

Path Params
serviceOptionsAndVariants.idstringRequired

ID of the serviceOptionsAndVariants object.

Body Params
serviceOptionsAndVariantsServiceOptionsAndVariantsRequired

ServiceOptionsAndVariants object to update.

Response Object
serviceOptionsAndVariantsServiceOptionsAndVariants

Updated serviceOptionsAndVariants object.

Request
cURL
curl -X PATCH \ 'https://wixapis.com/bookings/v1/serviceOptionsAndVariants/7e7eac53-21c9-41fd-844b-25b287aa38ce' \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ -d '{ "serviceOptionsAndVariants": { "serviceId": "6072fbad-5c95-4bf6-a9bc-4280aadc1ae8", "options": { "values": [ { "customData": { "choices": [ "Student", "Adult", "Child" ], "name": "Customer Type" }, "id": "0b78af72-0ba0-4e71-ba39-b4386555a353", "type": "CUSTOM" } ] }, "variants": { "values": [ { "choices": [ { "optionId": "0b78af72-0ba0-4e71-ba39-b4386555a353", "custom": "Student" } ], "price": { "value": "8", "currency": "EUR" } }, { "choices": [ { "optionId": "0b78af72-0ba0-4e71-ba39-b4386555a353", "custom": "Adult" } ], "price": { "value": "12", "currency": "EUR" } }, { "choices": [ { "optionId": "0b78af72-0ba0-4e71-ba39-b4386555a353", "custom": "Child" } ], "price": { "currency": "EUR", "value": "5" } } ] }, "revision": "1", "id": "7e7eac53-21c9-41fd-844b-25b287aa38ce" } }'
Response
JSON
{ "serviceOptionsAndVariants": { "id": "7e7eac53-21c9-41fd-844b-25b287aa38ce", "serviceId": "6072fbad-5c95-4bf6-a9bc-4280aadc1ae8", "options": { "values": [ { "id": "0b78af72-0ba0-4e71-ba39-b4386555a353", "type": "CUSTOM", "customData": { "name": "Customer Type", "choices": ["Student", "Adult", "Child"] } } ] }, "variants": { "values": [ { "choices": [ { "optionId": "0b78af72-0ba0-4e71-ba39-b4386555a353", "custom": "Student" } ], "price": { "value": "8", "currency": "EUR" } }, { "choices": [ { "optionId": "0b78af72-0ba0-4e71-ba39-b4386555a353", "custom": "Adult" } ], "price": { "value": "12", "currency": "EUR" } }, { "choices": [ { "optionId": "0b78af72-0ba0-4e71-ba39-b4386555a353", "custom": "Child" } ], "price": { "value": "5", "currency": "EUR" } } ] }, "minPrice": { "value": "5", "currency": "EUR" }, "maxPrice": { "value": "12", "currency": "EUR" }, "revision": "2" } }
Errors
400Invalid Argument

There are 8 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

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