GetList Bookings

Developer Preview

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

Deprecation Notice

This endpoint has been replaced with Query Extended Bookings and will be removed on December 31, 2021. If your app uses this endpoint, we recommend updating your code as soon as possible.

Retrieves a list of bookings according to the provided filters and paging. By default, only confirmed bookings are returned. Query object support:

  • filter: supports
  • bookingId - query for a specific booking. Example: "filter { string_value: "{ "bookingId": "46ce4cd4-46ff-4aa7-9cc0-02fd4f0f3209" }" }".
  • contactId - Bookings made by this contactId (defined in Contact service). Example: "filter { string_value: "{ "contactId": "b68960d3-820a-4588-a6b3-d7238add8af5" }" }".
  • sessionId - Bookings made to this sessionId. Support for a list of sessionIds; Example: "filter { string_value: "{ "sessionId": ["193ZPR9ppP9emJUCLevcLf6orynNE45", "193ZPR9ppP9emJUCLevcLf6orynNE98"] }" }".
  • scheduleId - Bookings made to sessions from this scheduleId, or made to the scheduleId itself. We support list of scheduleIds; Example: "filter { string_value: "{ "scheduleId": ["cd65b7de-164c-471b-908d-ee94d8ba6459", "fa573e37-e035-4bec-93b8-05cb90fe7aba"] }" }".
  • startTime - Bookings with booked entity (schedule/session) start time (UTC). We support 'gte' , 'lt'; Examples:
  • All bookings that will start after or equal to 27/04/20 10:00:00 - "filter { string_value: "{ "startTime": {"$gte": "2020-04-27T10:00:00.000Z" }}" }".
  • All bookings that start before 27/04/20 10:00:00 - "filter { string_value: "{ "startTime": {"$lt": "2020-04-27T10:00:00.000Z" }}" }".
  • endTime - Bookings with booked entity (schedule/session) end time (UTC). We support 'gt' , 'lte'; Examples:
  • All bookings that will start after 27/04/20 10:00:00 - "filter { string_value: "{ "startTime": {"$gt": "2020-04-27T10:00:00.000Z" }}" }".
  • All bookings that start before or equal to 27/04/20 10:00:00 - "filter { string_value: "{ "startTime": {"$lte": "2020-04-27T10:00:00.000Z" }}" }".
  • status - Bookings with this status. We support list of statuses. Example: "filter { string_value: "{ "status": ["CONFIRMED", "PENDING"] }" }".
  • created - Bookings creation time (UTC). We support 'gte' , 'lt'; Examples:
  • All bookings that were created after or equal to 27/04/20 10:00:00 - "filter { string_value: "{ "created": {"$gte": "2020-04-27T10:00:00.000Z" }}" }".
  • All bookings that were created before 27/04/20 10:00:00 - "filter { string_value: "{ "created": {"$lt": "2020-04-27T10:00:00.000Z" }}" }".
  • paging: Supported. Limit Example: "query { paging { limit { value: 10 } } }". Offset Example: "query { paging { offset { value: 10 } } }".
  • fieldsets: not supported.
  • fields: not supported.

Note:

  • Only one use at a time of each filter once in the same query is supported. If a filter will be used more than once in one query, only the first occurrence is taken. Calling List without any filter, will return all bookings permitted to watch by the invoker permission.
  • All results are for one specific business, resolved from the request context.
  • A member should only be able to see their own bookings;
  • To get the available actions for a member for each booking, based on the business bookings policy, use the withBookingAllowedActions field.

Permissions This endpoint requires the Read Bookings - Including Participants permission scope.

Endpoint
GET
https://www.wixapis.com/bookings/v1/bookings

Was this helpful?
Yes
No

PostQuery Bookings

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 bookings according to the provided filters and paging. The query runs with the following defaults:

Copy
1
{
2
"query": {
3
"filter": {
4
"status": "CONFIRMED"
5
},
6
"paging" : {
7
"limit" : 500,
8
"offset" : 0
9
},
10
"sort":[{ "fieldName":"createdDate", "order": "DESC"} ]
11
}
12
}

You can override these defaults, and define other filters and paging, as shown in the following table.

Query object support:

FieldSupported FiltersSortable
bookingId$eq
contactId$eq
sessionId$eq, $in, $hasSome
scheduleId$eq, $in, $hasSome
startTime$gte, $lt
endTime$gt, $lte
status$eq, $in, $hasSome
createdDate$gte, $ltSortable
pagingSupported
fieldsetsNot supported.
fieldsNot supported.

Notes:

  • The following objects in the query parameter are not supported for this query:
    • fields
    • fieldsets
  • Only one use at a time of each filter once in the same query is supported. If a filter will be used more than once in one query, only the first occurrence is taken.
  • Calling Query without a filter, will return all bookings viewable according to the caller's permissions.
  • All results are for one specific business, resolved from the request context.
  • A member should only be able to see their own bookings;
  • To get the available actions for a member for each booking, based on the business bookings policy, use the withBookingAllowedActions field.
  • When using the queryBookings() function immediately following a change to your bookings, the data retrieved may not contain your most recent changes. See Wix-data and Eventual Consistency for more information.
  • The businessLocation.businessSchedule object in the bookedEntity.location object is not supported.

Permissions This endpoint requires the Read Bookings - Including Participants permission scope.

Endpoint
POST
https://www.wixapis.com/bookings/v1/bookings/query

Was this helpful?
Yes
No