Documentation
iOS ReferenceAndroid Reference
  • Overview
  • Release Notes
    • 2019 Release Notes
  • Quick Start
    • Configuration settings
  • Getting Started
    • Environments
    • Domain Whitelist
  • Traveler
    • Overview
    • Mobile SDKs
      • Overview
      • Minimum Requirements
      • iOS
        • Installation
        • Getting Started
      • Android
        • Installation
        • Getting Started
      • Usage
        • Booking Item Search
          • Booking Item Search UI
        • Flight Search
        • Catalog
        • Catalog Item Details
        • Availabilities
        • Getting Passes
        • Booking Form
          • Questions
          • Answers
          • Validation
        • Creating an Order
        • Processing an Order
      • Errors
    • Traveler API
    • Payments
  • Partner
    • Overview
    • Partner API
  • Glossary
    • API Convention
      • Error Codes
      • API Rate Limiting
    • Terminology
  • Support
    • Contact
Powered by GitBook
On this page

Was this helpful?

  1. Traveler
  2. Mobile SDKs
  3. Usage

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]) {
    
    }
}
Traveler.fetchAvailabilities(catalogItem, new Date(), new Date(), new FetchAvailabilitiesCallback() {
    @Override
    void onAvailabilitySuccess(List<Availability> availabilities) {
    
    }
    
    @Overrider
    void onAvailabilityError(Error error) {
    
    }
});

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.

PreviousCatalog Item DetailsNextGetting Passes

Last updated 6 years ago

Was this helpful?