Skip to content

Bookables

Endpoints

MethodPathDescription
GET/wpappointments/v1/bookablesList all bookable entities
POST/wpappointments/v1/bookablesCreate a bookable entity
GET/wpappointments/v1/bookables/{id}Get a single bookable entity
PUT/PATCH/wpappointments/v1/bookables/{id}Update a bookable entity
DELETE/wpappointments/v1/bookables/{id}Delete a bookable entity

All endpoints require the wpa_manage_bookables capability.


GET /bookables

List all bookable entities with optional filtering and pagination.

Parameters

ParameterTypeRequiredDescription
postsPerPageintegerNoNumber of results per page (default: -1 for all)
pagedintegerNoPage number (default: 1)
typestringNoFilter by bookable type slug (e.g. service, room)
activebooleanNoFilter by active status

Response

{
"status": "success",
"message": "Bookables fetched successfully",
"data": {
"bookables": [
{
"id": 10,
"name": "Deep Tissue Massage",
"active": true,
"description": "60-minute deep tissue session",
"type": "service",
"image": "https://example.com/massage.jpg",
"scheduleId": 3,
"bufferBefore": 10,
"bufferAfter": 5,
"minLeadTime": 3600,
"maxLeadTime": 2592000,
"duration": 60,
"attributes": [
{ "name": "Duration", "values": ["30", "60", "90"] }
],
"meta": { ... }
}
],
"totalItems": 12,
"totalPages": 1,
"postsPerPage": -1,
"currentPage": 1
}
}

POST /bookables

Create a new bookable entity. Variants are automatically generated from the attribute matrix.

Parameters

ParameterTypeRequiredDescription
namestringYesDisplay name
typestringNoBookable type slug (e.g. service)
activebooleanNoWhether the entity is active (default: true)
descriptionstringNoDescription text
imagestringNoImage URL
schedule_idintegerNoAssociated schedule post ID
buffer_beforeintegerNoBuffer time before appointments in minutes
buffer_afterintegerNoBuffer time after appointments in minutes
min_lead_timeintegerNoMinimum lead time in seconds
max_lead_timeintegerNoMaximum lead time in seconds
durationintegerNoDefault duration in minutes
attributesarrayNoAttribute definitions, e.g. [{"name": "Duration", "values": ["30", "60"]}]

Type-specific fields defined by the bookable type handler are also accepted and validated.

Response

{
"status": "success",
"message": "Bookable created successfully",
"data": {
"bookable": {
"id": 10,
"name": "Deep Tissue Massage",
"active": true,
"description": "",
"type": "service",
"image": "",
"scheduleId": 0,
"bufferBefore": 0,
"bufferAfter": 0,
"minLeadTime": 0,
"maxLeadTime": 0,
"duration": 60,
"attributes": [],
"meta": { ... }
}
}
}

GET /bookables/{id}

Get a single bookable entity by ID.

Parameters

ParameterTypeRequiredDescription
idintegerYesBookable entity ID (URL parameter)

Response

{
"status": "success",
"message": "Bookable fetched successfully",
"data": {
"bookable": { ... }
}
}

PUT/PATCH /bookables/{id}

Update an existing bookable entity. If attributes are changed, variants are regenerated from the new matrix.

Parameters

ParameterTypeRequiredDescription
idintegerYesBookable entity ID (URL parameter)
namestringNoUpdated display name
typestringNoUpdated bookable type slug
activebooleanNoUpdated active status
descriptionstringNoUpdated description
imagestringNoUpdated image URL
schedule_idintegerNoUpdated schedule ID
buffer_beforeintegerNoUpdated buffer before
buffer_afterintegerNoUpdated buffer after
min_lead_timeintegerNoUpdated minimum lead time
max_lead_timeintegerNoUpdated maximum lead time
durationintegerNoUpdated default duration
attributesarrayNoUpdated attribute definitions (triggers variant regeneration)

Response

{
"status": "success",
"message": "Bookable updated successfully",
"data": {
"bookable": { ... }
}
}

DELETE /bookables/{id}

Delete a bookable entity and all its variants (cascade delete).

Parameters

ParameterTypeRequiredDescription
idintegerYesBookable entity ID (URL parameter)

Response

{
"status": "success",
"message": "Bookable deleted successfully",
"data": {
"id": 10
}
}