Booking submission

To submit a booking, trivago sends out a "/booking_submit" POST request to the advertiser's API.

Once users have selected a room after viewing the booking availability results, they go to the next step of the booking process where they fill in their details being mandatory to make a booking. These details are then sent to the advertiser's endpoint as part of the booking submit request.

Request

Sample code

Endpoint:

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

Header:

Content-Type: application/json

Body (if advertiser is PCI compliant):

{
  "checkin_date": "2016-01-25",
  "checkout_date": "2016-01-26",
  "partner_reference": "abc123",
  "reference_id": "692e8acc-d1d9-45dc-b50f-e7b824f3306f",
  "partner_data":{
      "identifier_for_something":"9614b191-9e1b-4b7d-9cbc-5b9204ac2a2a"
  },
  "tracking_data": {
    "actor": "trivago",
    "advLink": "http://advertiser-site.com/hoteladlon/Executive_Brilliant_Doppelzimmer?start_date=2016-12-28&end_date=2016-12-29"
  },
  "payment": {
    "method": {
      "code": "PaymentCard",
      "options": [
        {
          "code": "MasterCard",
          "fee": {
            "amount": 0.0,
            "currency": "USD"
          }
        }
      ]
    },
    "parameters": {
      "card_number": "6011111111111117",
      "cardholder_name": "Christopher Palmer",
      "expiration_month": "09",
      "expiration_year": "2025",
      "cvv": "507",
      "callback_success": "",
      "callback_cancel": "",
      "callback_error": "",
      "type": "PaymentCard"
    },
    "billing_address": {
      "address1": "12 Johnson Junction",
      "city": "Santa Cruz",
      "state": "Maryland",
      "postal_code": "97897",
      "country": "US"
    }
  },
  "customer": {
    "first_name": "Christopher",
    "last_name": "Palmer",
    "phone_number": "9-(590)311-9256",
    "email": "Christopher.Palmer@test.trivago.com",
    "country": "US"
  },
  "rooms": [
    {
      "party": {
        "adults":2,
            "children":[
                1
            ]
      },
      "traveler_first_name": "Christopher",
      "traveler_last_name": "Palmer"
    }
  ],
  "final_price_at_booking": {
    "amount": 100.0,
    "currency": "USD"
  },
  "final_price_at_checkout": {
    "amount": 5.00,
    "currency": "USD"
  }
}

Body (if tokenization is required):

{
  "checkin_date": "2015-12-01",
  "checkout_date": "2015-12-02",
  "partner_reference": "",
  "reference_id": "",
  "customer": {
    "first_name": "",
    "last_name": "",
    "phone_number": "",
    "email": "",
    "country": ""
  },
  "rooms": [],
  "payment": {
    "method": {
      "code": "PaymentCard",
      "options": [
        {
          "code": "Visa",
          "fee": {
            "amount": 1.5,
            "currency": "USD"
          }
        }
      ]
    },
    "parameters": {
      "token": "6a9c23a8-1f76-4709-903f-c76b9bb86a17",
      "order_id": "123",
      "cvv": "124",
      "callback_success": "",
      "callback_cancel": "",
      "callback_error": "",
      "type": "Tokenization"
    },
    "billing_address": {
      "address1": "",
      "city": "",
      "postal_code": "",
      "country": ""
    }
  },
  "final_price_at_booking": {
    "amount": 0,
    "currency": ""
  },
  "final_price_at_checkout": {
    "amount": 0,
    "currency": ""
  },
  "partner_data": {
    "test": "Frühstück"
  },
  "api_version": 1
}

Request parameters

Field Type Description Mandatory
checkin_date string The user's check-in date in YYYY-MM-DD. true
checkout_date string The user's check-out date in YYYY-MM-DD. true
partner_reference string Advertiser's unique hotel id. true
ip_address string The user's anonymized ip address. false
reference_id string trivago identifier for the booking session. Please consider that this id might not be unique and should not be treated as a "confirmation" id. true
customer Customer The user booking the reservation. true
rooms RoomStay array An array of rooms to be booked. true
payment Payment object Defines the selected payment method of the user. true
final_price_at_booking Price Contains the full price to be paid at time of booking, including taxes and fees. Used to validate the line items. true
final_price_at_checkout Price Contains the full price to be paid at time of stay, including taxes and fees. Used to validate the line items. If the full price is paid at the time of booking, this element must be provided with an amount of 0. true
partner_data number, string or object Echoed partner_data from the booking availability request. true
tracking_data object

