Availability
Endpoints to check available times for bookings.
GET
/api/v1/disponibilidad/{peluquero_id}/{fecha}/
Gets available time slots for a professional on a specific date.
Path parameters
| Parameter | Type | Description |
|---|---|---|
peluquero_id |
integer | Professional ID |
fecha |
string | Date in YYYY-MM-DD format |
Query parameters
| Parameter | Type | Description |
|---|---|---|
servicio_id |
integer | Service ID (to calculate duration) |
servicios |
string | Service IDs separated by comma (for multiple) |
duracion |
integer | Custom duration in minutes |
Request example
cURL
curl -X GET "https://app.salonbookit.com/api/v1/disponibilidad/5/2024-01-20/?servicio_id=15" \
-H "X-API-Key: hh_pub_live_abc123..."
Response (200 OK)
JSON
{
"success": true,
"data": {
"fecha": "2024-01-20",
"profesional": {
"id": 5,
"nombre": "Carlos GarcÃa"
},
"duracion_solicitada": 30,
"slots": [
{
"hora_inicio": "09:00",
"hora_fin": "09:30",
"disponible": true
},
{
"hora_inicio": "09:30",
"hora_fin": "10:00",
"disponible": true
},
{
"hora_inicio": "10:00",
"hora_fin": "10:30",
"disponible": false,
"motivo": "ocupado"
},
{
"hora_inicio": "10:30",
"hora_fin": "11:00",
"disponible": false,
"motivo": "ocupado"
},
{
"hora_inicio": "11:00",
"hora_fin": "11:30",
"disponible": true
}
// ... remaining slots of the day
],
"slots_disponibles_count": 18,
"proximo_disponible": "09:00",
"ultimo_disponible": "19:30"
}
}
Response fields
| Field | Type | Description |
|---|---|---|
fecha |
string | Queried date |
profesional |
object | Professional info |
duracion_solicitada |
integer | Duration used to calculate slots |
slots |
array | List of time slots |
slots[].hora_inicio |
string | Start time (HH:MM) |
slots[].hora_fin |
string | End time (HH:MM) |
slots[].disponible |
boolean | Whether it's available to book |
slots[].motivo |
string | Reason if not available |
Slot interval
Slots are generated in 15 or 30 minute intervals according to business configuration.
GET
/api/v1/disponibilidad/dias/
Gets days with availability in a date range.
Query parameters
| Parameter | Type | Description |
|---|---|---|
peluquero_id |
integer | Professional ID (optional) |
servicio_id |
integer | Service ID |
desde |
string | Start date (YYYY-MM-DD). Default: today |
hasta |
string | End date (YYYY-MM-DD). Default: +30 days |
Request example
cURL
curl -X GET "https://app.salonbookit.com/api/v1/disponibilidad/dias/?peluquero_id=5&servicio_id=15&desde=2024-01-15&hasta=2024-02-15" \
-H "X-API-Key: hh_pub_live_abc123..."
Response (200 OK)
JSON
{
"success": true,
"data": {
"desde": "2024-01-15",
"hasta": "2024-02-15",
"dias": [
{
"fecha": "2024-01-15",
"disponible": true,
"slots_libres": 12,
"primer_slot": "09:00",
"ultimo_slot": "18:30"
},
{
"fecha": "2024-01-16",
"disponible": true,
"slots_libres": 8,
"primer_slot": "11:00",
"ultimo_slot": "19:00"
},
{
"fecha": "2024-01-17",
"disponible": false,
"slots_libres": 0,
"motivo": "completo"
},
{
"fecha": "2024-01-18",
"disponible": false,
"slots_libres": 0,
"motivo": "festivo"
}
// ... remaining days
],
"dias_disponibles_count": 22
}
}
This endpoint is useful for showing a calendar where days without availability appear disabled.
Common errors
| Code | HTTP | Description |
|---|---|---|
PROFESSIONAL_NOT_FOUND |
404 | Professional does not exist |
INVALID_DATE |
400 | Invalid date format (must be YYYY-MM-DD) |
DATE_IN_PAST |
400 | Date is before today |
DATE_TOO_FAR |
400 | Date exceeds advance booking limit |
PROFESSIONAL_NOT_WORKING |
200 | Professional doesn't work that day (empty slots) |