This resource represents the Availabilities for a given Rental. The map
represents consecutive 1096 days starting from start_date
and tells whether a given day is available (there is no Booking for that day) or unavailable (there is already a Booking for that day).
Availabilities are regenerated after creation of Bookings and at the beginning of each month and start_date
always points to the beginning of current month.
Particularly useful when implementing a UI containing calendar that allows to select dates for a Booking - using this map you can block unavailable dates.
However, this resource doesn’t cover all cases why a given day might be unavailable (e.g. it doesn’t cover Rates Rules). You might want to check ChangeOvers to have a map covering these cases.
Name | Type | Read/Write | Description |
---|---|---|---|
account | Integer | Read | Account’s ID related to the Availability |
rental | Integer | Read | Rental’s ID related to the Availability |
id | Integer | Read | Availability’s id. |
map | String | Read | Availability’s map of booking status. There is a total of 1096 characters, each representing one day. List of statuses described in enums section. |
start_date | Date | Read | Availability’s start date. |
created_at | Time | Read | Availability’s creation time. |
updated_at | Time | Read | Availability’s update time. |
List all availabilities for a given account.
GET /availabilities
{
"links": {
"availabilities.rental": "https://www.bookingsync.com/api/v3/rentals/{availabilities.rental}"
},
"availabilities": [
{
"id": 2,
"map": "11111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"updated_at": "2023-12-11T08:26:27Z",
"start_date": "2023-12-01",
"links": {
"rental": 2
}
}
]
}
Returns a single availability identified by ID.
GET /availabilities/:availability_id
{
"links": {
"availabilities.rental": "https://www.bookingsync.com/api/v3/rentals/{availabilities.rental}"
},
"availabilities": [
{
"id": 2,
"map": "11111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"updated_at": "2023-12-11T08:26:27Z",
"start_date": "2023-12-01",
"links": {
"rental": 2
}
}
]
}
Mapping parameters allow to customize availability start point and status display.
Examples:
GET /availabilities?include_tentative=false&boolean=true&from=20140324
GET /availabilities/1?include_tentative=false&boolean=true&from=20140324
Name | Type | Default | Description |
---|---|---|---|
from | Date | Beginning of current month | Starts mapping at the given date. Default is beginning of current month. |
include_tentative | Boolean | true | Includes tentative bookings by default. If switched to false, tentative statuses will be rendered as 0 . |
boolean | Boolean | false | Render map using only 0 and 1 characters. In this mode, every blocking status will be rendered as 1 . List of statuses described in enums section. |
priced_only | Boolean | false | Show days without nightly rate as unavailable. |