GET Availability


GetAvailability() returns the availability for a unit and date range.  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.

Note: Once the advertiser has organized the units into unit_groups, units will no longer be accessible. 

REQUEST


End Point 
    https://www.availabilityexchange.com/gateway/getavailability
Parameters
    business_id (64-bit integer)
        unique id of the business.  More than one id can be specified
    unit_id (32-bit integer)
        unique id of the unit.  More than one id can be specified
    unit_group_id (32-bit integer)
        unique id of the unit group.  At most one of unit_id and unit_group_id can be specified.  If both are omitted, the availability will be presented in the default configuration for the property, depending on whether or not they have unit groups set up 
    start_date (date YYYY-MM-dd)
        the first date requested
    end_date (date YYYY-MM-dd)
        the last date requested

EXAMPLE REQUEST

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


RESPONSE


response_errors (See Response Errors)
unit_id (32-bit integer)
    the unique identifier for the unit.  This will be omitted if the request was not sent with a unit_id
unit_group_id (32-bit integer)
    the unique identifier for the unit group.  This will be omitted if the request was not sent with a unit_group_id
capacity (32-bit integer)
    the maximum number of adults this unit can hold
query_start (date YYYY-MM-dd)
    the first date returned
query_end (date YYYY-MM-dd)
    the last date returned
availability (string)
    comma separated list for each date. If called with a unit_id, this string will be 0 for each day the unit is occupied, 1 for available. If called with a unit_group_id, the string will contain the number of units in that unit group available per date in the range requested.

EXAMPLE RESPONSE

{
    "response_errors": [],
    "unit_id": 27796,
    "capacity": 4,
    "query_start": "2021-09-01",
    "query_end": "2021-09-04",
    "availability": "1,1,0,1"
}


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/getavailability?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"
    ]
}