> 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 # Package: policies # Namespace: bookingPolicies # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/default-booking-policy-set.md ## Introduction Triggered when the site's default policy changes. Then, [Booking Policy Updated](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/booking-policy-updated.md) is also triggered both for the new and the previous default policy. --- ## REST API ### Schema ``` Webhook: Default Booking Policy Set Description: Triggered when the site's default policy changes. Then, [Booking Policy Updated](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/booking-policy-updated.md) is also triggered both for the new and the previous default policy. Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: actionEvent | type: object | description: Custom action event details. - name: body | type: DefaultBookingPolicySet | description: The event body. - name: currentDefaultBookingPolicy | type: BookingPolicy | description: The 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: The booking policy that was the default before this endpoint was called. This field will be empty if there was no default booking policy before this method was called. ``` ### Examples ```curl { "id": "c5d438c2-99e8-47c8-bfe8-5b33746a2c6a", "entityFqdn": "wix.bookings.v1.booking_policy", "slug": "default_booking_policy_set", "entityId": "caa894dc-e84e-4498-aef3-76610c5cd95c", "actionEvent": { "bodyAsJson": "{\"currentDefaultBookingPolicy\":{\"id\":\"caa894dc-e84e-4498-aef3-76610c5cd95c\",\"revision\":\"8\",\"createdDate\":\"2023-01-13T15:00:41.492Z\",\"updatedDate\":\"2023-02-17T15:30:35.813Z\",\"name\":\"Default policy\",\"customPolicyDescription\":{\"enabled\":false,\"description\":\"\"},\"default\":true,\"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}},\"previousDefaultBookingPolicy\":{\"id\":\"1a426c47-0c86-46c7-8573-c7bce734f660\",\"revision\":\"4\",\"createdDate\":\"2023-02-16T10:46:17.420Z\",\"updatedDate\":\"2023-02-17T15:30:35.808Z\",\"name\":\"Appointment Policy\",\"customPolicyDescription\":{\"enabled\":true,\"description\":\"To cancel, please contact us at least 48 hours in advance\"},\"default\":false,\"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}}}" }, "eventTime": "2023-02-17T15:30:36.156858Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onBookingPolicyDefaultBookingPolicySet Description: Triggered when the site's default policy changes. Then, [Booking Policy Updated](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/booking-policy-updated.md) is also triggered both for the new and the previous default policy. Payload: BookingPolicyDefaultBookingPolicySetEnvelope - name: data | type: DefaultBookingPolicySet | description: none - name: currentDefaultBookingPolicy | type: BookingPolicy | description: The 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: The booking policy that was the default before this endpoint was called. This field will be empty if there was no default booking policy before this method was called. - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { bookingPolicies } from '@wix/bookings'; bookingPolicies.onBookingPolicyDefaultBookingPolicySet((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { bookingPolicies } from '@wix/bookings'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { bookingPolicies, }, }); wixClient.bookingPolicies.onBookingPolicyDefaultBookingPolicySet((event) => { // handle your event here }); ``` ---