curl --request POST \
--url https://api.example.com/api/agenda/bookings \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"staff_id": "<string>",
"item_type": "<string>",
"item_id": "<string>",
"status": "<string>",
"booking_date": "<string>",
"start_time": "<string>",
"end_time": "<string>",
"duration": 123,
"notes": "<string>"
}
'{
"booking_id": "<string>",
"client_id": "<string>",
"client": {
"name": "<string>",
"surname": "<string>",
"phone": "<string>"
},
"staff_id": {},
"staff": {
"name": "<string>",
"surname": "<string>"
},
"item_type": "<string>",
"item_id": "<string>",
"status": "<string>",
"booking_date": "<string>",
"start_time": "<string>",
"end_time": "<string>",
"duration": 123,
"notes": {},
"created_at": "<string>",
"updated_at": "<string>",
"401 Unauthorized": {},
"400 Bad Request": {}
}Create a new booking for a service or pack
curl --request POST \
--url https://api.example.com/api/agenda/bookings \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"staff_id": "<string>",
"item_type": "<string>",
"item_id": "<string>",
"status": "<string>",
"booking_date": "<string>",
"start_time": "<string>",
"end_time": "<string>",
"duration": 123,
"notes": "<string>"
}
'{
"booking_id": "<string>",
"client_id": "<string>",
"client": {
"name": "<string>",
"surname": "<string>",
"phone": "<string>"
},
"staff_id": {},
"staff": {
"name": "<string>",
"surname": "<string>"
},
"item_type": "<string>",
"item_id": "<string>",
"status": "<string>",
"booking_date": "<string>",
"start_time": "<string>",
"end_time": "<string>",
"duration": 123,
"notes": {},
"created_at": "<string>",
"updated_at": "<string>",
"401 Unauthorized": {},
"400 Bad Request": {}
}end_time based on the provided start_time and duration if not explicitly provided.
auth_token cookie.
Authorization: Bearer YOUR_TOKEN
service, packpending: Default status for new bookingsconfirmed: Pre-confirmed bookingcompleted: Mark as completedcancelled: Create as cancelledno_show: Mark as no-show2024-03-15 or 2024-03-15T00:00:00.000Z)09:30, 14:00start_time + durationend_time if not explicitly providedExample: 60 for 1 hour, 90 for 1.5 hoursservice or packcurl -X POST 'https://api.beils.com/api/agenda/bookings' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"client_id": "client-uuid-123",
"staff_id": "staff-uuid-456",
"item_type": "service",
"item_id": "service-uuid-789",
"booking_date": "2024-03-15",
"start_time": "10:00",
"duration": 60,
"notes": "First time client"
}'
{
"booking_id": "new-booking-uuid-123",
"client_id": "client-uuid-123",
"client": {
"name": "María",
"surname": "García",
"phone": "+34 600 123 456"
},
"staff_id": "staff-uuid-456",
"staff": {
"name": "Ana",
"surname": "López"
},
"item_type": "service",
"item_id": "service-uuid-789",
"status": "pending",
"booking_date": "2024-03-15T00:00:00.000Z",
"start_time": "10:00",
"end_time": "11:00",
"duration": 60,
"notes": "First time client",
"created_at": "2024-03-05T09:30:00.000Z",
"updated_at": "2024-03-05T09:30:00.000Z"
}
{
"statusCode": 401,
"statusMessage": "Unauthorized: Token is missing or invalid"
}
client_id, item_type, item_id, booking_date, start_time)end_time is not provided, it’s automatically calculated: end_time = start_time + duration23:30 + 60 minutes = 00:30)pending if not specifiedstaff_id field is optional and can be assigned later via the update endpoint