Set Restrictions

Description

When a client application sends a correctly-formatted Set Room Restrictions message Levart will respond with a corresponding response message indicating success or failure.

During normal operation it is important that a Set Room Restrictions message only contains the changes (delta) that have occurred on the PMS. It is imperative that these changes are pushed as soon as possible to Levart to avoid an over-booking. A nightly 'full sync' of every room type is required to help with consistency.

Direction

PMS → Levart

POST  /rooms/v1/push-restrictions

Endpoint

Specification JSON Request

ElementNumTypeRequiredDescription
MessageID1StringYesUnique Message ID
TimeStamp1DateTimeYesDate and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00
MessageType1StringYesSet to 'SetRoomRestrictions'
RoomRestrictionData1..nArrayYesRoomRestrictionData array, contains the contents of what is required to be updated.
RoomRestrictionData n > RoomTypeCode1StringYesThe Room Type Code or ID for the Room to be updated
RoomRestrictionData n > StartDate1DateYesStart date in YYYY-MM-DD format.
RoomRestrictionData n > EndDate1DateYesEnd date in YYYY-MM-DD format (Inclusive).
RoomRestrictionData n > Closed0..1BooleanOptionaltrue or false, a value of true means room is closed for the period.
RoomRestrictionData n > CTA0..1BooleanOptionaltrue or false, a value of true means room is closed for arrival in the period.
RoomRestrictionData n > CTD0..1BooleanOptionaltrue or false, a value of true means room is closed for departure in the period.

Note

A Set Room Restrictions message must include at least one of the following data elements: CTA,CTD or Closed.


Request Data

{
  "MessageID": "717b3bec-5321-4bad-84c1-075bff67f92c",
  "TimeStamp": "2016-09-28T15:15:00+08:00",
  "MessageType": "SetRoomRestrictions",
  "RoomRestrictionData": [
    {
      "RoomTypeCode": "2BED",
      "StartDate":    "2025-05-08",
      "EndDate":      "2025-05-10",
      "Closed":       true,
      "CTA":          true,
      "CTD":          true
    },
    {
      "RoomTypeCode": "2BED",
      "StartDate":    "2025-05-12",
      "EndDate":      "2025-05-14",
      "CTD":          true
    }
  ]
}

Response Data (Success)

{
  "MessageID": "717b3bec-5321-4bad-84c1-075bff67f92c",
  "TimeStamp": "2016-09-28T15:15:00+08:00",
  "Status": "Success",
  "Messages":  [
       	"Set availability for room 464 - from 2025-05-08 to 2025-05-10 as Open.",
		"Set room 464 - from 2025-05-08 to 2025-05-10 as Closed to arrival.",
		"Set room 464 - from 2025-05-08 to 2025-05-10 as Open to departure.",
		"Set room 464 - from 2025-05-08 to 2025-05-10 as Closed to arrival.",
		"Set room 464 - from 2025-05-08 to 2025-05-10 as Open to departure.",
		"Set room 464 - from 2025-05-08 to 2025-05-10 as Closed to arrival.",
		"Set room 464 - from 2025-05-08 to 2025-05-10 as Open to departure.",
		"Set room 464 - from 2025-05-12 to 2025-05-14 as Closed to departure.",
		"Set room 464 - from 2025-05-12 to 2025-05-14 as Closed to departure.",
		"Set room 464 - from 2025-05-12 to 2025-05-14 as Closed to departure."
}

Response Data (Error)

{
  "MessageID": "717b3bec-5321-4bad-84c1-075bff67f92c",
  "TimeStamp": "2016-09-28T15:15:00+08:00",
  "Status": "Error",
  "ErrorMessage": "Invalid date provided."
}



ErrorMessageDescription
"Malformed StartDate '2018-13-02'."The date is not in the correct format of YYYY-MM-DD
"EndDate '2018-01-13' is before StartDate '2018-01-15'."The end date must be the same or after the start date.


Specification JSON Response

ElementNumTypeDescription
MessageID1StringUnique Message ID (Same as the Request Message ID)
TimeStamp1DateTimeDate and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00
Status1StringElement contains either 'Error' or 'Success'
ErrorMessage0..1StringError message (on error only).
Messages0..nArrayAny update messages (delta)