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
Element | Num | Type | Description |
---|---|---|---|
Authentication | 1 | Object | Authentication Object |
Authentication > Username | 1 | String | Unique Username for this property. |
Authentication > Password | 1 | String | Unique Password for this property. |
MessageID | 1 | String | Unique Message ID |
MessageType | 1 | String | Set to 'SetInventory' |
TimeStamp | 1 | DateTime | Date and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00 |
InventoryData | 1..n | Array | InventoryData array, contains the contents of what is required to be updated. |
InventoryData n > RoomTypeCode | 1 | String | The Room Type Code or ID for the Room to be updated |
InventoryData n > StartDate | 1 | Date | Start date in YYYY-MM-DD format. |
InventoryData n > EndDate | 1 | Date | End date in YYYY-MM-DD format (Inclusive). |
InventoryData n > Available | 1 | Integer | Integer >= 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."
}
ErrorMessage | Description |
---|---|
"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
Element | Num | Type | Description |
---|---|---|---|
MessageID | 1 | String | Unique Message ID (Same as the Request Message ID) |
TimeStamp | 1 | DateTime | Date and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00 |
Status | 1 | String | Element contains either 'Error' or 'Success' |
ErrorMessage | 0..1 | String | Error message (on error only). |
Messages | 0..n | Array | Any update messages (delta) |