> 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 # ListPolicySnapshotsByBookingIds # Package: policies # Namespace: BookingPolicySnapshots # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policy-snapshots/list-policy-snapshots-by-booking-ids.md ## Permission Scopes: Read Bookings - Public Data: SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC ## Introduction Retrieves a list of booking policy snapshots by [booking IDs](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/about-the-bookings-apis.md). --- ## REST API ### Schema ``` Method: listPolicySnapshotsByBookingIds Description: Retrieves a list of booking policy snapshots by [booking GUIDs](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/about-the-bookings-apis.md). URL: https://www.wixapis.com/v1/policy-snapshots Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: bookingIds Method parameters: query param name: bookingIds | type: array | description: List of booking GUIDs to retrieve policy snapshots for. | required: true Return type: ListPolicySnapshotsByBookingIdsResponse - name: bookingPolicySnapshots | type: array | description: Retrieved booking policy snapshots. - name: id | type: string | description: Booking policy snapshot GUID. - name: bookingId | type: string | description: GUID of the booking that's associated with this policy snapshot. - name: policy | type: BookingPolicy | description: Snapshot of the [booking policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction.md). at the time the corresponding booking was created. - name: id | type: string | description: Booking policy GUID. - 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. - name: updatedDate | type: string | description: Date and time the booking policy was updated. - name: name | type: string | description: Name of the booking policy. - name: customPolicyDescription | type: PolicyDescription | description: Custom description for the booking policy and whether the booking policy is 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: descriptionTranslated | type: string | description: Description of the translated booking policy. Default: Empty Max length: 2500 characters - name: default | type: boolean | description: Whether the booking policy is the default. - 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: 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: 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 checkout and thus increases the likelihood that the customer completes the booking process. Default: `false` - name: createdDate | type: string | description: Date and time the booking policy snapshot was created in `YYYY-MM-DDThh:mm:ssZ` format. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: BOOKING_POLICY_SNAPSHOT_NOT_FOUND | Description: Couldn't find the booking policy snapshot. ``` ### Examples ### List policy snapshots by booking IDs ```curl curl -X GET \ 'https://www.wixapis.com/_api/booking-policy-snapshots/v1/policy-snapshots?bookingIds=353aa3b7-00ef-42bd-86ff-720d7ef60443' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.policies.BookingPolicySnapshots.listPolicySnapshotsByBookingIds(bookingIds) Description: Retrieves a list of booking policy snapshots by [booking GUIDs](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/about-the-bookings-apis.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: bookingIds Method parameters: param name: bookingIds | type: array | description: List of booking GUIDs to retrieve policy snapshots for. | required: true Return type: PROMISE - name: bookingPolicySnapshots | type: array | description: Retrieved booking policy snapshots. - name: _id | type: string | description: Booking policy snapshot GUID. - name: bookingId | type: string | description: GUID of the booking that's associated with this policy snapshot. - name: policy | type: BookingPolicy | description: Snapshot of the [booking policy](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policies/introduction.md). at the time the corresponding booking was created. - name: _id | type: string | description: Booking policy GUID. - 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. - name: _updatedDate | type: Date | description: Date and time the booking policy was updated. - name: name | type: string | description: Name of the booking policy. - name: customPolicyDescription | type: PolicyDescription | description: Custom description for the booking policy and whether the booking policy is 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: descriptionTranslated | type: string | description: Description of the translated booking policy. Default: Empty Max length: 2500 characters - name: default | type: boolean | description: Whether the booking policy is the default. - 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: 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: 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 checkout and thus increases the likelihood that the customer completes the booking process. Default: `false` - name: _createdDate | type: Date | description: Date and time the booking policy snapshot was created in `YYYY-MM-DDThh:mm:ssZ` format. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: BOOKING_POLICY_SNAPSHOT_NOT_FOUND | Description: Couldn't find the booking policy snapshot. ``` ### Examples ### listPolicySnapshotsByBookingIds ```javascript import { bookingPolicySnapshots } from '@wix/bookings'; async function listPolicySnapshotsByBookingIds(bookingIds) { const response = await bookingPolicySnapshots.listPolicySnapshotsByBookingIds(bookingIds); }; ``` ### listPolicySnapshotsByBookingIds (with elevated permissions) ```javascript import { bookingPolicySnapshots } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myListPolicySnapshotsByBookingIdsMethod(bookingIds) { const elevatedListPolicySnapshotsByBookingIds = auth.elevate(bookingPolicySnapshots.listPolicySnapshotsByBookingIds); const response = await elevatedListPolicySnapshotsByBookingIds(bookingIds); } ``` ### listPolicySnapshotsByBookingIds (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 { bookingPolicySnapshots } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { bookingPolicySnapshots }, // Include the auth strategy and host as relevant }); async function listPolicySnapshotsByBookingIds(bookingIds) { const response = await myWixClient.bookingPolicySnapshots.listPolicySnapshotsByBookingIds(bookingIds); }; ``` ---