> 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 # SetDefaultBookingPolicy # Package: policies # Namespace: BookingPoliciesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/set-default-booking-policy.md ## Permission Scopes: Manage Bookings Services and Settings: SCOPE.BOOKINGS.CONFIGURATION ## Introduction 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. --- ## REST API ### Schema ``` Method: setDefaultBookingPolicy Description: 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. URL: https://www.wixapis.com/bookings/v1/booking-policies/{bookingPolicyId}:setDefault Method: POST Return type: SetDefaultBookingPolicyResponse - name: currentDefaultBookingPolicy | type: BookingPolicy | description: New default booking policy. - name: id | type: string | description: GUID of the booking policy. - name: revision | type: string | description: Revision number, which increments by 1 each time the booking policy is updated. To prevent conflicting changes, the current `revision` must be passed when updating the booking policy. - name: createdDate | type: string | description: Date and time the booking policy was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: updatedDate | type: string | description: Date and time the booking policy was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: appId | type: string | description: GUID of the app associated with the booking policy. You can't update `appId`. Booking policies are displayed in Wix Bookings only if they are associated with the Wix Bookings app GUID or have no associated app GUID. Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app GUID) For booking policies from Wix apps, the following values apply: - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"` - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`. [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: createdByAppId | type: string | description: GUID of the app that created the booking policy. This field is used for analytics, auditing, and tracking creation sources. This read-only field is automatically populated during policy creation by checking these sources in order: 1. The caller's App GUID from the request identity context. 2. The policy's `appId` field. 3. The Wix Bookings App GUID (`13d21c63-b5ec-5912-8397-c3a5ddb27a97`) as the final fallback. - name: name | type: string | description: Name of the booking policy. - name: customPolicyDescription | type: PolicyDescription | description: Custom description for the booking policy and whether it's displayed to the participant. - name: enabled | type: boolean | description: Whether the description is displayed to the participant. `true` means the description is displayed. Default: `false` - name: description | type: string | description: Description of the booking policy. Default: Empty Max length: 2500 characters - name: default | type: boolean | description: Whether the booking policy is the default. - name: limitEarlyBookingPolicy | type: LimitEarlyBookingPolicy | description: Rule for limiting early bookings. - name: enabled | type: boolean | description: Whether there's a limit about how early a customer can book. `false` means there's no limit to the earliest supported booking time. Default: `false` - name: earliestBookingInMinutes | type: integer | description: Maximum number of minutes before the start of a session or course customers can book. Must be greater than `limitLateBookingPolicy.latestBookingInMinutes`. Default: `10080` minutes (7 days) Min: `1` minute - name: limitLateBookingPolicy | type: LimitLateBookingPolicy | description: Rule for limiting late bookings. This rule and `bookAfterStartPolicy` can't be both enabled at the same time. - name: enabled | type: boolean | description: Whether there's a limit about how late customers can book. `false` means customers can book up to the last minute. If specified as `true`, `bookAfterStartPolicy.enabled` must be `false`. Default: `false` - name: latestBookingInMinutes | type: integer | description: Minimum number of minutes before the start of the session customers can book. For courses, this is relative to the start time of the next session and doesn't consider course sessions in the past. This value must be less than `limitEarlyBookingPolicy.earliestBookingInMinutes`. Default: `1440` minutes (1 day) Min: `1` minute - name: bookAfterStartPolicy | type: BookAfterStartPolicy | description: Rule for booking after the start of a session or course. This rule and `limitLateBookingPolicy` can't be both enabled at the same time. - name: enabled | type: boolean | description: Whether customers can book after the session has started. `true` means customers can book after the session has started. For courses, this refers to the start of the last course session. If specified as `true`, `limitLateBookingPolicy.enabled` must be `false`. Default: `false` - name: cancellationPolicy | type: CancellationPolicy | description: Rule for canceling a booking. - name: enabled | type: boolean | description: Whether customers can cancel the booking. `true` means customers can cancel the booking. Default: `false` - name: limitLatestCancellation | type: boolean | description: Whether there's a limit on the latest cancellation time. `false` means customers can cancel the booking until the last minute before the course or session starts. Default: `false` - name: latestCancellationInMinutes | type: integer | description: Minimum number of minutes before the start of the session customers can cancel. For courses, this refers to the start of the first course session. Default: `1440` minutes (1 day) Min: `1` minute - name: allowAnonymous | type: boolean | description: Whether customers can cancel bookings anonymously using the [anonymous booking actions](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/introduction.md#anonymous-booking-actions). This field is ignored if `cancellationPolicy.enabled` is `false`. Default: `null` (treated as `false`) - name: reschedulePolicy | type: ReschedulePolicy | description: Rule for rescheduling a booking. - name: enabled | type: boolean | description: Whether customers can reschedule a booking for an appointment-based service. `true` means customers can reschedule. Default: `false` - name: limitLatestReschedule | type: boolean | description: Whether there's a limit on the latest supported rescheduling time. `false` means customers can reschedule until the last minute before the session start. Default: `false` - name: latestRescheduleInMinutes | type: integer | description: Minimum number of minutes before the session start session customers can reschedule their booking. Default: `1440` minutes (1 day) Min: `1` minute - name: allowAnonymous | type: boolean | description: Whether customers can reschedule bookings anonymously using the [anonymous booking actions](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/introduction.md#anonymous-booking-actions). This field is ignored if `reschedulePolicy.enabled` is `false`. Default: `null` (treated as `false`) - name: waitlistPolicy | type: WaitlistPolicy | description: Waitlist rule for the service. - name: enabled | type: boolean | description: Whether the service has a waitlist. `true` means there's a waitlist. Default: `false` - name: capacity | type: integer | description: Number of spots in the waitlist. Default: `10` spots Min: `1` spot - name: reservationTimeInMinutes | type: integer | description: Time in minutes the potential customer is given to book after they've been notified that a spot has opened up for them. If they don't respond in time, the open spot is offered to the next potential customer on the waitlist. Default: `10` minutes Min: `1` minute - name: participantsPolicy | type: ParticipantsPolicy | description: Rule for participants per booking. - name: maxParticipantsPerBooking | type: integer | description: Maximum number of participants per booking. Default: `1` participant Min: `1` participant - name: cancellationFeePolicy | type: CancellationFeePolicy | description: Rules for cancellation fees. - name: enabled | type: boolean | description: Whether customers must pay a cancellation fee when canceling a booking. Default: `false` - name: cancellationWindows | type: array | description: Time windows relative to the session start during which customers can cancel their booking. Each window includes details about the fee for canceling within it. - ONE-OF: - name: amount | type: Money | description: Fixed amount customers must pay when canceling the booking within this window. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: percentage | type: string | description: Percentage of the booking price customers must pay when canceling within this window. Min: `0.01` percent Max: `100` percent - name: startInMinutes | type: integer | description: Start of the cancellation window in minutes before the session start. For courses, this refers to the start of the first course session. - name: autoCollectFeeEnabled | type: boolean | description: Whether Wix automatically charges the cancellation fee from the customer once they cancel their booking. Default: `true` - name: saveCreditCardPolicy | type: SaveCreditCardPolicy | description: Rule for saving credit card details. - name: enabled | type: boolean | description: Whether Wix stores credit card details of the customer. Storing the details allows Wix to prefill the [eCommerce checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/checkout/introduction.md) and thus increases the likelihood that the customer completes the booking process. Default: `false` - name: staffSortingPolicy | type: StaffSortingPolicy | description: Information about the order in which staff members are returned in the [Time Slots V2 API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/introduction.md). When creating a booking, Wix Bookings assigns the first available staff member from the sorted list. - ONE-OF: - name: rankingOptions | type: RankingOptions | description: - name: order | type: RankingOrder | description: Order in which staff members are sorted by priority ranking. Default: `LOWEST_TO_HIGHEST` - enum: - LOWEST_TO_HIGHEST: Staff members with lower priority values are selected first. - HIGHEST_TO_LOWEST: Staff members with higher priority values are selected first. - name: customOptions | type: CustomOptions | description: - name: implementationId | type: string | description: GUID of the custom sorting implementation registered in the [Staff Sorting service plugin](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-sorting-service-plugin/introduction.md). - name: appId | type: string | description: GUID of the app that provides the custom sorting implementation. - name: sortingMethodType | type: SortingMethodType | description: Sorting method for staff members. Default: `RANDOM` - enum: - RANDOM: Staff members are returned in random order. - RANKING: Staff members are returned in order of their priority ranking. - CUSTOM: Staff members are returned in the order determined by a [Staff Sorting service plugin](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-sorting-service-plugin/introduction.md) implementation. Business owners can choose a different implementation for each policy in their dashboard. - name: intakeFormPolicy | type: IntakeFormPolicy | description: Rule for requiring customers to complete an [intake form](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/introduction.md) during or after booking. - name: enabled | type: boolean | description: Whether an intake form is enabled for the service. Default: `false` - name: formId | type: string | description: GUID of the intake form to present to customers. - name: timing | type: Timing | description: When the intake form is presented to the customer. - enum: - AFTER_BOOKING: Form is sent to the customer after the booking is created. - BEFORE_BOOKING: Form is shown to the customer during the booking flow, before the booking is created. - name: completionRequirement | type: CompletionRequirement | description: Whether completing the intake form is required. - enum: - OPTIONAL: Form completion is optional. Customers can skip the form. - REQUIRED_BEFORE_BOOKING: Customers must complete the form before the booking is finalized. Only supported when `timing` is `BEFORE_BOOKING`. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the booking policies. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: previousDefaultBookingPolicy | type: BookingPolicy | description: Previous default booking policy. Not available if the provided booking policy was already the default. ``` ### Examples ### Update a `bookingPolicy` to become the default policy, while updating the previous default BookingPolicy to be no longer the default ```curl curl -X POST \ 'https://wixapis.com/bookings/v1/booking-policies/1a426c47-0c86-46c7-8573-c7bce734f660:setDefault' \ -H 'Authorization: ' \ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.policies.BookingPoliciesService.setDefaultBookingPolicy(bookingPolicyId) Description: 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. # 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 that's set as default. | required: true Return type: PROMISE - name: currentDefaultBookingPolicy | type: BookingPolicy | description: New default booking policy. - name: _id | type: string | description: GUID of the booking policy. - name: revision | type: string | description: Revision number, which increments by 1 each time the booking policy is updated. To prevent conflicting changes, the current `revision` must be passed when updating the booking policy. - name: _createdDate | type: Date | description: Date and time the booking policy was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: _updatedDate | type: Date | description: Date and time the booking policy was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format. - name: appId | type: string | description: GUID of the app associated with the booking policy. You can't update `appId`. Booking policies are displayed in Wix Bookings only if they are associated with the Wix Bookings app GUID or have no associated app GUID. Default: `13d21c63-b5ec-5912-8397-c3a5ddb27a97` (Wix Bookings app GUID) For booking policies from Wix apps, the following values apply: - Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` - Wix Services: `"cc552162-24a4-45e0-9695-230c4931ef40"` - Wix Meetings: `"6646a75c-2027-4f49-976c-58f3d713ed0f"`. [Full list of apps created by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: createdByAppId | type: string | description: GUID of the app that created the booking policy. This field is used for analytics, auditing, and tracking creation sources. This read-only field is automatically populated during policy creation by checking these sources in order: 1. The caller's App GUID from the request identity context. 2. The policy's `appId` field. 3. The Wix Bookings App GUID (`13d21c63-b5ec-5912-8397-c3a5ddb27a97`) as the final fallback. - name: name | type: string | description: Name of the booking policy. - name: customPolicyDescription | type: PolicyDescription | description: Custom description for the booking policy and whether it's displayed to the participant. - name: enabled | type: boolean | description: Whether the description is displayed to the participant. `true` means the description is displayed. Default: `false` - name: description | type: string | description: Description of the booking policy. Default: Empty Max length: 2500 characters - name: default | type: boolean | description: Whether the booking policy is the default. - name: limitEarlyBookingPolicy | type: LimitEarlyBookingPolicy | description: Rule for limiting early bookings. - name: enabled | type: boolean | description: Whether there's a limit about how early a customer can book. `false` means there's no limit to the earliest supported booking time. Default: `false` - name: earliestBookingInMinutes | type: integer | description: Maximum number of minutes before the start of a session or course customers can book. Must be greater than `limitLateBookingPolicy.latestBookingInMinutes`. Default: `10080` minutes (7 days) Min: `1` minute - name: limitLateBookingPolicy | type: LimitLateBookingPolicy | description: Rule for limiting late bookings. This rule and `bookAfterStartPolicy` can't be both enabled at the same time. - name: enabled | type: boolean | description: Whether there's a limit about how late customers can book. `false` means customers can book up to the last minute. If specified as `true`, `bookAfterStartPolicy.enabled` must be `false`. Default: `false` - name: latestBookingInMinutes | type: integer | description: Minimum number of minutes before the start of the session customers can book. For courses, this is relative to the start time of the next session and doesn't consider course sessions in the past. This value must be less than `limitEarlyBookingPolicy.earliestBookingInMinutes`. Default: `1440` minutes (1 day) Min: `1` minute - name: bookAfterStartPolicy | type: BookAfterStartPolicy | description: Rule for booking after the start of a session or course. This rule and `limitLateBookingPolicy` can't be both enabled at the same time. - name: enabled | type: boolean | description: Whether customers can book after the session has started. `true` means customers can book after the session has started. For courses, this refers to the start of the last course session. If specified as `true`, `limitLateBookingPolicy.enabled` must be `false`. Default: `false` - name: cancellationPolicy | type: CancellationPolicy | description: Rule for canceling a booking. - name: enabled | type: boolean | description: Whether customers can cancel the booking. `true` means customers can cancel the booking. Default: `false` - name: limitLatestCancellation | type: boolean | description: Whether there's a limit on the latest cancellation time. `false` means customers can cancel the booking until the last minute before the course or session starts. Default: `false` - name: latestCancellationInMinutes | type: integer | description: Minimum number of minutes before the start of the session customers can cancel. For courses, this refers to the start of the first course session. Default: `1440` minutes (1 day) Min: `1` minute - name: allowAnonymous | type: boolean | description: Whether customers can cancel bookings anonymously using the [anonymous booking actions](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/introduction.md#anonymous-booking-actions). This field is ignored if `cancellationPolicy.enabled` is `false`. Default: `null` (treated as `false`) - name: reschedulePolicy | type: ReschedulePolicy | description: Rule for rescheduling a booking. - name: enabled | type: boolean | description: Whether customers can reschedule a booking for an appointment-based service. `true` means customers can reschedule. Default: `false` - name: limitLatestReschedule | type: boolean | description: Whether there's a limit on the latest supported rescheduling time. `false` means customers can reschedule until the last minute before the session start. Default: `false` - name: latestRescheduleInMinutes | type: integer | description: Minimum number of minutes before the session start session customers can reschedule their booking. Default: `1440` minutes (1 day) Min: `1` minute - name: allowAnonymous | type: boolean | description: Whether customers can reschedule bookings anonymously using the [anonymous booking actions](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/introduction.md#anonymous-booking-actions). This field is ignored if `reschedulePolicy.enabled` is `false`. Default: `null` (treated as `false`) - name: waitlistPolicy | type: WaitlistPolicy | description: Waitlist rule for the service. - name: enabled | type: boolean | description: Whether the service has a waitlist. `true` means there's a waitlist. Default: `false` - name: capacity | type: integer | description: Number of spots in the waitlist. Default: `10` spots Min: `1` spot - name: reservationTimeInMinutes | type: integer | description: Time in minutes the potential customer is given to book after they've been notified that a spot has opened up for them. If they don't respond in time, the open spot is offered to the next potential customer on the waitlist. Default: `10` minutes Min: `1` minute - name: participantsPolicy | type: ParticipantsPolicy | description: Rule for participants per booking. - name: maxParticipantsPerBooking | type: integer | description: Maximum number of participants per booking. Default: `1` participant Min: `1` participant - name: cancellationFeePolicy | type: CancellationFeePolicy | description: Rules for cancellation fees. - name: enabled | type: boolean | description: Whether customers must pay a cancellation fee when canceling a booking. Default: `false` - name: cancellationWindows | type: array | description: Time windows relative to the session start during which customers can cancel their booking. Each window includes details about the fee for canceling within it. - ONE-OF: - name: amount | type: Money | description: Fixed amount customers must pay when canceling the booking within this window. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: percentage | type: string | description: Percentage of the booking price customers must pay when canceling within this window. Min: `0.01` percent Max: `100` percent - name: startInMinutes | type: integer | description: Start of the cancellation window in minutes before the session start. For courses, this refers to the start of the first course session. - name: autoCollectFeeEnabled | type: boolean | description: Whether Wix automatically charges the cancellation fee from the customer once they cancel their booking. Default: `true` - name: saveCreditCardPolicy | type: SaveCreditCardPolicy | description: Rule for saving credit card details. - name: enabled | type: boolean | description: Whether Wix stores credit card details of the customer. Storing the details allows Wix to prefill the [eCommerce checkout](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/checkout/introduction.md) and thus increases the likelihood that the customer completes the booking process. Default: `false` - name: staffSortingPolicy | type: StaffSortingPolicy | description: Information about the order in which staff members are returned in the [Time Slots V2 API](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/introduction.md). When creating a booking, Wix Bookings assigns the first available staff member from the sorted list. - ONE-OF: - name: rankingOptions | type: RankingOptions | description: - name: order | type: RankingOrder | description: Order in which staff members are sorted by priority ranking. Default: `LOWEST_TO_HIGHEST` - enum: - LOWEST_TO_HIGHEST: Staff members with lower priority values are selected first. - HIGHEST_TO_LOWEST: Staff members with higher priority values are selected first. - name: customOptions | type: CustomOptions | description: - name: implementationId | type: string | description: GUID of the custom sorting implementation registered in the [Staff Sorting service plugin](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-sorting-service-plugin/introduction.md). - name: appId | type: string | description: GUID of the app that provides the custom sorting implementation. - name: sortingMethodType | type: SortingMethodType | description: Sorting method for staff members. Default: `RANDOM` - enum: - RANDOM: Staff members are returned in random order. - RANKING: Staff members are returned in order of their priority ranking. - CUSTOM: Staff members are returned in the order determined by a [Staff Sorting service plugin](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/staff-sorting-service-plugin/introduction.md) implementation. Business owners can choose a different implementation for each policy in their dashboard. - name: intakeFormPolicy | type: IntakeFormPolicy | description: Rule for requiring customers to complete an [intake form](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/introduction.md) during or after booking. - name: enabled | type: boolean | description: Whether an intake form is enabled for the service. Default: `false` - name: formId | type: string | description: GUID of the intake form to present to customers. - name: timing | type: Timing | description: When the intake form is presented to the customer. - enum: - AFTER_BOOKING: Form is sent to the customer after the booking is created. - BEFORE_BOOKING: Form is shown to the customer during the booking flow, before the booking is created. - name: completionRequirement | type: CompletionRequirement | description: Whether completing the intake form is required. - enum: - OPTIONAL: Form completion is optional. Customers can skip the form. - REQUIRED_BEFORE_BOOKING: Customers must complete the form before the booking is finalized. Only supported when `timing` is `BEFORE_BOOKING`. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to the booking policies. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: previousDefaultBookingPolicy | type: BookingPolicy | description: Previous default booking policy. Not available if the provided booking policy was already the default. ``` ### Examples ### setDefaultBookingPolicy ```javascript import { bookingPolicies } from '@wix/bookings'; async function setDefaultBookingPolicy(bookingPolicyId) { const response = await bookingPolicies.setDefaultBookingPolicy(bookingPolicyId); }; ``` ### setDefaultBookingPolicy (with elevated permissions) ```javascript import { bookingPolicies } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function mySetDefaultBookingPolicyMethod(bookingPolicyId) { const elevatedSetDefaultBookingPolicy = auth.elevate(bookingPolicies.setDefaultBookingPolicy); const response = await elevatedSetDefaultBookingPolicy(bookingPolicyId); } ``` ### setDefaultBookingPolicy (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 setDefaultBookingPolicy(bookingPolicyId) { const response = await myWixClient.bookingPolicies.setDefaultBookingPolicy(bookingPolicyId); }; ``` ---