Hotel booking: no double bookings

A hotel booking API. Guests search for free rooms for a range of dates and create bookings; the server gives each booking its id. A room can't be booked twice for the same night: the database refuses the second booking. Every booking response carries an ETag, and the app sends it back in If-Match when it changes a booking. Successful changes return the updated booking. The hotel doesn't keep cancelled bookings: cancelling deletes the booking, and a successful delete returns no body.

For each request, choose the method, the path and the status code the server returns. Some of these requests fail.

1.Find rooms that are free from 5 to 8 November.

2.Book room 12 for those dates.

3.A second guest tries to book room 12 for the same nights, a second later.

4.Move booking 77 to 6–9 November (the room is free for those nights), sending only the new dates and the current ETag.

5.The guest changes booking 77 again from a tab opened earlier. Staff edited the booking in between, so the app sends an old ETag in If-Match.

6.Cancel booking 77.

7.The app reloads booking 77 after it was cancelled.

Methods

Paths

Status codes

Tap a slot, then a part. Or drag a part into a slot. Each part can be used many times.