Reserving my first seat
Seating services deals with seat reservations and seat allocation. A seat is a physical seat in some sort of transport. A seat have a seat type, which gives the seat some special traits. It could either be an upgraded seat type, or it could be a zone in the transport for special purposes. The information about the seats and seat types should be defined in the seat allocation system, Plads 90.
Seating services requires a Bearer Token in the Authorization header created by the Entur Authentication server for every request.
The simplest way to check the capacity is to find all available seats on a departure between two stops. The identification of the departure is the original dated service journey that is created in the timetable module. The stops are given on the format from the Nasjonalt Stoppestedsregister.
In this example we use the departure ENT:DatedServiceJourney:2838, the origin NSR:StopPlace:337 (Oslo) and the destination NSR:StopPlace:548 (Bergen).
We receive a 200 Ok, and a list of all the different seats available with their associated information. The seats are grouped into railcars, with an id and a type, which is information from Plads90. Each of the railcars are again grouped into compartments, and here the available seats are listed. In this response we have three different railcars, with different seat types in each of them.
Reserving a Seat
There are different ways of reserving seats. The example request here reserve some specific targeted seats. For other reservation methods see REF. For all reservations one must define on what departure one wishes to reserve seats, between which stop places, and also what status the seat should have. In addition the request needs to have information that tells us which seats to reserve.
In this example we use the same departure, origin and destination as we used when we checked the capacity. The status is set to CONFIRMED to make a hard reservation. We choose the first seat in the capacity we got above, from railcar 1, with seatTypeId 36, and the seatNumber 3. The response returns a 201 Created, and information of the reservation that was made.