Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/raczkodavid/Tikera/llms.txt

Use this file to discover all available pages before exploring further.

The Bookings API lets authenticated users reserve seats for a screening, view their booking history, and cancel upcoming reservations. All booking endpoints require a valid Bearer token. The API validates seat availability in real time and prevents double-booking.
All bookings endpoints require authentication. Include Authorization: Bearer {token} on every request.

GET /api/bookings

Returns all bookings belonging to the authenticated user, with nested movie and room details.
curl http://localhost:8000/api/bookings \
  -H "Authorization: Bearer {token}"
Response
{
  "status": "success",
  "message": "OK",
  "data": [
    {
      "id": 1,
      "user_id": 3,
      "screening_id": 5,
      "seats": [{ "row": 2, "seat": 4 }, { "row": 2, "seat": 5 }],
      "ticket_types": [{ "type": "normal", "quantity": 2 }],
      "total_price": "5000.00",
      "status": "confirmed",
      "screening": {
        "id": 5,
        "date": "2025-05-15",
        "start_time": "18:00:00",
        "movie": { "id": 1, "title": "Inception", "genre": "Sci-Fi" },
        "room": { "id": 1, "name": "Grand Hall" }
      }
    }
  ]
}

GET /api/bookings/

Returns a single booking. Returns 403 if the booking belongs to a different user.
curl http://localhost:8000/api/bookings/1 \
  -H "Authorization: Bearer {token}"

POST /api/bookings

Creates a new booking. The API checks seat availability, validates seat positions against the room dimensions, and calculates the total price from the ticket types.
screening_id
integer
required
ID of the screening to book. The screening must be in the future — past screenings return 422.
seats
array
required
Array of seat objects. Minimum 1 seat required.
ticket_types
array
required
Array of ticket type selections.
Price calculation total_price = screening.base_price × ticket_type.price_multiplier × quantity (summed across all ticket types)
If any requested seat is already taken by another confirmed booking, the API returns 422 with the message “Seat row , number is already taken”. Always check seat availability via the screenings endpoint before booking.
curl -X POST http://localhost:8000/api/bookings \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "screening_id": 5,
    "seats": [
      { "row": 2, "number": 4 },
      { "row": 2, "number": 5 }
    ],
    "ticket_types": [
      { "type": "normal", "quantity": 2 }
    ]
  }'
Returns 200 with the created booking object (status: "confirmed") including nested screening, movie, and room data.

DELETE /api/bookings/

Cancels a booking by deleting it. Returns 403 if the booking belongs to a different user. Returns 422 if the screening has already started.
You can only cancel bookings for future screenings. Once the screening start time has passed, cancellation is not permitted.
curl -X DELETE http://localhost:8000/api/bookings/1 \
  -H "Authorization: Bearer {token}"
Returns 204 No Content on success.

Error reference

StatusMeaning
401Missing or invalid Bearer token
403Booking belongs to a different user
422Validation error — seat taken, past screening, invalid seat position, or invalid ticket type
500Unexpected server error

Build docs developers (and LLMs) love