GET AVAILABILITY



GET AVAILABILITY

GetAvailability()

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.
   
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

Request Example

>curl
--user username:passkey
--url  https://www.availabilityexchange.com/gateway/getavailability?business_id=16609&unit_group_id=17800&start_date=2023-09-20&end_date=2023-09-22

Response

response_errors (See Response Errors)

business_id (64-bit integer)

    the unique identifier for this business

children_allowed (boolean)

    true if children are allowed as guests at the property

age_considered_child (32-bit integer)

    a guest is considered a child at this year of age or below

children_included_in_occupancy (boolean)

    if true, children are counted toward the maximum occupancy of the unit

availability (list of objects)

    Availability Object:

        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 total number of people a unit can hold, including adults and children

        max_children (32-bit integer)

            maximum number of children that are allowed for the unit / unit group

        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.

Response Example

{

  "business_id": 16609,

  "children_allowed": true,

  "age_considered_child": 12,

  "children_included_in_occupancy": true,

  "availability": [

  {

  "unit_group_id": 23611,

  "number_of_units": 10,

  "capacity": 4,

  "max_children": 2,

  "query_start": "2024-02-10",

  "query_end": "2024-02-14",

  "availability": "4,4,4,4,4",

  "response_errors": []

  }

  ],

  "response_errors": []

}


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)

B

  Server in maintenance mode

Response Error Example

>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"
    ]
}

Return to API Endpoints

Share by: