Back to portfolio
API 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

MethodPathPurpose
GET/availMovieShowsAvailable shows and seats
POST/reservationBook seats
PATCH/reservation/{reservationId}/showChange the show
PATCH/reservation/{reservationId}/cancelCancel a booking
PATCH/reservation/{reservationId}/payPay (card + bonus points)
GET/reservation/countBonusReservReport: paid bookings with a bonus card
GET/reservation/countBonusPayReport: share of cost paid with bonus points

API reference

Spec descriptions are in Russian.

Loading API reference…