Overview of Bookings API Calls
Problem
Users need an overview of the available API methods for handling bookings, cancellations, activity retrieval, and pricing in the Bookings.asmx service.
Resolution
Below are the key API calls available in Bookings.asmx and their functions:
CancelBooking(int memberId, int bookingId, bool returnUsage)
- Cancels a booking for a member if allowed by business rules.
- If more than one member is associated, only the specified member is removed; the booking remains for others.
- If the booking used a usage subscription, the
returnUsageparameter determines if the usage should be added back. - Note: This method will be deprecated in favour of
CancelBookingWithDetails().
CancelBookingWithDetails(int memberId, int bookingId, Boolean returnUsage)
- Similar to
CancelBookingbut with additional reason reporting.
- Similar to
GetActivitiesAtSite(obj request)
- Retrieves details of activities, classes, and courses at one or more sites.
GetActivityDetails(string activityId)
- Retrieves details of a specific activity, including its group and linked resource products.
GetActivityGroupDetails(obj request)
- Retrieves details for one or more activity groups.
GetActivityGroups(string siteId, bool webBookableOnly)
- Retrieves a list of activity groups for a site, optionally filtered for web-bookable groups.
GetAvailableBookableSlots(obj request)
- Returns bookable slots with prices for a given activity within a time range for a given member.
- If
memberIdis 0, returns slots for non-members. - Does not support classes or courses.
GetAvailableSlots(string activityId, DateTime startDateTime, DateTime endDateTime, int memberId)
- Returns bookable slots for an activity/class within a time range for a member or non-member.
GetAvailableSlotsForProduct(string activityId, DateTime startDateTime, DateTime endDateTime, int memberId, string[] productIds)
- Returns bookable slots for an activity within a time range for a member or non-member, including specific resource product(s).
- Specify required product IDs for bookings needing them (e.g., specific court, staff member).
GetBookingSheet(BookingSheet BookingSheetRequest)
- Returns information on activities and reservations in the Booking sheet.
- Four levels of detail: SummaryMergedSlots, Summary, PublicDetail, PrivateDetail.
- Large data returns possible; check with Plus2 operator for appropriate time ranges.
GetResourceProducts(string resourceGroupId)
- Retrieves resource product IDs for a specific resource group.
- Note: Will be deprecated in favour of
GetProductsByProductGroups().
GetZeroPricedAvailableSlots(string activityId, DateTime startDateTime, DateTime endDateTime, int memberId)
- Returns only the free slots a member can book, similar to
GetAvailableSlots.
- Returns only the free slots a member can book, similar to
GetZeroPricedAvailableSlotsForProduct(string activityId, DateTime startDateTime, DateTime endDateTime, int memberId, string[] productIds)
- Returns only the free slots for specific resource product(s), similar to
GetAvailableSlotsForProduct.
- Returns only the free slots for specific resource product(s), similar to
ListBookableActivitiesClassesCourses(int memberId, string siteId, bool webBookableOnly)
- Returns an array of bookable activities, classes, and courses for the specified member and site(s).
- Use memberId 0 for non-members; site ID can be empty for all sites, or comma-separated for multiple sites.
ListBookableActivitiesClassesCoursesByDate(int memberId, string siteId, bool webBookableOnly, DateTime[] dates)
- Returns all bookable activities, classes, and courses available to a member on specified dates.
ListBookableActivitiesClassesCoursesByDateAndGroup(int memberId, string siteId, string activityGroupId, bool webBookableOnly, DateTime[] dates)
- Returns bookable activities, classes, and courses for specified dates and activity group.
ListZeroPricedActivitiesByDateAndGroup(int memberId, string siteId, string activityGroupId, bool webBookableOnly, DateTime[] dates)
- Same as above, but only returns activities that can be booked for free.
ListZeroPricedBookableActivitiesClassesCoursesByDate(int memberId, string siteId, bool webBookableOnly, DateTime[] dates)
- Returns only free slots for activities available on specific dates.
MakeBooking(string activityId, DateTime startDateTime, int memberId)
- Makes a booking for a member for the given activity at the given time.
- Returns booking ID for success or 0 if the booking cannot be made.
MakeBookingForProduct(string activityId, DateTime startDateTime, int memberId, string[] productIds)
- Like
MakeBooking, but lets you specify required resource products (e.g., choosing a court).
- Like
MakeZeroPricedBooking(string activityId, DateTime startDateTime, int memberId)
- As above but only succeeds if the member can book the activity for free at that time.
MakeZeroPricedBookingForProduct(string activityId, DateTime startDateTime, int memberId, string[] productIds)
- As above but for resource product bookings that are free for the member.
RetrieveBookingPrice(string activityId, DateTime startDateTime, int memberId)
- Returns the price to be charged for the booking at a given time.
RetrieveBookingPriceForProduct(string activityId, DateTime startDateTime, int memberId, string[] productIds)
- Like above, but for bookings requiring specific resource products (e.g., a court or staff member).
Notes
- Some methods are planned for deprecation; use the recommended alternative methods where indicated.
- For methods returning potentially large amounts of booking data (such as
GetBookingSheet), coordinate with the operator regarding appropriate time ranges to avoid excessive data returns. - In all methods, use
memberIdof0to represent non-members. - When bookings require selection of a specific resource (e.g., court, staff), include the appropriate resource product IDs.