# Booking API

The API allows the APP and POS to send and receive information about bookings. Booking partners create reservations that appear in the POS; POS systems create walk-in bookings that appear in the booking system. The API also supports listing and retrieving bookings, and fetching the events associated with a booking.


Version: 1.0

## Servers

Production
```
https://api.tyro.com/connect
```

## Security

### JWT

Type: openIdConnect
OpenID Connect URL: https://auth.connect.tyro.com/.well-known/openid-configuration

## Download OpenAPI description

[Booking API](https://docs.connect.tyro.com/_bundle/api-explorer/booking/1.0/index.yaml)

## Other

### Create booking

 - [POST /bookings](https://docs.connect.tyro.com/api-explorer/booking/1.0/other/create-booking-request.md): This endpoint is used to create a booking within Tyro Connect. Booking partners use this to create a reservation, which will create a booking in the POS system. POS systems use this to notify Tyro Connect about a new walk-in booking, which will create a booking in the App system. The request body shape differs by audience — see the two request examples below.

The id that is returned as a part of the response should be used to identify the booking for subsequent events or retrieving the details via the GET endpoint or during updates via the PATCH endpoint.

### List bookings

 - [GET /bookings](https://docs.connect.tyro.com/api-explorer/booking/1.0/other/list-bookings.md): POS only.

This endpoint returns all the bookings of a given location. The list of bookings is paginated and it is possible to apply filters to the bookings being fetched.

## Filtering

The filtering options use an "OR" clause within the same filter criteria and an "AND" clause between criteria.

This means that a request with bookingStatus=ACCEPTED&tableNumber=10 will return the bookings that were ACCEPTED and that have table 10 associated.

A request with tableNumber=22&tableNumber=10 will return the bookings that have either table 22 or table 10.

## Pagination

The paginated results are ordered using the sequence they were created in the Tyro Connect. For example results[0] on page 1 is the first matching booking that was created in the Tyro Connect system.

Please Note: Results are not sorted by date. If you require the results to be sorted make sure you fetch all the pages before applying a sort to the list of records.

### Get booking

 - [GET /bookings/{bookingId}](https://docs.connect.tyro.com/api-explorer/booking/1.0/other/get-booking.md): This endpoint is for fetching the details of a booking.

### Update booking

 - [PATCH /bookings/{bookingId}](https://docs.connect.tyro.com/api-explorer/booking/1.0/other/patch-booking.md): This endpoint is for updating a booking.

### Get booking events

 - [GET /bookings/{bookingId}/events](https://docs.connect.tyro.com/api-explorer/booking/1.0/other/get-booking-events.md): POS only.

This endpoint is for fetching the events associated with a booking. The events are ordered with the most recent event first.

