POST

Set Custom Slug


Sets a new active slug for the service.

The call fails if at least one of these conditions is met:

  • The slug doesn't adheres to the supported format.
  • Another service is currently using the slug.
  • Another service has used the slug in the past.
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.
Endpoint
POST
https://www.wixapis.com/_api/bookings/v2/services/{serviceId}/slugs/custom

Path Params
serviceIdstringRequired

ID of the service for which to update the active slug.

Body Params
slugstringmaxLength 500

Slug to set as the active service slug.

Response Object
slugSlug

Updated active service slug.


serviceService

Updated service.

Set a custom slug for a service.
Request
cURL
curl -X POST 'https://www.wixapis.com/bookings/v2/services/d779a301-398d-4552-aa8c-3bef0b65cedb/slugs/custom' \ -H 'Authorization: <AUTH>' \ -d '{ "serviceId": "d779a301-398d-4552-aa8c-3bef0b65cedb", "slugName": "custom_slug" }'
Response
JSON
{ "slug": { "name": "custom_slug", "custom": true, "createdDate": "2023-07-20T07:57:40.325Z" }, "service": { "id": "d779a301-398d-4552-aa8c-3bef0b65cedb", "type": "APPOINTMENT", "sortOrder": 0, "name": "Group Cat Hugging", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy with our cat hugging service!", "defaultCapacity": 1, "media": { "items": [], "mainMedia": { "image": { "id": "fb5af50cdfee49a7b8d87f340c969e90.jpg", "height": 4000, "width": 6000 } } }, "hidden": false, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "25", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true, "requireManualApproval": false, "allowMultipleRequests": false }, "locations": [ { "type": "CUSTOMER" } ], "bookingPolicy": { "id": "2a8cbc1b-7968-44e7-899a-d1df1ecbeefe", "revision": "3", "createdDate": "2023-04-11T08:51:43.025Z", "updatedDate": "2023-05-19T11:32:27.930Z", "name": "Default policy", "customPolicyDescription": { "enabled": false, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 604800 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": false, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false } }, "schedule": { "id": "16e9e039-6437-4144-81a7-124ce6b369c4" }, "supportedSlugs": [ { "name": "custom_slug", "custom": true, "createdDate": "2023-07-20T07:57:40.325Z" }, { "name": "group-cat-hugging", "custom": false, "createdDate": "2023-07-20T07:57:40.325Z" }, { "name": "personal-cat-hugging", "custom": false, "createdDate": "2023-07-20T07:48:06.900Z" } ], "mainSlug": { "name": "custom_slug", "custom": true, "createdDate": "2023-07-20T07:57:40.325Z" }, "urls": { "servicePage": { "relativePath": "/service-page-statics/group-cat-hugging", "url": "https://example.com/services-2-test/service-page-statics/group-cat-hugging" }, "bookingPage": { "relativePath": "/booking-form/group-cat-hugging/book", "url": "https://example.com/services-2-test/booking-form/group-cat-hugging/book" }, "calendarPage": { "relativePath": "/booking-calendar-statics/group-cat-hugging", "url": "https://example.com/services-2-test/booking-calendar-statics/group-cat-hugging" } }, "createdDate": "2023-07-20T07:48:07.319Z", "updatedDate": "2023-07-20T07:57:40.325Z", "revision": "2", "staffMemberIds": ["76570209-101f-409b-af97-b445bdb63125"] } }
Errors
400Invalid Argument

There is 1 error with this status code.

428Failed Precondition

There is 1 error 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?