POST

Query Policies


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of up to 100 booking policies (SDK | REST), and information about the services that are connected to them, given the provided filtering, paging, and sorting.

Defaults

Query Policies has the following default settings, which you can override:

  • Sorted by id in ascending order.
  • cursorPaging.limit set to 100.

Filters

For a complete list of supported filters, refer to Booking Policies API: Supported Filters (REST).

When using date filters, you must use UTC time.

Returned services

If a booking policy is connected to more than 5 services, only a subset of those services is returned. The bookingPolicies.totalServiceCount values indicate the total number of services linked to each policy. You can call Search Services (SDK | REST) and specify the relevant policy ID in the filter to retrieve all services connected to the booking policy.

See also

To learn about working with Query endpoints, see API Query Language and Sorting and Paging.

Permissions
Manage Bookings Services and Settings
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/bookings/v2/services/policies/query

Body Params
queryQueryRequired

Information about filters, paging, and sorting. See the article about booking policy filters (REST) for all supported filters and sorting options.

Response Object
bookingPoliciesArray <BookingPolicyWithServices>

Retrieved booking policies and information about the services using them.


pagingMetadataPagingMetadata

Paging metadata.

Query booking policies
Request
cURL
curl -X POST 'https://www.wixapis.com/bookings/v2/services/policies/query' \ -H 'Authorization: <AUTH>' \ -d '{ "query": { "sort": [ { "fieldName": "name" } ], "cursorPaging": { "limit": 5 } } }'
Response
JSON
{ "bookingPolicies": [ { "bookingPolicy": { "id": "28b57174-1a38-43ba-9cbf-a0039054729d", "revision": "2", "createdDate": "2024-06-18T11:23:22.056Z", "updatedDate": "2025-01-12T20:40:04.627Z", "name": "1st policy", "customPolicyDescription": { "enabled": false, "description": "" }, "default": false, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": false, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": false, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "cancellationFeePolicy": { "enabled": false, "cancellationWindows": [ { "percentage": "10" }, { "amount": { "value": "25", "currency": "UAH" }, "startInMinutes": 60 } ], "autoCollectFeeEnabled": true }, "saveCreditCardPolicy": { "enabled": true } }, "connectedServices": [], "totalServiceCount": 0 }, { "bookingPolicy": { "id": "b5bab22a-a98e-4645-af35-cfe27fc4c3eb", "revision": "2", "createdDate": "2024-06-18T11:26:12.394Z", "updatedDate": "2024-06-18T11:30:04.813Z", "name": "2nd policy", "customPolicyDescription": { "enabled": true, "description": "asdasdasd" }, "default": false, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": false, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": false, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "cancellationFeePolicy": { "enabled": true, "cancellationWindows": [ { "percentage": "5" } ], "autoCollectFeeEnabled": true }, "saveCreditCardPolicy": { "enabled": true } }, "connectedServices": [], "totalServiceCount": 0 }, { "bookingPolicy": { "id": "0c2640b6-2e3d-4ac0-923c-990b32d44176", "revision": "2", "createdDate": "2024-01-25T10:30:43.899Z", "updatedDate": "2024-06-13T14:12:23.668Z", "name": "3rd policy", "customPolicyDescription": { "enabled": true, "description": "Yoga classes- Teachers are paid based on your attendance. You may change your reservation by logging into Wix App or our Website up to 2 hours prior to start of the class. Afterwards you will loose your paid reservation." }, "default": false, "limitEarlyBookingPolicy": { "enabled": true, "earliestBookingInMinutes": 10380 }, "limitLateBookingPolicy": { "enabled": true, "latestBookingInMinutes": 1 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": true, "capacity": 12, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "cancellationFeePolicy": { "enabled": true, "cancellationWindows": [ { "percentage": "10" } ], "autoCollectFeeEnabled": true }, "saveCreditCardPolicy": { "enabled": true } }, "connectedServices": [], "totalServiceCount": 0 }, { "bookingPolicy": { "id": "84527683-50ce-4bb2-bb67-ddf565a88dcc", "revision": "1", "createdDate": "2024-06-03T14:54:53.154Z", "updatedDate": "2024-06-03T14:54:53.154Z", "name": "Cancellation policy", "customPolicyDescription": { "enabled": false, "description": "" }, "default": false, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": false, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": false, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "cancellationFeePolicy": { "enabled": false, "cancellationWindows": [], "autoCollectFeeEnabled": true }, "saveCreditCardPolicy": { "enabled": true } }, "connectedServices": [ { "id": "2d233eb0-bbe5-434f-9cc2-025dc048cda3", "type": "COURSE", "sortOrder": 5, "name": "Yoga lesson", "defaultCapacity": 50, "media": { "items": [], "mainMedia": { "image": { "id": "7ca7f9c7020240ed8c41d6d22d9cf08c.jpg", "url": "7ca7f9c7020240ed8c41d6d22d9cf08c.jpg", "height": 1280, "width": 1920, "filename": "7ca7f9c7020240ed8c41d6d22d9cf08c.jpg" } } }, "hidden": false, "category": { "id": "6b03addc-33fc-48e4-ba5d-a22cda76519a", "name": "Category 1", "sortOrder": 6000000 }, "form": { "id": "00000000-0000-0000-0000-000000000000", "mobileSettings": { "hidden": true } }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "20", "currency": "UAH" } }, "options": { "online": true, "inPerson": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true, "requireManualApproval": false, "allowMultipleRequests": false }, "conferencing": { "enabled": false }, "locations": [ { "id": "57e914f5-dc65-46ba-a511-a36e9e3800c5", "type": "BUSINESS", "calculatedAddress": { "country": "NL", "subdivision": "NH", "city": "Haarlem", "formattedAddress": "Haarlem, Netherlands", "geocode": { "latitude": 52.3873878, "longitude": 4.6462194 } }, "business": { "id": "57e914f5-dc65-46ba-a511-a36e9e3800c5", "name": "Haarlem 2", "default": true, "address": { "country": "NL", "subdivision": "NH", "city": "Haarlem", "formattedAddress": "Haarlem, Netherlands", "geocode": { "latitude": 52.3873878, "longitude": 4.6462194 } }, "email": "antonkra@wix.com" } } ], "bookingPolicy": { "id": "84527683-50ce-4bb2-bb67-ddf565a88dcc", "revision": "1", "createdDate": "2024-06-03T14:54:53.154Z", "updatedDate": "2024-06-03T14:54:53.154Z", "name": "Cancellation policy", "customPolicyDescription": { "enabled": false, "description": "" }, "default": false, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": false, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": false, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "cancellationFeePolicy": { "enabled": false, "cancellationWindows": [] }, "saveCreditCardPolicy": { "enabled": true } }, "schedule": { "id": "2c297abd-b367-457f-b2c8-c6e6a6c467ad", "availabilityConstraints": { "durations": [], "sessionDurations": [], "timeBetweenSessions": 0 } }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "yoga-lesson", "custom": false, "createdDate": "2024-07-02T15:16:54.006Z" } ], "mainSlug": { "name": "yoga-lesson", "custom": false, "createdDate": "2024-07-02T15:16:54.006Z" }, "urls": { "servicePage": { "relativePath": "/service-page/yoga-lesson", "url": "https://antonkra.wixsite.com/bookings-on-ecom/service-page/yoga-lesson" }, "bookingPage": { "relativePath": "/service-page/yoga-lesson", "url": "https://antonkra.wixsite.com/bookings-on-ecom/service-page/yoga-lesson" } }, "createdDate": "2024-07-02T15:16:54.188Z", "updatedDate": "2025-01-12T20:40:03.390Z", "revision": "3" } ], "totalServiceCount": 1 }, { "bookingPolicy": { "id": "33bfb2bb-8752-436c-8df8-ea1ae9596867", "revision": "2", "createdDate": "2024-10-29T16:26:45.557Z", "updatedDate": "2025-01-12T20:40:04.627Z", "name": "Policy 5", "customPolicyDescription": { "enabled": true, "description": "Another policy" }, "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": 5, "reservationTimeInMinutes": 30 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "cancellationFeePolicy": { "enabled": true, "cancellationWindows": [ { "amount": { "value": "10", "currency": "UAH" }, "startInMinutes": 1440 } ], "autoCollectFeeEnabled": true }, "saveCreditCardPolicy": { "enabled": true } }, "connectedServices": [], "totalServiceCount": 0 } ], "pagingMetadata": { "count": 5, "cursors": { "next": "0961d0c7e190c521c04f4171d928a38f6814903c.GhQKBG5hbWUaDBoKQ2FuY1BvbGljeSIkMzNiZmIyYmItODc1Mi00MzZjLThkZjgtZWExYWU5NTk2ODY3" }, "hasNext": true } }
Errors

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

Did this help?