Skip to main content

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

ParameterTypeDescription
customer_idstringFilter by customer
venue_idstringFilter by venue
statusstringFilter by status (pending, confirmed, cancelled, completed)
date_fromstringFilter from date
date_tostringFilter to date
pageintegerPage number
limitintegerItems 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

ParameterTypeDescription
typestringFilter by type (restaurant, event, service)
locationstringFilter by location
availablebooleanOnly 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

ParameterTypeDescription
date_fromstringStart date
date_tostringEnd date
typestringBooking 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
}
]
}
]
}
}