Hotel availability

Whenever a trivago user submits a specific search request a hotel availability POST request is being sent out to trivago's advertiser. Region or city requests are sent out as multi hotel availability requests. With this method the availability for a specific set of hotel IDs is requested by providing the advertiser this set in the request message.

Request

Sample code

Endpoint:

https://advertiser-site.com/api_implementation/hotel_availability

Header:

Content-Type: application/x-www-form-urlencoded

Body:

api_version=4
&hotels=[5568,12341234]
&start_date=2018-04-28
&end_date=2018-04-29
&room_adults_1=2
&num_rooms=1
&lang=en_GB
&rate_model=AI
&currency=GBP

Request parameters

Field Type Description Mandatory
api_version integer Version of the API true
currency string Currency of requested prices true
start_date string Requested start date in format yyyy-MM-dd true
end_date string Requested end date in format yyyy-MM-dd true
lang string Requested language in format language_POS true
room_adults_[number_of_room] integer Number of adults within room [number_of_room] (repeat this tag for more rooms i.e. room_adults_2, room_adults_3,...) true
room_childs_[number_of_room] array of integer Ages of the childs within room [number_of_room] (repeat this tag for more rooms) true (in case of children)
num_rooms integer Number of requested rooms true
hotels array of integer or strings Requested partner references true
rate_model string Requested rate model, possible values AI, GROSS, NET. Below you can find a description which values are combined true

Rate model definition

rate_model net_rate vat service_charge booking_fee hotel_fee local_tax resort_fee
AI x x x x x x x
GROSS x x x x
NET x

Fee NET GROSS AI Rate component
Additional mapping information
Cleaning fee x x service_charge
Management fee x x service_charge
Tourist tax x local_tax
City tax x local_tax
Deposit not included


Response

Sample code

Header:

Content-Type: application/json

Body:

{
    "root": {
        "api_version": 4,
        "currency": "GBP",
        "start_date": "2018-04-28",
        "end_date": "2018-04-29",
        "lang": "en_GB",
        "rate_model": "AI",
        "room_adults_1":2,
        "num_rooms": 1,
        "hotel_ids": [
            5568,
            12341234
        ],
        "hotels": [
            {
                "hotel_id": 5568,
                "room_types": [
                    [
                        {
                            "Executive Doubleroom ": {
                                "booking_fee": 0,
                                "breakfast_included": "true",
                                "currency": "GBP",
                                "final_rate": 202.5,
                                "free_cancellation": "true",
                                "hotel_fee": 0,
                                "local_tax": 2.5,
                                "meal_code": "BB",
                                "net_rate": 160,
                                "payment_type": "prepaid",
                                "resort_fee": 0,
                                "room_code": "DOUBLE",
                                "service_charge": 0,
                                "url": "https://advertiser-site.com/hoteladlon/Executive_Double?start_date=2018-04-28&end_date=2018-04-29&num_adults=2",
                                "mobileURL": "https://advertiser-mobilesite.com/hoteladlon/Executive_Double?start_date=2018-04-28&end_date=2018-04-29&num_adults=2",
                                "vat": 40,
                                "rate_type": "DEFAULT"
                            }
                        }
                    ],
                    [
                        {
                            "Executive Doubleroom Mobile Offer": {
                                "booking_fee": 0,
                                "breakfast_included": "true",
                                "currency": "GBP",
                                "final_rate": 202.5,
                                "free_cancellation": "true",
                                "hotel_fee": 0,
                                "local_tax": 2.5,
                                "meal_code": "BB",
                                "net_rate": 160,
                                "payment_type": "prepaid",
                                "resort_fee": 0,
                                "room_code": "DOUBLE MBL",
                                "service_charge": 0,
                                "url": "",
                                "mobileURL": "https://advertiser-mobilesite.com/hoteladlon/Executive_Double?start_date=2018-04-28&end_date=2018-04-29&num_adults=2",
                                "vat": 40,
                                "rate_type": "MOBILE"
                            }
                        }
                    ],
                    [
                        {
                            "Freaky Double Mobile Offer": {
                                "booking_fee": 0,
                                "breakfast_included": "true",
                                "currency": "GBP",
                                "discounts": [
                                    {
                                        "booking_fee": 0,
                                        "final_rate": 10,
                                        "hotel_fee": 0,
                                        "local_tax": 0.0,
                                        "marketing_text": "5% off mobile special",
                                        "net_rate": 8,
                                        "resort_fee": 0,
                                        "service_charge": 0,
                                        "vat": 2
                                    }
                                ],
                                "final_rate": 202.5,
                                "free_cancellation": "true",
                                "hotel_fee": 0,
                                "local_tax": 2.5,
                                "meal_code": "RO",
                                "net_rate": 160,
                                "payment_type": "prepaid",
                                "resort_fee": 0,
                                "room_code": "DOUBLE MBL",
                                "service_charge": 0,
                                "url": "",
                                "mobileURL": "https://advertiser-mobilesite.com/hoteladlon/Freaky_Double?start_date=2018-04-28&end_date=2018-04-29&num_adults=2",
                                "vat": 40,
                                "rate_type": "MOBILE"
                            }
                        }
                    ]
                ]
            },
            {
                "hotel_id": 12341234,
                "room_types": [
                    [
                        {
                            "Luxury Double": {
                                "booking_fee": 0,
                                "breakfast_included": "true",
                                "currency": "GBP",
                                "final_rate": 74.5,
                                "free_cancellation": "true",
                                "hotel_fee": 0,
                                "local_tax": 2.5,
                                "meal_code": "RO",
                                "net_rate": 60.00,
                                "payment_type": "prepaid",
                                "resort_fee": 0,
                                "room_code": "DOUBLE",
                                "service_charge": 0,
                                "url": "https://advertiser-site.com/hotelmagnum/Luxury_Double?start_date=2018-04-28&end_date=2018-04-29&num_adults=2",
                                "mobileURL": "",
                                "vat": 12,
                                "rate_type": "REWARD"
                            }
                        }
                    ]
                ]
            }
        ]
    }
}

Response parameters

Field Type Description Mandatory
root Root Root element of the response true

Structure of root element

Field Type Description Mandatory
api_version integer Version of the API true
currency string Currency of requested prices true
start_date string Requested start date in format yyyy-MM-dd true
end_date string Requested end date in format yyyy-MM-dd true
lang string Requested language in format language_POS true
room_adults_[number_of_room] integer Number of adults within room [number_of_romm] (repeat this tag for more rooms i.e. room_adults_2, room_adults_3,...) true
room_childs_[number_of_room] integer array Comma separated children ages within room [number_of_room] (repeat this tag in case of more rooms) true (only if requested)
num_rooms integer Number of requested rooms true
hotel_ids array of integer or strings Requested partner references true
hotels Hotels array Object of all offers per hotel listed in hotel_ids true
rate_model string Requested rate model, possible values AI, GROSS, NET. Above you can find a description which values are combined true