List Bookings

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.

Request
Security:
query Parameters
locationId
required
string

The Tyro Connect Location Id of the bookings to be retrieved. This parameter is required.

assetType
string (assetType)

Returns results for matching asset.type values

Enum: "ROOM" "TABLE"
Example: assetType=ROOM
tableNumber
string

Returns results based on the table.number of a booking.

Can be a single string or multi string value.

Example: tableNumber=outside-table-3
bookingStatus
string

Returns results based on the status of a booking.

Can be a single string or multi string value.

Enum: "CREATED" "ACCEPTED" "CANCELLED_BY_CUSTOMER" "CANCELLED_BY_MERCHANT" "REJECTED"
fromDate
string <date>

Returns results that have a "startTime" later than or equal to the provided value.

Format: YYYY-MM-DD

Example: fromDate=2021-04-28
toDate
string

Returns results that have a "startTime" before than or equal to the provided value.

Format: YYYY-MM-DD

Example: toDate=2021-04-28
dateType
string
Default: "START"

Determines which booking date information to filter on when searching by date.

Enum: "CREATED" "UPDATED" "START" "END"
limit
number [ 1 .. 50 ]

Specifies the amount of results to be retrieved.

A maximum of 50 results are returned if this value is not provided.

Example: limit=10
page
number >= 1

Specify the page to retrieve.

You will need to use this setting if you wish to retrieve specific pages.

Page-numbering is based on the value of "limit". If limit=5, then page=1 will display the hits from 1 to 5, page=3 will display the hits from 11 to 15.

Page numbers start at 1.

A request for a non-existing page will yield 0 results.

Example: page=2
header Parameters
Accept
required
string
Value: "application/vnd.tyro.connect+json;version=1.0"
Example: application/vnd.tyro.connect+json;version=1.0
Authorization
required
string
Default: Bearer {$$.env.access_token}
Responses
200

The booking list

403

When you don't have the right permissions to fetch the bookings for the provided location

404

When the provided locationId does not exist in our system

get/bookings
Request samples
curl -i -X GET \
  'https://api.tyro.com/connect/bookings?locationId=string&assetType=ROOM&tableNumber=outside-table-3&bookingStatus=CREATED&fromDate=2021-04-28&toDate=2021-04-28&dateType=CREATED&limit=10&page=2' \
  -H 'Accept: application/vnd.tyro.connect+json;version=1.0' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "pagination": {
    },
  • "results": [
    ]
}
Copyright © Tyro Payments 2019-2022. All right reserved.