POST

Set Default Booking Policy


Sets a booking policy as the default.

Also updates the site's current default policy by setting its default attribute to false. If the provided policy is already the site's default, the call succeeds without changing any bookingPolicy object.

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/booking-policies/{bookingPolicyId}:setDefault

Path Params
bookingPolicyIdstringRequired

ID of the booking policy that's set as default.

Response Object
currentDefaultBookingPolicyCurrentDefaultBookingPolicy

New default booking policy.


previousDefaultBookingPolicyPreviousDefaultBookingPolicy

Previous default booking policy. Not available if the provided booking policy was already the default.

Update a `bookingPolicy` to become the default policy, while updating the previous default BookingPolicy to be no longer the default
Request
cURL
curl -X POST \ 'https://wixapis.com/bookings/v1/booking-policies/1a426c47-0c86-46c7-8573-c7bce734f660:setDefault' \ -H 'Authorization: <AUTH>' \
Response
JSON
{ "currentDefaultBookingPolicy": { "id": "1a426c47-0c86-46c7-8573-c7bce734f660", "revision": "3", "createdDate": "2023-02-16T10:46:17.420Z", "updatedDate": "2023-02-17T15:38:10.288Z", "name": "Appointment Policy", "customPolicyDescription": { "enabled": true, "description": "To cancel, please contact us at least 48 hours in advance" }, "default": true, "limitEarlyBookingPolicy": { "enabled": true, "earliestBookingInMinutes": 43200 }, "limitLateBookingPolicy": { "enabled": true, "latestBookingInMinutes": 180 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": true, "latestCancellationInMinutes": 2880 }, "reschedulePolicy": { "enabled": false, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": true, "capacity": 5, "reservationTimeInMinutes": 30 }, "participantsPolicy": { "enabled": false, "maxParticipantsPerBooking": 1 } }, "previousDefaultBookingPolicy": { "id": "caa894dc-e84e-4498-aef3-76610c5cd95c", "revision": "7", "createdDate": "2023-01-13T15:00:41.492Z", "updatedDate": "2023-02-17T15:38:10.287Z", "name": "Default policy", "customPolicyDescription": { "enabled": false, "description": "" }, "default": false, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "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 } } }
Errors

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

Did this help?