GET CALENDAR



GET

CALENDAR

GetCalendar()

GetCalendar() returns the availability, rate, extra adult cost, minimum stay, and number of units in for unit groups in the specified property.  The start_date, end_date define stay dates. These are not the check_in and check_out dates of a possible itinerary.  The end_date is inclusive.


Request

End Point 

https://www.availabilityexchange.com/gateway/getcalendar
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

    unit_group_id (32-bit integer) (optional)
        unique id of the unit group.  More than 1 unit group id may be specified as a comma separated list.

Request Example

>curl
--user username:passkey
--url  https://www.availabilityexchange.com/gateway/getcalendar?business_id=16609&unit_group_id=17800&start_date=2024-10-14&end_date=2023-10-19&unit_group_id=27150,18128

Response

response_errors (See Response Errors)

business_id (64-bit integer)

    the unique identifier for this business

calendars(list of objects)

    Calendar Object:

        unit_group_id (32-bit integer)

            the unique identifier for the unit group.

        currency (string)

            the currency code used by the property for the unit group.

        data (list of objects)

            Data object:

                start_date (date YYYY-MM-dd)

                  the beginning of the days the rest of the data object applies to.

                end_date (date YYYY-MM-dd)

                  the last of the days the rest of the data object applies to (inclusive).

                price (decimal)

                  the price per night.

                available_units (32-bit integer)

                  the number of available units.

                booked_units (32-bit integer)

                  the number of booked units.

                blocked_units (32-bit integer)

                  the number of blocked units.

                adults_included_in_rate (int)

                  the number of adults included in the rate. Price reflects any booking for a number of adults less than or equal to adults_included_in_rate.

                extra_adult_rate (decimal) (optional)

                  if set, cost per additional adult beyond the adults_included_in_rate.

                min_stay(int) (optional)

                  if set, minimum number of nights guests are requried to book on reservations starting within the range.

        multi_unit (object)

            total_units (int)

                the number of units in the unit group.

            unit_ids (list of strings)

                the unit ids of the units in the unit group.

Response Example

{

  "business_id": 16609,

  "calendars": [

    {

      "unit_group_id": 27150,

      "currency": "USD",

      "data": [

        {

          "start_date": "2024-10-14",

          "end_date": "2024-10-19",

          "price": 10.0000,

          "available_units": 4,

          "booked_units": 0,

          "blocked_units": 0,

          "adults_included_in_rate": 0,

          "extra_adult_rate": 10.0000,

          "min_stay": 2

        }

      ],

      "multi_unit": {

        "total_units": 4,

        "unit_ids": [

          "27829",

          "27830",

          "27828",

          "27801"

        ]

      }

    },

    {

      "unit_group_id": 18128,

      "currency": "USD",

      "data": [

        {

          "start_date": "2024-10-14",

          "end_date": "2024-10-18",

          "price": 150.0000,

          "available_units": 3,

          "booked_units": 2,

          "blocked_units": 0,

          "adults_included_in_rate": 2,

          "extra_adult_rate": 10.0000,

          "min_stay": 2

        },

        {

          "start_date": "2024-10-19",

          "end_date": "2024-10-19",

          "price": 200.0000,

          "available_units": 3,

          "booked_units": 2,

          "blocked_units": 0,

          "adults_included_in_rate": 2,

          "extra_adult_rate": 10.0000,

          "min_stay": 2

        }

      ],

      "multi_unit": {

        "total_units": 5,

        "unit_ids": [

          "27796",

          "27810",

          "27804",

          "27803",

          "27805"

        ]

      }

    }

  ],

  "response_errors": []

}

Response Errors

200

  response_errors (list of strings)

  • The start date is after the end date
  • The query cannot contain dates before today
  • Group does not exist or is not enabled: <x>

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/getcalendar?business_id=16609&unit_id=27796&start_date=2024-10-14&end_date=2024-09-01

{
    "business_id": 0,
    "calendars": null,
    "response_errors":
    [
        "Invalid dates, end_date is before start_date"
    ]
}

Return to API Endpoints

Share by: