Hotel.setCollaboration

Sets the terms and conditions for cooperation with the hotel.

Cooperation of the partner and the hotel is guided by the status and commission. You can find out current terms and conditions of cooperation in the output of the function Hotel.get. The element <collaboration> present here is in the same format as the parameter collaboration.  

Previo API always keeps the initial ratio of Previo and partner commission. You only need to put in one of the commissions (totalBonusRate, partnerBonusRate or previoBonusRate) and the remaining ones are calculated automatically. If you enter more of them, the system will use the first entered commission in the sequence total - partner - Previo and will trash the other values. 

Recalculated values ​​are included in the output of the function.

Previo API protects the hotel. With increase of commission the status of cooperation automatically switches from active and waitingFor Partner to waitingForHotel. Automatically switched status is a part of the output of this function. 

Possible states of cooperation 

Status Description
none No connection
waitingForHotel Waiting for the hotel
waitingForPartner Waiting for the partner
active Active cooperation

Parameters

Name Description
login Username
password Password
hotId Hotel ID
collaboration Terms of cooperation 
info Your own note in the automatically sent email

collaboration

<collaboration> [1]  
 
<status> [0..1] Cooperation status
<partnerBonusRate> [0..1] Partner commission in % 
<previoBonusRate> [0..1] Previo commission in % 
<totalBonusRate> [0..1] Total commission (partner + Previo) in %

info

<info> [0..1]  
 
<mail> [1]  
 
<noteHtml> [0..1] Own notes in the automatically sent email. Text is not filtered, you can use any HTML tags. Note with extra care that invalid HTML can cast the entire email. 

Sample request

<request>
    <login>prihlasovaci_jmeno</login>
    <password>heslo</password>
    <hotId>458696</hotId>
    <collaboration>
        <status>active</status>
        <totalBonusRate>10</totalBonusRate>
    </collaboration>
    <info>
        <mail>
            <noteHtml>Vítejte na &lt;a href=&quot;http://previo.cz&quot;&gt;našem portálu!&lt;/a&gt;</noteHtml>
        </mail>
    </info>
</request>

Output

The output has the same format as the parameter <collaboration> and contains all automatically calculated items.

<collaboration> [1] Newly set terms of cooperation
 
<status> [1] Status of cooperation
<partnerBonusRate> [1] Commission of partner in % 
<previoBonusRate> [1] Commission of Previo in %
<totalBonusRate> [1] Total commission (partner + Previo) in %

Sample output

<collaboration>
    <status>active</status>
    <partnerBonusRate>7.3</partnerBonusRate>
    <previoBonusRate>2.7</previoBonusRate>
    <totalBonusRate>10</totalBonusRate>
</collaboration>

Examples

Expression of interest in cooperation with partner commission of 15%

Cooperation is currently in the state "none". The default commission ratio is 10:5.

Notes within the element <noteHtml> will be attached to the end of the automatically sent email. 

Request

<request>
    <login>prihlasovaci_jmeno</login>
    <password>heslo</password>
    <hotId>1</hotId>
    <collaboration>
        <status>waitingForHotel</status>
        <totalBonusRate>15</totalBonusRate>
    </collaboration>
    <info>
        <mail>
            <noteHtml>Doplňte si prosím fotografie v profilu vašeho zařízení.</noteHtml>
        </mail>
    </info>
</request>

The function returns a new set of terms and conditions for cooperation, including calculated commissions for Previo and the total amount of commission. 

Output

<collaboration>
    <status>waitingForHotel</status>
    <partnerBonusRate>15</partnerBonusRate>
    <previoBonusRate>7.5</previoBonusRate>
    <totalBonusRate>22.5</totalBonusRate>
</collaboration>

The status waitingForHotel can be switched to waitingForPartner only by the hotelier. Even if the status waitingForPartner or active was sent through the operation, the cooperation would remain in the status waitingForHotel despite. 

Increase in total commission

Cooperation is currently in active status. The default commission ratio is 10:10. The current amount of commission is 5 % partner + 5 % Previo.

Request

<request>
    <login>prihlasovaci_jmeno</login>
    <password>heslo</password>
    <hotId>1</hotId>
    <collaboration>
        <totalBonusRate>12</totalBonusRate>
    </collaboration>
    <info>
        <mail>
            <noteHtml>Z důvodu zvýšeného počtu nesplacených faktur zvyšujeme provizi na &amp;lt;b&amp;gt;12 %&amp;lt;/b&amp;gt;.</noteHtml>
        </mail>
    </info>
</request>

If the total commission is increased in the status active, the cooperation automatically switches to the status waitingForHotel. 

Output

<collaboration>
    <status>waitingForHotel</status>
    <partnerBonusRate>6</partnerBonusRate>
    <previoBonusRate>6</previoBonusRate>
    <totalBonusRate>12</totalBonusRate>
</collaboration>

Cancellation of cooperation

Request

<request>
    <login>prihlasovaci_jmeno</login>
    <password>heslo</password>
    <hotId>1</hotId>
    <collaboration>
        <status>none</status>
    </collaboration>
    <info>
        <mail>
            <noteHtml>Rušíme spolupráci z důvodu neplnění smluvních podmínek.</noteHtml>
        </mail>
    </info>
</request>

Commissions can also be changed during cancellation of cooperation. The above system remains stored.