Set Inventory

Description

When a client application sends a correctly-formatted Set Inventory message Levart will respond with a corresponding Set Inventory response message.

During normal operation it is important that a Set Inventory 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.

Note

Levart will subtract any Levart set PMS 'buffer' (that may be set by the property) and also any unconfirmed bookings from any Inventory updates before applying the changes to the Levart system.

Inventory is sent as availability, however the response will show the updated allocation in Levart. If the update matches what is already in the Levart system a Success will be sent, but no "Messages" will be shown.

It is a requirement that update messages are constructed in the most efficient manner. This means that from/to date periods are used where the inventory will be the same. Also the minimal amount of messages should be sent.

Direction

PMS → Levart

Request

{
  "Authentication" : {
    "Username": "abc",
    "Password": "456"
  },
  "MessageID": "717b3bec-5321-4bad-84c1-075bff67f92c",
  "TimeStamp": "2016-09-28T15:15:00+08:00",
  "MessageType": "SetInventory",
  "InventoryData": [
    {
      "RoomTypeCode": "2BED",
      "StartDate": "2018-01-01",
      "EndDate": "2018-01-01",
      "Availability": 2
    },
    {
      "RoomTypeCode": "2BED",
      "StartDate": "2018-01-02",
      "EndDate": "2018-01-03",
      "Availability": 3
    }
  ]
}

Specification JSON Set Inventory Request

ElementNumTypeDescription
Authentication1ObjectAuthentication Object
Authentication > Username1StringUnique Username for this property.
Authentication > Password1StringUnique Password for this property.
MessageID1StringUnique Message ID
MessageType1StringSet to 'SetInventory'
TimeStamp1DateTimeDate and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00
InventoryData1..nArrayInventoryData array, contains the contents of what is required to be updated.
InventoryData n > RoomTypeCode1StringThe Room Type Code or ID for the Room to be updated
InventoryData n > StartDate1DateStart date in YYYY-MM-DD format.
InventoryData n > EndDate1DateEnd date in YYYY-MM-DD format (Inclusive).
InventoryData n > Available1IntegerInteger >= 0, A value of 0 will effectively mean the room is closed out.

Response (Success)  Where inventory has been changed in Levart 

{
  "MessageID": "717b3bec-5321-4bad-84c1-075bff67f92c",
  "TimeStamp": "2016-09-28T15:15:00+08:00",
  "Status": "Success",
  "Messages":  [
	   "Set allocation for room 7554 - from 2018-01-02 to 2018-01-13 as 454."
}

Response (Success)  Where inventory has not changed in Levart 

 
{
  "MessageID": "717b3bec-5321-4bad-84c1-075bff67f92c",
  "TimeStamp": "2017-04-12T12:37:11+08:00",
  "Status": "Success",
  "Messages": []
}

Response (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 Set Inventory 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)