Custom Fields
All the native attributes (availability, prices, restrictions) managed by WooDoo are listed in the chapter “Get data”. By the way, if the Channel does manages other attributes (i.e. extrabed price, board price, cutoff), we can evaluate to allow their management through the WooDoo connection case by case. These additional attributes are called “custom fields”. A custom field can be managed through WooDoo Api only if:
It has not daily granularity (the chosen value will be applied to different days)
- It is managed according one of the followings:
at room level (each room can have a different custom field value)
at room-rate level (each room-rate combination can have a different custom field value)
WuBook will provide a custom_key, for every accepted custom field. If the Channel implements custom fields, the services described above (get_rooms, get_rates, get_data, update_data) needs some adaptations.
Get Rooms
For each agreed custom field, you can specify which rooms it applies to. In get_rooms response the following structure can be added:
{
"code": 200,
"data": {
“hotel_id”: “100”,
"rooms": [ ... ],
"custom_fields_room":{
“custom_key_1”: [“room_id_1”, “room_id_2”],
“custom_key_2”: [“room_id_2”, “room_id_3”, “room_id_4”],
“custom_key_3”: [ ]
}
}
}
- For each agreed custom field, you can specify which rooms it applies to. Note that:
if an agreed custom field is not specified, we will assume that it applies to all rooms.
if an agreed custom field is returned with an empty list, it means that no rooms apply to it.
Custom fields can also change per property. In that case, for each property only the custom fields listed in the “custom_fields_room” attribute will be managed.
Get Rates
For every custom field at room-rate level, you can specify which room-rate combinations it applies to. In get_rates response the following structure can be added
{
"code": 200,
"data": {
“hotel_id”: “100”,
"rates": [ ... ],
"custom_fields_roomrate":{
“custom_key_1”: [[“room_id_1”,”rate_id_1”], [“room_id_2”,”rate_id_1”]],
“custom_key_2”: [[“room_id_2”,“rate_id_1”]],
“custom_key_3”: [ ]
}
}
}
- For each agreed custom field, you can specify which room-rate it applies to. Note that:
if an agreed custom field is not specified, we will assume that it applies to all room-rate combinations;
if an agreed custom field is returned with an empty list, it means that no room-rate apply to it.
Custom fields can change per property. In that case, for each property only the custom fields listed in the “custom_fields_roomrate” attribute will be managed.
Get Data
If the custom field is room level managed, the corresponding custom_key must be specified at room level in get_data response. If the custom field is managed at room-rate level, the corresponding custom_key must be specified at room-rate level in get_data response.
{
"code": 200,
"data": {
"hotel_id": "100",
"rooms": [
{
"room_id": "2",
"days": {
"2014-12-01": {
"availability": 5,
“custom_key_room_1”: value,
“custom_key_room_...”: value,
“custom_key_room_n”: value,
"rates": [
{
"rate_id": "111",
"closed": false,
...
"minstayarr": 0,
“custom_key_roomrate_1”: value,
“custom_key_roomrate_...”: value,
“custom_key_roomrate_n”: value,
...
},
]
}
}
}
]
}
}
Update Data
The update request does contains a new field “custom_fields”, that is a list of blocks (dictionaries). Each block represent the update for a custom field, for a certain room (or room-rate) and for a certain period. An update block for a custom field managed at room level contains only the room_id . An update block for a custom field managed at room-rate level contains both room_id and rate_id .
{"action": "update_data",
"data":{
"availability": [ ... ],
"prices": [ ... ]
"restrictions": [ ... ],
"custom_fields": [
{
"dfrom": “YYYY-MM-DD”,
"dto": “YYYY-MM-DD”,
"room_id": "2",
"rate_id": "1",
“custom_key_roomrate”: value,
},
{
"dfrom": “YYYY-MM-DD”,
"dto": “YYYY-MM-DD”,
"room_id": "2",
“custom_key_room”: value,
},
],
}
}