Availabilities

To fetch the availability of a Product (CatalogItem or CatalogItemDetails) , you may use the following method, passing in the date range you are interested in. If you are only interested in a single day, just pass in the same end date as the start date.

This method will asynchronously return an Availability type for every date for which the desired experience is available.

Traveler.fetchAvailabilities(product: catalogItemDetails, 
                           startDate: Date(), 
                             endDate: Date()) { (availabilities, error) in
  
}

Alternatively you can use the delegate pattern

Traveler.fetchAvailabilities(product: catalogItemDetails, 
                           startDate: Date(), 
                             endDate: Date()),
                            delegate: self)
extension MyViewController: AvailabilitiesFetchDelegate {
    func availabilitiesFetchDidFailWith(_ error: Error) {
    
    }
    
    func availabilitiesFetchDidSucceedWith(_ availabilities: [Availability]) {
    
    }
}

Embedded inside each Availability there may optionally be a BookingOptionSet that provide the different BookingOptions that may exist for that date. An example of a BookingOption may be the different times that are available for that date.

Last updated