Booking availability

To check if an advertised offer is still bookable trivago sends out "/booking_availability" POST requests to the advertiser's API. When the booking availability results are returned, they are presented to the user on the trivago Express Booking landing page opened in an additional browser window. The user can then choose the offer they want to book. Please click on one of the flags below to see how the trivago Express Booking landing page would look like for the corresponding point of sale.

Request

Sample code

Endpoint:

http://advertiser-site.com/api_implementation/booking_availability

Header:

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

Body:

api_version=1
&hotel={
  "item_id": 730099,
  "partner_reference": "abc123"
}
&start_date=2016-01-21
&end_date=2016-01-23
&party=[{"adults":2, "children" : [ 1 ]}]
&lang=en_US
&currency=USD
&user_country=US

Request parameters

Name Type Description Mandatory
api_version number The version of the API used by this request. true
hotel Hotel

JSON serializable hash representing requested hotel.

Example: hotel={"item_id": 50236, "partner_reference": "TXD87952"}

Note: You must do all your availability lookups using your partner_reference. The item_id can change as the site changes.

true
start_date string The user's check-in date in YYYY-MM-DD true
end_date string The user's check-out date in YYYY-MM-DD true
party Party array

Array of JSON objects including number of adults and children requested.

Each party object represents the occupation for a separate room. For example, "party":[{“adults": 3}] is a request for one room that accommodates three adults, or "party":[{"adults": 2},{"adults": 2, "children": [11,8]}] is a request for one room for two adults and one room for two adults and two children aged 11 and 8.

true
lang string Language code (see Supported Languages), which identifies the corresponding language and POS. true
currency string ISO 4217 currency code. All prices, taxes, fees, and discount amounts should be returned in this requested currency. true
user_country string ISO 3166-1 alpha-2 country code corresponding to the user making this request. true

Response

Sample code

Header:

Content-Type: application/json

Body:

{
  "api_version": 1,
  "hotel_id": 730099,
  "start_date": "2016-01-25",
  "end_date": "2016-01-30",
  "party": [
    {
      "adults": 2,
      "children": [
        1
      ]
    }
  ],
  "lang": "en_US",
  "user_country": "US",
  "room_types_array": [
    {
      "name": "Double Room, 1 King Bed",
      "final_price_at_booking": {
        "amount": 100,
        "currency": "USD"
      },
      "final_price_at_checkout": {
        "amount": 5,
        "currency": "USD"
      },
      "description": "Air-conditioned room with a minibar, desk and private bathroom.",
      "rooms_available": 4,
      "partner_data": {
        "identifier_for_something": "9614b191-9e1b-4b7d-9cbc-5b9204ac2a2a"
      },
      "rate_key": "0fd6eca9-9c33-4978-b9bc-b3f3d60f6205",
      "room_type": "STANDARD",
      "occupancy": {
        "standard_persons": 2,
        "max_persons": 3,
        "max_adults": 2,
        "max_children": 2,
        "max_children_age": 16
      },
      "room_group": {
        "code": "e5db04fa67d6",
        "name": "Cozy Double Room",
        "description": "Air-conditioned room with a minibar, desk and private bathroom."
      },
      "line_items": [
        {
          "price": {
            "amount": 100,
            "currency": "USD"
          },
          "type": "net_rate",
          "paid_at_checkout": false,
          "description": "base price"
        },
        {
          "price": {
            "amount": 5,
            "currency": "USD"
          },
          "type": "city_tax",
          "paid_at_checkout": true,
          "description": "city tax"
        }
      ],
      "amenities": [
        "free bottle of water",
        "air condition"
      ],
      "value_adds": [
        "FREE_BREAKFAST",
        "FREE_INTERNET",
        "FREE_PARKING"
      ],
      "payment_methods": [
        {
          "code": "PaymentCard",
          "options": [
            {
              "code": "MasterCard",
              "fee": {
                "amount": 0.0,
                "currency": "USD"
              }
            },
            {
              "code": "Visa",
              "fee": {
                "amount": 2.77,
                "currency": "USD"
              }
            }
          ]
        },
        {
          "code": "ExternalProvider",
          "options": [
            {
              "code": "Paypal",
              "fee": {
                "amount": 0.0,
                "currency": "USD"
              }
            }
          ]
        },
        {
          "code": "BankAccount",
          "options": [
            {
              "code": "DirectDebit",
              "fee": {
                "amount": 0,
                "currency": "GBP"
              }
            }
          ]
        },
        {
          "code": "ManualPayment",
          "options": [
            {
              "code": "BankTransfer",
              "fee": {
                "amount": 0,
                "currency": "GBP"
              }
            }
          ]
        }
      ],
      "photos": [
        {
          "url": "https://trv-companypages.s3-eu-central-1.amazonaws.com/wp-content/uploads/sites/2/2015/07/trivago_logo_twitter-1024x512.png",
          "caption": "Trivago logo",
          "width": 1024,
          "height": 512
        }
      ],
      "cancellation": {
        "policy": "free text",
        "penalties": [
          {
            "fee": {
              "amount": 20.0,
              "currency": "USD"
            }
          },
          {
            "from": "2016-01-18T16:00:00+0000",
            "fee": {
              "amount": 100.0,
              "currency": "USD"
            }
          }
        ]
      },
      "promotions": [
        {
          "type": "MOBILE_ONLY",
          "description": "...",
          "discount": {
            "percentage": 25,
            "total": {
              "amount": 25,
              "currency": "USD"
            }
          }
        }
      ]
    }
  ],
  "hotel_details": {
    "name": "Some Awesome Hotel",
    "address1": "52977 Ismael Bridge",
    "city": "South Maurice",
    "state": "NY",
    "postal_code": "01234",
    "country": "USA",
    "latitude": -61.7414,
    "longitude": -174.122,
    "phone": "(509) 711-6896",
    "url": "http://www.hotel-site.com/welcome",
    "amenities": [
      "RESTAURANT",
      "NON_SMOKING",
      "FREE_PARKING"
    ],
    "photos": [
      {
        "url": "https://trv-companypages.s3-eu-central-1.amazonaws.com/wp-content/uploads/sites/2/2015/07/trivago_logo_twitter-1024x512.png",
        "caption": "Trivago logo",
        "width": 1024,
        "height": 512
      }
    ],
    "checkinout_policy": "check-in from 3pm and check-out till 12am"
  },
  "customer_support": {
    "phone_numbers": [
      {
        "contact": "1-153-072-9237 x6907",
        "description": "Tempora iure sit accusamus et cupiditate autem reiciendis iusto."
      }
    ],
    "emails": [
      {
        "contact": "Roxane.McKenzie@gmail.com",
        "description": "Aspernatur reiciendis quis at qui asperiores."
      }
    ],
    "urls": [
      {
        "contact": "http://kasey.info",
        "description": "Maiores enim cupiditate deserunt ut."
      }
    ]
  }
}

Response properties

Field Type Description Mandatory
api_version number Version of the API used. true
hotel_id number Echo the item_id (not partner_reference) provided by trivago in the corresponding request. true
start_date string Echo the check-in date provided by trivago in the corresponding request. true
end_date string Echo the check-out date provided by trivago in the corresponding request. true
party array Echo the party array provided by trivago in the corresponding request. true
lang string Language code (see Supported Languages). The language of the response, if language not available return a language part of the locale, otherwise English (IF !de_AT THEN de_DE ELSE en_US). true
user_country string Echo the user country provided by trivago in the corresponding request true
room_types_array RoomType array An array of objects detailing the different kinds of rooms that are available for the entire party. The short description must be unique for each room type available in the hotel. true
hotel_details HotelDetails Required object containing information about the hotel in general, such as address.  This information will be presented to customer during booking. false
terms_and_conditions string

General terms and conditions.

Text field.

Length limit of 1000 characters.

false
terms_and_conditions_url string Link to the advertiser's terms and conditions page. false
customer_support CustomerSupport

Contains the hotel’s customer support contact information for guests.

Must be returned on both successes and failures.

true
errors Error array Array of errors false