Filtering Reservations
Ulyses Cloud knows reservations as the collection of ReservationRoomStays. Hence, a reservation can be formed by 1 to N reservationRoomStays. Ulyses Cloud allows you to filter the property ReservationRoomStay based on different options. You can find the technical specification in the entity page and in the API endpoint page dedicated to ReservationRoomStay.
Use cases of the filters
Filtering reservations by booking number
Ulyses PMS identifies reservations by means of up to 4 different locators (OTA locator, CRS locator, CRS locator and Channel Manager locator). If we want to search a reservation by a specific locator we will utilize the following endpoint and we will filter by the locator afterwards. We can perform the same operation but requesting all the reservation room stays and then applying the same filter.Â
Filtering by status
Let's say that you need to know a property's inHouse reservations. "inHouse" refers to a status, and these can be checked at reservationStatusType endpoint. If you use that endpoint you will find a list similar to this one:
[{ "id": 1, "code": "RES", "name": "Reserved" }, { "id": 2, "code": "CAN", "name": "Cancelled" }, { "id": 3, "code": "NS", "name": "NoShow" }, { "id": 4, "code": "IH", "name": "InHouse" }, { "id": 5, "code": "CO", "name": "CheckedOut" }]
You can use the id 3 in the reservationRoomStay endpoint like this:
http://{ulysescloudURL}/public/api/v1/chain/1/property/3/reservation?reservationStatusTypeIdList=4
Filtering by the reservationRoomStays arriving today
To check which reservationRoomStays are arriving today we use the arrivalFrom/arrivalTo filters. These are a range of days, but if we use the same date on both you will get the arrivals for a single date. Remember that the date format is yyyy-MM-dd! That can be applied to departureFrom/departureTo, stayFrom/stayTo and createdFrom/createdTo (the format on these last two is yyyy-MM-dd'T'HH:mm:ss.SSS'Z' ). The url would look like this:
http://{ulysescloudURL}/public/api/v1/chain/1/property/3/reservationRoomStay?arrivalFrom=2018-12-18&arrivalTo=2018-12-18
Filtering by reservationRoomStays pending to checkIn
Using the mentioned filters you can get the pending to checkIn reservationRoomStay. Since "reserved" is a status you can ask for the status in the ReservationStatusType endpoint and then use its Id in the ReservationRoomStay filters. To set an arrival date set arrivalFrom/arrivalTo filters to the same date value. It would look like this:
http://{ulysescloudURL}/public/api/v1/chain/1/property/3/reservationRoomStay?arrivalFrom=2018-12-18&arrivalTo=2018-12-18&reservationStatusTypeId=1
Filtering by reservationRoomStays departing today
To check which reservationRoomStay are arriving today we use the departureFrom/departureTo filters. These are a range of days, but if we use the same date on both you will get the departures for a single date. Remember that the format is yyyy-MM-dd! That can be applied to arrivalFrom/arrivalTo, stayFrom/stayTo and createdFrom/createdTo (the format on these last two is yyyy-MM-dd'T'HH:mm:ss.SSS'Z' ). The url would look like this:
http://{ulysescloudURL}/public/api/v1/chain/1/property/3/reservationRoomStay?departureFrom=2018-12-18&departureTo=2018-12-18
Filtering by reservationRoomStays pending to depart today
Since all the reservationRoomStays that should depart today and haven't done the checkout are in the status "inHouse" you can ask for the status in the ReservationStatusType endpoint and then use its Id in the ReservationRoomStay filters. To set a departure date set departureFrom/departureTo filters to the same date value. It would look like this:
http://{ulysescloudURL}/public/api/v1/chain/1/property/3/reservationRoomStay?departureFrom=2018-12-18&departureTo=2018-12-18&reservationStatusTypeId=4