The get_deadline method allow the client system to retrieve the deadline policy of the selected agreement. The response reports the deadline date, value and policies. The (type) attribute has to be set to get_deadline. Please note that the timezone to be considered is CET/CEST.
Here is an example of a get_deadline:
<?xml version="1.0" encoding="UTF-8"?>
<envelope>
<header>
<actor>test</actor>
<user>test</user>
<password>test</password>
<version>1.6.1</version>
<timestamp>20030423170000</timestamp>
</header>
<query type="get_deadline" product="hotel">
<availability id="XXXXXXXXXXX"></availability>
<hotel id="XXXXXXXXXXX"></hotel>
<agreement code="XXXXXXXXXXXXXx"></agreement>
</query>
</envelope>
This get_deadline query contains all the available fields: the type attribute is set to get_deadline. Let's explore in deeper detail the meaning of every field.
The response to a get_deadline query has its type attribute set to get_deadline and follows that form:
<?xml version="1.0" encoding="UTF-8"?>
<response type="get_deadline" product="hotel">
<availability id="12312312"/>
<agreement code="XXXXXXXXXXXXXx"/>
<deadline date="2014-11-04 18:00:00"/>
<policies>
<policy from="2014-11-05 18:00:00" percentage="25" />
</policies>
<remarks>
<remark code="F" text="From 2014-11-05 18:00 cancellation fee is 1 Nights."/>
<remark code="N" text="No-show fee is 1 Nights."/>
</remarks>
</response>
While the "deadline" node is always filled, the "policies" and "remarks" nodes could be empty. The "percentage" of the policies is related to the reservation cost. For example, if the booking total is €300.00 and the policy percentage's value is 80, cancelling the booking after that date, the client will have to pay €240.00. When the remarks are present, they must always be shown to the client, because sometimes the hotel prefers to handle its cancellation terms using a text message. If both the policies and remarks nodes are empty, the client will have to pay only the first priced night, if he cancels the reservation after the deadline's date.
This is an example of get_deadline response you can encounter:
<?xml version="1.0" encoding="UTF-8"?>
<envelope>
<header>
<version port="20000" host="epycs.netstorming.net">1.6.0</version>
<timestamp>20160614180130</timestamp>
</header>
<response type="get_deadline" product="hotel">
<availability id="15964364061"/>
<deadline date="2016-08-04 12:00:00" value="2016-08-04 12:00:00"/>
<policies>
<policy from="2016-08-05 12:00:00" percentage="100"/>
</policies>
<remarks/>
</response>
</envelope>
You have to interpret this response as follows:
Please note: the cancellation policies you get using this method are only a good approximation of the actual ones and could differ from the final ones. In order to get the final cancellation policies you have to use the evaluate method.