Enables advertisers to receive specific information for tracking purpose. Fields supported here can be static fields as given by advertiser or can be dynamic fields as supported for tracking pixel which can be fired from express landing page. Refer here for tracking parameters supported from trivago side at submit e.g:

"tracking_data": {
	"actor": "trivago",
	"tracking_id": "3125354",
	"hotel_id": "123456"
 }
false

Response

Sample code

Header:

Content-Type: application/json

Body (if no additional authorisation required):

{
    "reference_id":"692e8acc-d1d9-45dc-b50f-e7b824f3306f",
    "status":"Success",
    "reservation":{
        "reservation_id":"XXX123",
        "partner_reference":"abc123",
        "status":"Booked",
        "confirmation_url":"https://www.partner-hotel.com/confirm/XXX123",
        "checkin_date":"2016-01-25",
        "checkout_date":"2016-01-26",
        "hotel":{
            "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"
            ],
            "checkinout_policy":"check-in from 3pm and check-out till 12am",
        },
        "customer":{
            "first_name":"Christopher",
            "last_name":"Palmer",
            "phone_number":"9-(590)311-9256",
            "email":"Christopher.Palmer@test.trivago.com",
            "country":"US"
        },
        "rooms":[
            {
                "party":{
                    "adults":2,
                    "children":[
                        1
                    ]
                },
                "traveler_first_name":"Christopher",
                "traveler_last_name":"Palmer"
            }
        ],
        "receipt":{
            "line_items":[
                {
                    "price":{
                        "amount":100,
                        "currency":"USD"
                    },
                    "type":"rate",
                    "paid_at_checkout":false,
                    "description":"base price"
                },
                {
                    "price":{
                        "amount":5,
                        "currency":"USD"
                    },
                    "type":"tax",
                    "paid_at_checkout":true,
                    "description":"city tax"
                }
            ],
            "final_price_at_booking":{
                "amount":100,
                "currency":"USD"
            },
            "final_price_at_checkout":{
                "amount":5,
                "currency":"USD"
            }
        }
    },
    "customer_support":{
        "phone_numbers":[
            {
                "contact":"444-444-4444",
                "description":"Support number"
            }
        ]
    }
}

Body (if additional authorisation required):

{
  "reference_id": "ae79eb46-0048-4c5b-98f4-9a1225589ff5",
  "status": "PaymentPending",
  "authorisation": {
    "reservation_id": "61382b72-546e-465d-82e3-61eb3829727e",
    "partner_data": {
      "transaction_id": "1234"
    },
    "target": {
      "url": "http://www.psp.test/auth",
      "method": "POST",
      "parameters": {
        "id1": "value1",
        "id2": "value2",
        "id3": "value3"
      }
    }
  },
  "customer_support": {
    "phone_numbers": [
      {
        "contact": "1-153-072-9237 x6907",
        "description": "Tempora iure sit accusamus et cupiditate autem reiciendis iusto."
      },
      {
        "contact": "015.409.9218",
        "description": "Commodi aut quia molestiae ut."
      }
    ],
    "emails": [
      {
        "contact": "Roxane.McKenzie@gmail.com",
        "description": "Aspernatur reiciendis quis at qui asperiores."
      }
    ],
    "urls": [
      {
        "contact": "http://kasey.info",
        "description": "Maiores enim cupiditate deserunt ut."
      },
      {
        "contact": "http://johann.biz",
        "description": "Rerum quae earum."
      }
    ]
  }
}

Response properties

Field Type Description Mandatory
problems Problem array

An array containing issues that occurred

true, only if 'status' is "Failure"
reference_id string Echo the reference_id provided by trivago in the corresponding request. If the request fails (timeout or otherwise), this id can be used in a booking verification request to determine if the call was successful. true
status string

An overall status of the booking request. One of the following:

  • Success
  • Failure
  • PaymentPending
true
reservation Reservation Contains details associated with the reservation ( e.g. receipt, date of stay, guests, etc.). Only returned if the booking is successfully made. true, only if 'status' is "Success"
authorisation Authorisation Contains details if additional authorisation (e.g. 3DS or PayPal) is required. In this case, the 'status' must be "PaymentPending". true, only if 'status' is "PaymentPending"
customer_support CustomerSupport

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

Has to be returned on both successes and failures.

true