Booking API
Complete API reference for booking and reservation management.
Base Endpoint
/api/v1/bookings
List Bookings
Get a paginated list of bookings.
GET /api/v1/bookings
Query Parameters
| Parameter | Type | Description |
|---|---|---|
customer_id | string | Filter by customer |
venue_id | string | Filter by venue |
status | string | Filter by status (pending, confirmed, cancelled, completed) |
date_from | string | Filter from date |
date_to | string | Filter to date |
page | integer | Page number |
limit | integer | Items per page |
Example Response
{
"data": [
{
"id": "book_123",
"customer_id": "cus_12345",
"venue_id": "ven_123",
"venue_name": "Restaurant A",
"type": "table",
"date": "2024-02-15",
"time": "19:00",
"duration": 120,
"guests": 4,
"status": "confirmed",
"created_at": "2024-01-20T10:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150
}
}
Get Booking
Get booking details.
GET /api/v1/bookings/{booking_id}
Example Response
{
"data": {
"id": "book_123",
"customer": {
"id": "cus_12345",
"name": "John Doe",
"phone": "+1234567890"
},
"venue": {
"id": "ven_123",
"name": "Restaurant A",
"address": "123 Main St"
},
"type": "table",
"date": "2024-02-15",
"time": "19:00",
"duration": 120,
"guests": 4,
"special_requests": "Window seat preferred",
"status": "confirmed",
"check_in_code": "ABC123",
"created_at": "2024-01-20T10:00:00Z",
"updated_at": "2024-01-20T10:00:00Z"
}
}
Create Booking
Create a new booking.
POST /api/v1/bookings
Request Body
{
"customer_id": "cus_12345",
"venue_id": "ven_123",
"type": "table",
"date": "2024-02-15",
"time": "19:00",
"duration": 120,
"guests": 4,
"special_requests": "Window seat preferred"
}
Example Response
{
"data": {
"id": "book_123",
"status": "confirmed",
"check_in_code": "ABC123",
"qr_code": "https://...",
"created_at": "2024-01-20T10:00:00Z"
}
}
Update Booking
Update booking details.
PATCH /api/v1/bookings/{booking_id}
Request Body
{
"date": "2024-02-16",
"time": "20:00",
"guests": 5
}
Cancel Booking
Cancel a booking.
POST /api/v1/bookings/{booking_id}/cancel
Request Body
{
"reason": "Change of plans"
}
Check In
Check in for a booking.
POST /api/v1/bookings/{booking_id}/checkin
Request Body
{
"check_in_code": "ABC123"
}
Venue Management
List Venues
Get available venues.
GET /api/v1/venues
Query Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by type (restaurant, event, service) |
location | string | Filter by location |
available | boolean | Only available venues |
Example Response
{
"data": [
{
"id": "ven_123",
"name": "Restaurant A",
"type": "restaurant",
"address": "123 Main St",
"phone": "+1234567890",
"capacity": 50,
"available_slots": [
{
"date": "2024-02-15",
"times": ["19:00", "19:30", "20:00"]
}
]
}
]
}
Get Venue Availability
Get venue availability for a date range.
GET /api/v1/venues/{venue_id}/availability
Query Parameters
| Parameter | Type | Description |
|---|---|---|
date_from | string | Start date |
date_to | string | End date |
type | string | Booking type (table, slot, ticket) |
Example Response
{
"data": {
"venue_id": "ven_123",
"availability": [
{
"date": "2024-02-15",
"slots": [
{
"time": "19:00",
"available": true,
"capacity": 4
},
{
"time": "19:30",
"available": false,
"capacity": 0
}
]
}
]
}
}