Hotel.getRates | Previo API

Hotel.getRates

Returns rates, contingents, closures, restrictions and payment settings. 

This function returns all data which can be set up in Settings - Prices. We recommend you to check your settings first so you better understand the structure of the data output. 

Billing method for accommodation

If the value of the element prmId is "1", the hotel charges accommodation price based on occupancy. If the value is "2", the price is charged for the room regardless of the number of occupying guests. 

The element objectKind looks like the following if charges are based on occupancy: 

<objectKind>
    <obkId>1478</obkId>
    <rate>
        <occupancy>1</occupancy>
        <price>800</price>
        <currency>
            <curId>1</curId>
            <code>CZK</code>
        </currency>
    </rate>
    <rate>
        <occupancy>2</occupancy>
        <price>1400</price>
        <currency>
            <curId>1</curId>
            <code>CZK</code>
        </currency>
    </rate>
</objectKind>

This example shows that a room with obkId 1478 is available for one person for 800 Kč and for two persons for 1400 Kč.

If accounting a flat rate for the room not based on occupancy, the element "occupancy" is completely missing: 

<objectKind>
    <obkId>1478</obkId>
    <rate>
        <price>1000</price>
        <currency>
            <curId>1</curId>
            <code>CZK</code>
        </currency>
    </rate>
</objectKind>

In this example, this room kind is always priced at 1000 Kč no matter the number of occupying guests. 

All facilities (excluding bedrooms) are always charged at the same price. The element <occupancy> is missing, despite prmId equals 1. 

Parameters

Name Description
login Username
password Password
hotId Hotel ID
term Time period
currencies Currency filter
prlIds Pricing plan filter
obkIds Object kind filter
realSeasonTerm if is wanted to return the seasons cut according to the search term, or the real term of the seasons

term

Returns price settings for a specified time period. We strive to make hotels set prices at least one year in advance. 

Insert dates in W3 date format. Example: 2010-04-29

<term> [1]  
 
<from> [1] from (date)
<to> [1] to

currencies

With this parameter you can specify in which currency prices for accommodation and meals will be returned. You can only select currencies permitted by the hotel

If you omit this parameter, the function returns data in the default currency of the hotel. 

<currencies> [0..1]  
 
<currency> [1..*] Specified currency. Use EITHER curId OR code. 
 
<curId> [0..1] Currency ID
<code> [0..1] Currency code

prlIds

With this parameter you can obtain specific price plans.

  • If you omit this parameter, the function always returns the basic price plan.
  • If you omit this parameter and you are a Previo partner, the function returns price plan defined for Previo partner as "Rate plan - standard conditions" and "Rate plan - non-refundable conditions". 
<prlIds> [0..1]  
 
<prlId> [1..*] Price plan ID

obkIds

With this parameter you can define for which room kinds you would like to get accommodation prices, closures and restrictions. If this parameter is omitted, the function returns the following information for all defined room kinds. 

<obkIds> [0..1]  
 
<obkId> [1..*] Object kind ID

realSeasonTerm

This parameter can be used to determine how the season dates will be returned - if it is set to false or not set, then the seasons will be cut according to the searched date. If true, the beginning and end of the seasons will be returned according to the date as entered in the reception system.

<realSeasonTerm> [0..1]  

Sample request

<request>
    <login>username</login>
    <password>password</password>
    <hotId>745896</hotId>
    <term>
        <from>2010-01-01</from>
        <to>2010-12-31</to>
    </term>
    <currencies>
        <currency>
            <code>CZK</code>
        </currency>
        <currency>
            <code>EUR</code>
        </currency>
    </currencies>
</request>

 

Output

<rates> [1]  
 
<prmId> [1] Billing method for accommodation
<ratePlan> [1..*] Rate plan
 
<prlId> [1] Rate plan ID
<nrr> [1]

If rate plan has defined standard (false) or non-refundable (true) cancellation conditions

'true' | 'false'

<priceActions> [1]

[DEPRICATED] 

<actionPrices> [1]

Apply price actions of type "action price" to this rate plan

'true' | 'false'

<firstMinutes> [1]

Apply price actions of type "first minute" to this rate plan

'true' | 'false'

<lastMinutes> [1]

Apply price actions of type "last minute" to this rate plan

'true' | 'false'

<longTerms> [1]

Apply price actions of type "long term" to this rate plan

'true' | 'false'

<season> [0..*] Seasons that intersect with the specified datesInbetween seasons can be a gap. If two seasons follow up on each other, the first date is the same date as the other.
 
<from> [1] Season start date
<to> [1] Season end date
<objectKind> [0..*] Accommodation prices, closures and restrictions
 
<obkId> [1] Object kind ID
<rate> [0..*] Accommodation price
 
<occupancy> [0..1] Occupancy. The element is missing if the hotel charges a flat price for the room.
<price> [1] Accommodation price (in selected currency) 
<currency> [1] Currency
 
<curId> [1] Currency ID
<code> [1] Currency code
<closed> [0..1] Closures
 
