GET All Availability


GetAllAvailability() returns the availability and rates for all units/groups for a date range and number of adults.  This is useful for finding the prices for available stays.
  • If the business has groups configured, then the results will be per group ('groups').  Otherwise the results will be per unit ('units').

  • Availability is defined as a unit having not being rented, occupied or under repair and that is ready to be rented to guests. 

  • The start_date, end_date and the dates in between are dates of stay, not the check_in and check_out dates of a possible itinerary.  Use GetQuote() to get availability for an itinerary.

REQUEST


End Point 
    https://availabilityexchange.com/gateway/GetAllAvailability
Parameters
    business_id (64-bit integer)
        unique id of the business. 
    start_date (date YYYY-MM-dd)
        the first date requested
    end_date (date YYYY-MM-dd)
        the last date requested
    num_adults (32-bit integer)
        the number of guests

EXAMPLE REQUEST

>curl
--user username:passkey
--url  https://www.availabilityexchange.com/gateway/getallavailability?business_id=16609&start_date=2021-09-01&end_date=2021-09-04&num_adults=2


RESPONSE - Groups


response_errors (See Response Errors)
unit_group_id (32-bit integer)
    the unique identifier for the group. 
unit_group_name (string)
    name of the group
number_of_units (32-bit integer)
    number of units within the group that are available for the given date range.  
business_id (64-bit integer)
    the business
start_date (date YYYY-MM-dd)
    the first date returned
end_date (date YYYY-MM-dd)
    the last date returned
num_adults (32 -bit integer)
    the number of guests
rate (32-bit float)
    sum of each day's rate.  Zero if there is no availability.  This does not include taxes and fees.

EXAMPLE RESPONSE (Groups)

{
    "groups": [{
        "unit_group_id": 16463,
        "unit_group_name": "Double King",
        "number_of_units_available": 8,
        "business_id": 16609,
        "start_date": "2022-08-14",
       "end_date": "2022-08-17",
       "num_adults": 2,
        "rate": 560.0000
    }, {
        "unit_group_id": 16465,
        "unit_group_name": "Singe Queen",
        "number_of_units_available": 5,
        "business_id": 16609,
        "start_date": "2022-08-14",
        "end_date": "2022-08-17",
        "num_adults": 2,
        "rate": 500.0000
    }]
}


RESPONSE - Units


response_errors (See Response Errors)
unit_id (32-bit integer)
    the unique identifier for the unit. 
unit_name (string)
    name of the unit.
unit_is_available (boolean)
    if the unit is available for the date range.
business_id (64-bit integer)
    the business
start_date (date YYYY-MM-dd)
    the first date returned
end_date (date YYYY-MM-dd)
    the last date returned
num_adults (32 -bit integer)
    the number of guests
rate (32-bit float)
    sum of each day's rate.  Zero if there is no availability.  This does not include taxes and fees.

EXAMPLE RESPONSE (Units)

{
    "units": [{
        "unit_id": 27795,
        "unit_name": "FD10 Double Full Room ",
        "unit_is_available": false,
        "business_id": 16609,
        "start_date": "2022-08-14",
        "end_date": "2022-08-17",
        "num_adults": 2,
        "rate": 0.0
    }, {
        "unit_id": 27798,
        "unit_name": "DQ03 Double Queens",
        "unit_is_available": true,
       "business_id": 16609,
       "start_date": "2022-08-14",
       "end_date": "2022-08-17",
       "num_adults": 2,
       "rate": 560.0000
    }]
}


RESPONSE ERRORS


200
    response_errors (list of strings)
  • The start date is after the end date
  • <x> is a test property only.  Do not use this data for any    purpose besides testing
  • The query cannot contain dates before today
  • Unit#<y> for Business <x> is unavailable or does not exist

400
  • business_id should be a long
  • unit_id should be an int or a comma-delimited list of ints
  • unit_group_id should be an int or a comma-delimited list of ints
  • dates should be formatted 'YYYY-MM-DD'

401
  • This site requires a secure connection over HTTPS
  • The credentials supplied are incorrect or you do not have access to this resource

500
    Something went wrong (Internal Server Error)
503
    Server in maintenance mode

EXAMPLE ERROR RESPONSE

>curl
--user username:passkey
--url https://www.availabilityexchange.com/gateway/getallavailability?business_id=16609&unit_id=27796&start_date=2021-09-15&end_date=2021-09-01

{
    "unit_id": 27796,
    "capacity": 0,
    "query_start": "2021-09-15",
    "query_end": "2021-09-01",
    "availability": null,
    "response_errors":
    [
        "The start date is after the end date"
    ]
}