Availability Details
Documentation for GET /api/v1/public/availability endpoint.
- Request
- Success Response
- Error Response
GET https://staging.villra.com/api/v1/public/availability?filter[property_id]=78c7e569-12cb-44dc-ac67-5503b146e106&filter[date][gte]=2025-05-31&filter[date][lte]=2025-06-01
{
"rooms": [
{
"roomId": "c3f94a27-8db1-4f29-9e2c-c7f1a5d76b33",
"room": {
"title": "Garden View Deluxe",
"occ_adults": 4,
"occ_children": 2,
"occ_infants": 1,
"Photo": [
{
"id": "d5a48f2e-3c1b-4e88-8b7f-9a2e1b03d4f1",
"url": "https://cdn.example.com/rooms/thumbnail-xyz123.jpg",
"description": "Main bed and garden balcony",
"position": 1
}
],
"facilities": [
"wifi",
"air_conditioning",
"minibar"
]
},
"isAvailable": true,
"ratePlansAvailability": [
{
"ratePlanId": "a7e2b6d4-64c5-4b12-9f8d-2b1375a9ec01",
"title": "Flexible Rate – Garden Deluxe",
"isAvailable": true,
"totalRate": 1250.75
},
{
"ratePlanId": "f9d8c7b2-1d6f-4a03-8e4b-6c2a4e9f7d55",
"title": "Non-Refundable – Garden Deluxe",
"isAvailable": false,
"totalRate": 0
}
]
},
{
"roomId": "b2e5c6d1-4a7e-4f32-8b7a-3d5c9f8e2a44",
"room": {
"title": "Poolside Family Suite",
"occ_adults": 6,
"occ_children": 3,
"occ_infants": 2,
"Photo": [],
"facilities": []
},
"isAvailable": false,
"ratePlansAvailability": [
{
"ratePlanId": "c4a8e9d7-5b2f-47a1-9d8b-1e2f3c4d5b6e",
"title": "Family Package – Poolside",
"isAvailable": false,
"totalRate": 0
}
]
},
{
"roomId": "e4f2b3a9-6d1c-4f7b-a0d9-2e5b4c3f1a8f",
"room": {
"title": "Penthouse Suite – Skyline View",
"occ_adults": 2,
"occ_children": 1,
"occ_infants": 0,
"Photo": [
{
"id": "a3c5e7f9-2b8d-4e0f-a6c3-b1d4f9e7c2b8",
"url": "https://cdn.example.com/rooms/penthouse-view-789.jpg",
"description": null,
"position": 1
},
{
"id": "b7d3f1e2-9c5a-4b6d-8f2e-e4c9a7h8g5k1",
"url": "https://cdn.example.com/rooms/penthouse-living-321.jpg",
"description": "Living area overlooking city lights",
"position": 2
}
],
"facilities": [
"jacuzzi",
"private_terrace"
]
},
"isAvailable": true,
"ratePlansAvailability": [
{
"ratePlanId": "d1e2f3a4-b5c6-47d8-9e0f-1a2b3c4d5e6f",
"title": "Bed-&-Breakfast – Penthouse",
"isAvailable": true,
"totalRate": 3420.00
},
{
"ratePlanId": "g7h8i9j0-1a2b-3c4d-5e6f-7g8h9i0j1k2l",
"title": "Advance Purchase – Penthouse",
"isAvailable": true,
"totalRate": 2980.50
}
]
}
],
"meta": {
"filters": {
"date": {
"gte": "2025-05-31",
"lte": "2025-06-01"
},
"property_id": "78c7e569-12cb-44dc-ac67-5503b146e106"
}
}
}
{
"error": {
"code": "INVALID_PARAMETERS",
"message": "filter[date][gte] must be a valid date in YYYY-MM-DD format",
"details": [
{
"field": "filter[date][gte]",
"issue": "invalid_date_format"
}
]
}
}
Notes on the Randomized Fields
roomsarray length: Expanded to three rooms (instead of one).
roomIdvalues: Each replaced with new UUIDs (c3f94a27-…,b2e5c6d1-…,e4f2b3a9-…).Room Titles:
"Garden View Deluxe""Poolside Family Suite""Penthouse Suite – Skyline View"Occupancy Values (
occ_adults,occ_children,occ_infants): Changed to realistic numbers per room type.Photo arrays:
- First room has a single photo object with new
id,url, and non-nulldescription.- Second room’s
Photois an empty array.- Third room includes two photo objects with new IDs, one with
description=null, one with a valid caption.Facilities arrays:
- First room:
["wifi", "air_conditioning", "minibar"]- Second room:
[](no facilities listed)- Third room:
["jacuzzi", "private_terrace"]
isAvailableflags:
- Room 1:
true- Room 2:
false- Room 3:
true
ratePlansAvailabilityentries:
- Each room has between one and two rate plans with randomized
ratePlanId,title, andtotalRate.- Non-available rate plans show
"isAvailable": falsewith"totalRate": 0.- Available plans show
"isAvailable": truewith a non-zerototalRate(e.g.,1250.75,3420.00,2980.50).
meta.filters: Echoes back the filter values exactly as passed in the request.
Field Descriptions​
Top-Level Object​
-
rooms- Type: Array of objects
- Description: List of rooms within the specified property, each containing availability and rate details for the requested date span.
-
meta- Type: Object
- Description: Echo of the filters used in the request. Useful for client-side verification that you received the correct filters.
meta.filters​
-
property_id- Type: String (UUID)
- Example:
"78c7e569-12cb-44dc-ac67-5503b146e106" - Description: The same property ID passed as a query parameter.
-
date.gte- Type: String (
YYYY-MM-DD) - Example:
"2025-05-31" - Description: Start date (inclusive) for the availability check.
- Type: String (
-
date.lte- Type: String (
YYYY-MM-DD) - Example:
"2025-06-01" - Description: End date (inclusive) for the availability check.
- Type: String (
Inside Each Room Object​
roomId​
- Type:
string(UUID) - Example:
"c3f94a27-8db1-4f29-9e2c-c7f1a5d76b33" - Description: Unique identifier of the room. Matches the canonical room record in your database.
room​
-
Type:
object -
Description: Contains metadata about the room itself.
-
title- Type:
string - Example:
"Penthouse Suite – Skyline View" - Description: Human-friendly room name.
- Type:
-
occ_adults- Type:
integer - Example:
2 - Description: Maximum number of adults allowed in this room.
- Type:
-
occ_children- Type:
integer - Example:
1 - Description: Maximum number of children allowed.
- Type:
-
occ_infants- Type:
integer - Example:
0 - Description: Maximum number of infants allowed.
- Type:
-
Photo-
Type: Array of photo objects
-
Description: Zero or more photos associated with this room. Each photo object includes:
id(UUID)url(string)description(string ornull)position(integer)
-
-
facilities- Type: Array of strings
- Example:
["jacuzzi", "private_terrace"] - Description: List of facility codes (e.g.,
"wifi","air_conditioning") or names. If empty, no facilities are specified.
-
isAvailable​
-
Type:
boolean -
Example:
trueorfalse -
Description: Indicates whether any rate plan for this room is available across the entire date range.
truemeans at least one rate plan is fully available fromgtetolte.falsemeans none of the listed rate plans are available throughout the entire date range.
ratePlansAvailability​
-
Type: Array of objects
-
Description: Details for each rate plan linked to this room. Even if the room-level
isAvailableisfalse, you may see one or more plans listed—each with its own availability flag.-
ratePlanId- Type:
string(UUID) - Example:
"d1e2f3a4-b5c6-47d8-9e0f-1a2b3c4d5e6f" - Description: Unique identifier for a specific rate plan.
- Type:
-
title- Type:
string - Example:
"Advance Purchase – Penthouse" - Description: Human-readable name of the rate plan, which often indicates conditions (e.g., refundable, non-refundable).
- Type:
-
isAvailable- Type:
boolean - Example:
trueorfalse - Description: Whether this particular rate plan can be booked for the entire date window.
- Type:
-
totalRate- Type:
number(decimal) - Example:
2980.50 - Description: Total cost in the property’s primary currency for booking this rate plan across all nights between
gteandlte. IfisAvailableisfalse, it is customary to settotalRateto0.
- Type:
-
How to Consume This Endpoint​
-
Construct Your Query: Identify the property UUID and desired date range. For example, if you want availability for Property
78c7e569-12cb-44dc-ac67-5503b146e106from May 31, 2025 through June 1, 2025, you append:?filter[property_id]=78c7e569-12cb-44dc-ac67-5503b146e106
&filter[date][gte]=2025-05-31
&filter[date][lte]=2025-06-01 -
Send the GET Request: Use
curl, Postman, or any HTTP library, ensuring you URL-encode the query parameters if constructing programmatically. -
Parse the JSON Payload:
-
Iterate over the
roomsarray. -
For each room, inspect
isAvailable.- If
true, loop throughratePlansAvailabilityto display available rate plans and theirtotalRate. - If
false, you can surface a “Sold Out” or “No Availability” message for that room.
- If
-
-
Apply Business Logic:
- Display room names and photos to end users.
- Highlight which rate plans are available (and at what price).
- If you implement dynamic pricing, adjust front-end labels based on
totalRate.
Quick Reference Table​
| Field | Type | Description |
|---|---|---|
rooms | array[object] | List of room availability details. |
rooms[].roomId | string (UUID) | Unique identifier for a room. |
rooms[].room.title | string | Human-readable room name. |
rooms[].room.occ_adults | integer | Max number of adults allowed. |
rooms[].room.occ_children | integer | Max number of children allowed. |
rooms[].room.occ_infants | integer | Max number of infants allowed. |
rooms[].room.Photo | array[object] | List of photo objects (ID, URL, description, position). |
rooms[].room.facilities | array[string] | List of facility codes/names (may be empty). |
rooms[].isAvailable | boolean | True if at least one rate plan is available for entire date range. |
rooms[].ratePlansAvailability | array[object] | Detailed availability per rate plan. |
rooms[].ratePlansAvailability[].ratePlanId | string (UUID) | Unique ID of the rate plan. |
rooms[].ratePlansAvailability[].title | string | Descriptive rate plan name. |
rooms[].ratePlansAvailability[].isAvailable | boolean | True if this rate plan is fully bookable. |
rooms[].ratePlansAvailability[].totalRate | number (decimal) | Total cost for this rate plan across requested dates (0 if unavailable). |
meta.filters.property_id | string (UUID) | Echo of the requested property ID. |
meta.filters.date.gte | string (YYYY-MM-DD) | Echo of the start date (inclusive). |
meta.filters.date.lte | string (YYYY-MM-DD) | Echo of the end date (inclusive). |