Charter Boats API
Bookings

Create Booking

Create a new booking request

POST/bookings

Create a booking request for a boat. The booking starts in pending status and must be confirmed by the boat owner (unless instant booking is enabled).

This endpoint requires user authentication via Supabase Auth.

Request Body

FieldTypeRequiredDescription
boat_idstringYesID of the boat to book
start_datestringYesStart date (YYYY-MM-DD)
end_datestringYesEnd date (YYYY-MM-DD)
start_timestringYesStart time (HH:MM, 24-hour)
end_timestringYesEnd time (HH:MM, 24-hour)
guestsintegerYesNumber of guests
messagestringNoMessage to the boat owner

Request

curl -X POST https://charter.boats/api/bookings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <supabase-auth-token>" \
  -d '{
    "boat_id": "550e8400-e29b-41d4-a716-446655440000",
    "start_date": "2026-02-15",
    "end_date": "2026-02-15",
    "start_time": "09:00",
    "end_time": "17:00",
    "guests": 6,
    "message": "Celebrating a birthday!"
  }'

Response

{
  "id": "booking-uuid",
  "boat_id": "550e8400-e29b-41d4-a716-446655440000",
  "user_id": "user-uuid",
  "status": "pending",
  "start_date": "2026-02-15",
  "end_date": "2026-02-15",
  "start_time": "09:00",
  "end_time": "17:00",
  "guests": 6,
  "total_price": 2800,
  "message": "Celebrating a birthday!",
  "created_at": "2026-01-27T10:30:00Z"
}

Response Fields

FieldTypeDescription
idstringCreated booking ID
statusstringInitial status (pending or confirmed for instant book)
total_pricenumberCalculated total price

Errors

StatusMessage
400Boat is not available for the selected dates
400Number of guests exceeds boat capacity
400Booking duration is below minimum required hours
401Authentication required

On this page