.. meta:: :description: Wired API, channel manager, booking.com and expedia :keywords: Wired, xml, api, channel manager, booking engine, booking.com and expedia Channel Manager API ******************* Introduction ------------ Wired makes possible to manage many features of the channel manager, including: * Channels management * Booking.com API * Expedia API * Updates management * Channels settings The configuration of **booking.com** and **expedia** is used to build a programmable way to setup the connectivity of these channels (rooms and rates mapping), without the need to access wubook's control panel. .. note:: Please, implement channels configuration only when you have a strong Know How about the WuBook System. Each channel has a crucial field called **ctype** (channel type). It describes the nature of the channel (booking.com, expedia and so on). To check the available types of channel, you can use the following function: .. function:: get_channels_info(token) For each channel, identified by ctype, you'll get a KV structure having the following keys: ========================================== ============================================================================================================ Key Description ========================================== ============================================================================================================ name Channel name logo_url Channel logo path homepage Channel homepage (e.g. https://www.booking.com) extranet Channel extranet (e.g. https://admin.booking.com/) ical 1 if is supported, 0 otherwise cc 1 if is supported, 0 otherwise restrictions Array of supported restrictions (closed, closed_arrival, closed_departure, min_stay, max_stay, min_stay_arrival, max_stay_arrival) logo Deprecated, use `logo_url` instead ========================================== ============================================================================================================ .. warning:: Please, given the complex context of channels management, make sure to use the following functions with extreme care, implementing reliable and smart approaches. Channels Management ------------------- We release few functions to improve the programmabililty of the channels management. In particular: .. function:: get_otas(token, lcode) .. function:: tag_ota(token, lcode, chid, tag) .. function:: new_ota(token, lcode, ctype [,tag]) .. function:: ota_running(token, lcode, chid) .. function:: fetch_rsrv_errors(token, lcode) The first function (**get_otas()**) is used to retrieve the channels of the property identified by **lcode**. The **tag_ota()** function is used to *tag* an OTA, associating a small comment. It's very useful if you have multiple channels of the same type, like two instances of booking.com: in such case, it will be very easy to detect them. The **new_ota()** function allows to insert a new channel. The **ctype** argument is used to specify the type of the channel (booking, expedia and so on). To check available types, please, have a look at :func:`get_channels_info`. Pay attention to the **ota_running()** function: it tells you if a channel is correctly configured and activated. This function is very important in the case you will choose to configure Booking.com and/or Expedia via Wired. After your configurations, it's very important to put controls over the channel activation status. The function **fetch_rsrv_errors()** is used to retrieve the reservations received from connected OTAs which have not been integrated by the Channel Manager WooDoo in the last 24 hours. This can happen for bugs and other reasons. Each reservation error is a KV structure, having the following keys: ========================================== ============================================================================================================ Key Description ========================================== ============================================================================================================ id The object ID status Reservation Status (it can be New, Mod, Del) channel_reservation_code The OTA ID of this reservation (0 otherwise) id_channel The channel type (booking, expedia, ....) amount Optional (as for normal reservations) ancillary Optional (as for normal reservations) customer Optional (as for normal reservations) date_received Optional (as for normal reservations) date_arrival Optional (as for normal reservations) date_departure Optional (as for normal reservations) men Optional (as for normal reservations) children Optional (as for normal reservations) rooms Optional (as for normal reservations) ========================================== ============================================================================================================ Booking.com Configuration ------------------------- The configuration of booking.com is generally made inside the control panel of WuBook (property extranet). However, it's possible to program it, by using the following functions: .. function:: bcom_start_procedure(token, lcode, chid, bhid) .. function:: bcom_confirm_activation(token, lcode, chid) .. function:: bcom_init_channel(token, lcode, chid, currency) .. function:: bcom_rooms_rates(token, lcode, chid) .. function:: bcom_set_room_mapping(token, lcode, chid, rmap [, singlemap]) .. function:: bcom_set_rate_mapping(token, lcode, chid, rmap) .. function:: bcom_read_allotments(token, lcode, chid, dfrom, days) As you should know, Booking.com also allows to notify No-Show cases and Invalid Credit Cards for each received reservation. These actions can be easily triggered with the following functions: .. function:: bcom_notify_noshow(token, lcode, rcode, waive_fees= False) .. function:: bcom_notify_invalid_cc(token, lcode, rcode) Where **rcode** is the reservation identifier. About Booking.com configuration, you should develop such functions only when you will have a good experience of the WuBook System. By having experience about the connectivity process of Booking.com, you should immediately understand the logic of these calls. So, assuming you're fully understanding of the logic, let's just describe details. The **chid** argument always identify an unique channel (channel ID). Please, check the :func:`get_otas` function, which returns, for every channel, its ID. The **bhid** argument always identify the Property ID that Booking.com assigns to the property to be connected. The **currency** argument is a three-digit code (EUR, USD, ...). About **mapping**, you should: Where **waive_fees** tells B.com that you waive the right to No Show fees * Use **bcom_rooms_rates()** to check which booking.com rooms/rates must be mapped * Use **bcom_set_room_mapping()** to map rooms. The **rmap** argument is a KV structure having booking.com room IDs as keys and wubook room IDs as values ({b_room_id: w_room_id, ...}). * Use **bcom_set_rate_mapping()** to map rates. The **rmap** argument is a KV structure having booking.com rate IDs as keys. Its values are another KV structure, having two keys: 'pplan' (the ID of the WuBook's Pricing Plan) and 'rplan' (the Id of the WuBook's Restriction Plan): ({b_rate_id: {'pplan': w_pplan_id, 'rplan': w_rplan_id}, ...}). Finally, the **bcom_read_allotments()** function can be used to access information about allotments. The **dfrom** parameter is an european date and **ndays** is an integer: the number of days you want to check starting from **dfrom**. Make sure to use **ndays < 31**. Retrieved information contains, for each roomId, a list of days. Each day containing the following fields: date, minimumContractedRooms, minimumContractedRoomsUntil, BookedRooms. .. function:: bcom_get_advance_booking(token, lcode, chid) .. function:: bcom_set_advanced_booking(token, lcode, chid, advanced_res) Both these functions are used to manage Booking.com Early/Late booking settings. You can set, for every room of the property, a tuple (n° of days, n° of hours) for both maximum and minimum limits. Expedia Configuration --------------------- Let's immediately list the available functions to configure expedia: .. function:: exp_start_procedure(token, lcode, chid, ehid) .. function:: exp_vat_models(token) .. function:: exp_init_channel(token, lcode, chid, currency, fee, vat_taxes) .. function:: exp_rooms_rates(token, lcode, chid) .. function:: exp_set_room_mapping(token, lcode, chid, rmap [, allots]) .. function:: exp_set_rate_mapping(token, lcode, chid, rmap) .. function:: exp_set_preferences(token, lcode, chid, hct, minstay_error_behaviour, minstay_type [, last_rate]) As stated on the previous section, we assume you perfectly understand the meaning of these functions because you are used to configure Expedia by using the WuBook Control Panel (wubook extranet): so, let's just describe useful details. The *exp_init_channel()** function has a not trivial parameter, which is **vat_taxes**. This should be a float number and compatible with supported values. So, you're probably wondering how to retrieve supported values. To check them, use **exp_vat_models()**, which returns a list of float numbers with a human description for each value. The **ehid** parameter means *Expedia Hotel IdI*: it's the ID of the property assigned by Expedia. The **currency** parameter is the 3-digit standard (EUR, USD and so on). About the **exp_set_room_mapping()**: **rmap** is a struct having as keys the Expedia Room IDs (as strings) and as values the WuBook Room IDs. The optional parameter **allots** is a struct having the same keys of rmap and, as values, the allotment of each room. To map rates (**exp_set_rate_mapping()**), you need to use a similar KV structure, having as keys the Expedia Rate IDs and as values the WuBook Rate IDs (pricing plans). Remaining settings or "preferences" are setup using the function **exp_set_preferences**. By using this function you are updating the following informations: - **hct** (honour closed tabla): Boolean, if True, when you close a room on WuBook Restrictions, all rates will be closed. Alternatively, closures depend on your restriction profiles. - **minstay_error_behaviour**: this option is used to decide what WooDoo should do if and when it will encounter the error: **MinLOS value (7) exceeds Extranet auto-approval threshold (4) for length of stay**. Four string values are admitted for minstay_error_behaviour: =========================== ==================================================================================== Value Description =========================== ==================================================================================== skip Ignore the error and go on (date is not updated) decrease Decrease Min Stay to 4 or 3. If this is not enough, an error is issued (Recommended) close Put Min Stay= 1, but try to close the Rate (be careful with allotments) stop Stop the update and raise an error (the update will be blocked) =========================== ==================================================================================== - **minstay_type**: specify if WooDoo has to update the WuBook MinStay or the WuBook MinStayArrival. The same type configured on Expedia must be selected. One of these two string values are accepted: **min_stay** and **min_stay_arrival**. - **last_rate** (beta): Optional parameter. Used to identify the rate where eventual allotments will live in the case your rooms will be closed on WuBook. If specified, a string value is requested, the string name of a rate, check **exp_rooms_rates** for the list of available expedia rates. Updates management ------------------ Should you be interested to introspect the channel manager activities, this is the good section for you. Before to begin with the definition of the available functions, notice that such functions are limited. They generally don't return more than 25 items, for example. The function: .. function:: woodoo_suspended_commands(token, lcode) returns a list of updates whose execution has been suspended. To fetch executed updates, instead, you use the following function: .. function:: woodoo_executed_commands(token, lcode, day [, id_channel= False]) As you see, you must specify a date as filter (**day**) and, if interested on a unique channel, you can also filter the executed updates with the **id_channel** field (the Channel ID). Finally, you have two functions to manage suspended channels: .. function:: woodoo_cancel_suspended(token, lcode, trackings) .. function:: woodoo_relaunch_suspended(token, lcode, trackings) The **trackings** argument is a list of Update Identifiers. The first function will obviously cancel permantly the suspended channels. The second one is used, instead, to relaunch them. This can be useful if you aim to restart them all, for example after a misconfiguration. Channels Settings ----------------- .. function:: last_room_channels(token, lcode [, up_channels]) Altough it could be considered not appropriate, for several and serious reasons it's possible to distribute the lodging last rooms only on some OTAs. By default, last rooms are distributed everywhere. For each channel, you can specify a decreasing factor. The availability of rooms will be decreased by this number. This function lets you read and update the decreasing factor for each channel. If **up_channels** is not specified, the function returns a KV structure having Channel ID as key (type string) and decreasing factor as value (type int). The same structure should be specified for **up_channels** argument in order to update the decreaing factor for the specified channels. Channels not specified in the structure will receive decreasing factor 0 by default. .. function:: woodoo_basic_yield(token, lcode [, up_channels]) This function allows you to read/apply a basic Yield Management approach over your channels. In particular, it could be interesting to increase the price of your last remaining rooms. Notice that you can choose a different percentage and a different number of remaining rooms for each of your channels. If **up_channels** is not specified, the function returns a KV structure having Channel ID as key (type string) and as value an array of 2 elements, first is the number of last remaining rooms and the second is a percentage of increase room price. The same structure should be specified for **up_channels** argument in order to update the number of rooms and increase percentage for the specified channels. AirBnb Messaging ----------------- The messaging feature enables you to let properties communicate with their guests who book on Airbnb. This feature is available on the Wired JSON API. You can find everything you need `at this link `_.