<total> [1] Total number of closed rooms of specified room kind
<objId> [1..*] ID of closed rooms. Number of these ID = total value
<minStay> [0..1] Minimum length of stay (nights count) - this element appears, when hotel sets the minimum stay restriction per room type
<maxStay> [0..1] Maximum length of stay (nights count) - this element appears, when hotel sets the minimum stay restriction per room type
<closeToArrival> [0..1] Closed to arrivals - this element appears, when hotel sets the CTA/CTD restriction per room type
<closeToDeparture> [0..1] Closed to departures - this element appears, when hotel sets the CTA/CTD restriction per room type
<meal> [0..*]

[DEPRECATED - use Hotel.getMeals instead]

Offered board types and their prices. Boards are sorted by meaId. For each board type (meaId) the first listed price is always for the default guest category (guaId) if the hotel has a default category for the season. 

 
<meaId> [1] Meal ID
<guaId> [1] Guest category ID
<rate> [1..*] Price
 
<price> [1] Price of board type (in selected currency)
<currency> [1] Currency
 
<curId> [1] Currency ID
<code> [1] Currency code
<payment> [0..*]

[DEPRECATED - use Hotel.getPaymentMethods instead]

Offered payment methods

 
<payId> [1] Payment method ID
<cosIdSuccess> [1] Status ID in which the reservation is accepted if the payment was successful
<cosIdFailure> [0..1] Status ID in which the reservation is accepted in case the payment was not successful. Success of a payment can only be evaluated by payment with credit card (payId = 3). Other types of payments are always saved in reservation status cosIdSuccess.
<advance> [0..1] Required deposit
 
<type> [1]

Deposit type (in percent, absolute amount, price for nights count)

'per' | 'abs' | 'night'

<value> [1] Advance amount
<expiration> [0..1] Number of days in which the deposit may be paid. Appears only in payment transfers.
<minStay> [0..1] Minimum length of stay (days) - this element appears, when hotel sets the minimum stay restriction per season
<maxStay> [0..1] Maximum length of stay (days) - this element appears, when hotel sets the minimum stay restriction per season
<closeToArrival> [0..1] Closed to arrivals - this element appears, when hotel sets the CTA/CTD restriction per season
<closeToDeparture> [0..1] Closed to departures - this element appears, when hotel sets the CTA/CTD restriction per season

 

Payment methods

payId Description
1 Payment on the spot
2 Bank transfer
3 Payment card
8 Guarantee credit card

  

Sample answer

<rates>
    <prmId>1</prmId>
    <ratePlan>
        <prlId>1556</prlId>
        <nrr>false</nrr>
        <priceActions>
            <actionPrices>true</actionPrices>
            <firstMinutes>true</firstMinutes>
            <lastMinutes>true</lastMinutes>
            <longTerms>false</longTerms>
        </priceActions> 
        <season>
            <from>2010-05-01</from>
            <to>2010-05-08</to>
            <objectKind>
                <obkId>111136</obkId>
                <rate>
                    <occupancy>1</occupancy>
                    <price>500</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>1</occupancy>
                    <price>20</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
                <contingent>
                    <total>1</total>
                    <expiration>3</expiration>
                    <objId>957091</objId>
                </contingent>
                <closed>
                    <total>2</total>
                    <objId>957096</objId>
                    <objId>957101</objId>
                </closed>
            </objectKind>
            <objectKind>
                <obkId>111151</obkId>
                <rate>
                    <occupancy>1</occupancy>
                    <price>300</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>2</occupancy>
                    <price>500</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>1</occupancy>
                    <price>12</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>2</occupancy>
                    <price>20</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
            </objectKind>
            <meal>
                <meaId>2</meaId>
                <guaId>71941</guaId>
                <rate>
                    <price>50</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <price>2</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
            </meal>
            <meal>
                <meaId>2</meaId>
                <guaId>71946</guaId>
                <rate>
                    <price>25</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <price>1</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
            </meal>
            <minStay>2</minStay>
            <maxStay>10</maxStay>
            <payment>
                <payId>1</payId>
                <cosIdSuccess>6</cosIdSuccess>
            </payment>
            <payment>
                <payId>2</payId>
                <cosIdSuccess>1</cosIdSuccess>
                <advance>
                    <type>per</type>
                    <value>50</value>
                    <expiration>3</expiration>
                </advance>
            </payment>
        </season>
        <season>
            <from>2010-05-08</from>
            <to>2010-05-15</to>
            <objectKind>
                <obkId>111136</obkId>
                <rate>
                    <occupancy>1</occupancy>
                    <price>250</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>1</occupancy>
                    <price>10</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
            </objectKind>
            <objectKind>
                <obkId>111151</obkId>
                <rate>
                    <occupancy>1</occupancy>
                    <price>400</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>2</occupancy>
                    <price>600</price>
                    <currency>
                        <curId>1</curId>
                        <code>CZK</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>1</occupancy>
                    <price>16</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
                <rate>
                    <occupancy>2</occupancy>
                    <price>24</price>
                    <currency>
                        <curId>2</curId>
                        <code>EUR</code>
                    </currency>
                </rate>
            </objectKind>
            <minStay>1</minStay>
            <maxStay>100</maxStay>
            <closeToArrival>false</closeToArrival>
            <closeToDeparture>false</closeToDeparture>
        </season>
    </ratePlan>
</rates>

The sample output corresponds to this screen from the Previo system:

Nastavení cen