Skip to content

Availability

There are two availability systems: the legacy schedule-based availability (used by the original booking flow) and the newer bookable availability (used by the bookable entity system).

Endpoints

MethodPathDescription
GET/wpappointments/v1/availabilityGet month-level day availability
GET/wpappointments/v1/calendar-availabilityGet calendar slot availability
GET/wpappointments/v1/bookable-availability/{variant_id}Get effective availability for a variant
GET/wpappointments/v1/bookables/{entity_id}/availabilityGet availability for all variants of an entity

All endpoints are publicly accessible (no authentication required).


GET /availability

Get per-day availability for a given month. Returns which days have open slots.

Parameters

ParameterTypeRequiredDescription
currentMonthintegerYesMonth number (1-12)
currentYearintegerYesFour-digit year
timezonestringNoIANA timezone string (e.g. Europe/Warsaw)

Response

{
"status": "success",
"message": "Month availability fetched successfully",
"data": {
"availability": {
"month": {
"2026-03-01": true,
"2026-03-02": false,
"2026-03-03": true
}
}
}
}

Each key is a date string and the value indicates whether that day has available slots.


GET /calendar-availability

Get detailed slot-level availability for a calendar view. Used by the front-end booking calendar.

Parameters

ParameterTypeRequiredDescription
calendarstringNoJSON-encoded calendar data object
timezonestringNoIANA timezone string
trimstringNoSet to "true" to trim empty days from the response

Response

{
"status": "success",
"message": "Calendar availability fetched successfully",
"data": {
"availability": { ... }
}
}

The response shape depends on the calendar data provided and the schedule configuration.


GET /bookable-availability/{variant_id}

Get the effective availability for a specific bookable variant. Combines the variant’s schedule, buffer times, and existing appointments to compute open slots.

Parameters

ParameterTypeRequiredDescription
variant_idintegerYesVariant ID (URL parameter)
start_datestringNoStart of the date range to query
end_datestringNoEnd of the date range to query

Response

{
"status": "success",
"message": "Availability fetched successfully",
"data": {
"availability": { ... }
}
}

The response is computed by AvailabilityEngine::get_effective_availability() and contains the resolved availability data for the requested date range.


GET /bookables/{entity_id}/availability

Get availability for all variants of a bookable entity at once. Returns each variant with its computed availability.

Parameters

ParameterTypeRequiredDescription
entity_idintegerYesBookable entity ID (URL parameter)
start_datestringNoStart of the date range to query
end_datestringNoEnd of the date range to query

Response

{
"status": "success",
"message": "Entity availability fetched successfully",
"data": {
"variants": [
{
"variant": {
"id": 20,
"parentId": 10,
"name": "Deep Tissue Massage — 60",
"active": true,
"attributeValues": { "Duration": "60" },
"overrides": [],
"duration": 60,
"scheduleId": 3,
"bufferBefore": 0,
"bufferAfter": 0,
"minLeadTime": 0,
"maxLeadTime": 0,
"meta": { ... }
},
"availability": { ... }
}
]
}
}