> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # DeleteBookingPolicy # Package: policies # Namespace: BookingPoliciesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/delete-booking-policy.md ## Permission Scopes: Manage Bookings Services and Settings: SCOPE.BOOKINGS.CONFIGURATION ## Introduction Deletes a booking policy. You can't delete the default policy without first [setting a different policy as default](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/set-default-booking-policy.md). --- ## REST API ### Schema ``` Method: deleteBookingPolicy Description: Deletes a booking policy. You can't delete the default policy without first [setting a different policy as default](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/set-default-booking-policy.md). URL: https://www.wixapis.com/bookings/v1/booking-policies/{bookingPolicyId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: bookingPolicyId Method parameters: param name: bookingPolicyId | type: none | required: true Return type: DeleteBookingPolicyResponse EMPTY-OBJECT {} Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: DEFAULT_POLICY_CANNOT_BE_DELETED | Description: The default booking policy can't be deleted. Set a different policy as the default before deleting this one. ``` ### Examples ### Delete a `bookingPolicy` object. ```curl curl -X DELETE \ 'https://wixapis.com/bookings/v1/booking-policies/6806bf45-1d65-4983-a607-6cd277ec732a' \ -H 'Authorization: ' \ -d '{ "revision": "2" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.policies.BookingPoliciesService.deleteBookingPolicy(bookingPolicyId) Description: Deletes a booking policy. You can't delete the default policy without first [setting a different policy as default](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/set-default-booking-policy.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: bookingPolicyId Method parameters: param name: bookingPolicyId | type: string | description: GUID of the booking policy to delete. | required: true Return type: PROMISE EMPTY-OBJECT {} Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: DEFAULT_POLICY_CANNOT_BE_DELETED | Description: The default booking policy can't be deleted. Set a different policy as the default before deleting this one. ``` ### Examples ### deleteBookingPolicy ```javascript import { bookingPolicies } from '@wix/bookings'; async function deleteBookingPolicy(bookingPolicyId) { const response = await bookingPolicies.deleteBookingPolicy(bookingPolicyId); }; ``` ### deleteBookingPolicy (with elevated permissions) ```javascript import { bookingPolicies } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myDeleteBookingPolicyMethod(bookingPolicyId) { const elevatedDeleteBookingPolicy = auth.elevate(bookingPolicies.deleteBookingPolicy); const response = await elevatedDeleteBookingPolicy(bookingPolicyId); } ``` ### deleteBookingPolicy (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { bookingPolicies } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { bookingPolicies }, // Include the auth strategy and host as relevant }); async function deleteBookingPolicy(bookingPolicyId) { const response = await myWixClient.bookingPolicies.deleteBookingPolicy(bookingPolicyId); }; ``` ---