Back to portfolioAPI specification
Cinema booking API
REST API for a cinema website: show schedule, seat booking and payment with loyalty bonus points, described in OpenAPI 3.0.
- OpenAPI 3.0
- REST
- JSON
Task
Design a REST API for a cinema website: online schedule and seat booking, extended with a loyalty program (paying with bonus points, and reports on bonus usage).
Approach
- Started by fixing the scope with explicit assumptions: one hall; a booking may hold several seats, but for one movie and one show; loyalty registration is out of scope.
- Modeled three objects: shows (with seats and prices), bookings (status new → paid / canceled) and loyalty clients.
- Designed 7 REST methods covering the customer journey (check available seats, book, change the show, cancel, pay) plus two loyalty reports.
- Payment takes only two amounts, card and bonus points; card details are entered in the payment provider's widget. Bonus points can cover up to 50% of the booking cost.
- Defined exact calculation rules for both reports and flagged an ambiguity to clarify with the customer: a bonus card is attached, but no points were spent.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /availMovieShows | Available shows and seats |
| POST | /reservation | Book seats |
| PATCH | /reservation/{reservationId}/show | Change the show |
| PATCH | /reservation/{reservationId}/cancel | Cancel a booking |
| PATCH | /reservation/{reservationId}/pay | Pay (card + bonus points) |
| GET | /reservation/countBonusReserv | Report: paid bookings with a bonus card |
| GET | /reservation/countBonusPay | Report: share of cost paid with bonus points |
API reference
Spec descriptions are in Russian.
Loading API reference…