Booking authorisation

If additional information is needed to authorise a booking (e.g. 3DS or Paypal), trivago sends out a "/booking_payment_authorise" POST request to the advertiser's API. trivago submits booking authorisation request only if the payment is successfully authorized from the card issuing company(success callback to trivago) to inform advertiser to go ahead with further processing of payment.

For detailed workflow refer 3DS workflow suitable for you here

Request

Sample code

Endpoint:

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

Header:

Content-Type: application/json

Body:

{
  "reservation_id": "1234",
  "callback_parameters": "a=1&b=2",
  "partner_data": {
    "test": "Frühstück"
  },
  "api_version": 1
}

Request parameter

Field Type Description Mandatory
api_version number The version of the API used by this request. true
reservation_id string The advertiser's unique id for the reservation. true
callback_parameters string Params added by the PSP to the callback URL. true
partner_data number, string or object Echoed advertiser-specific data required to process the booking. true

Response

Sample code

Header:

Content-Type: application/json

Body:

{
  "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": "john@doe.com",
      "country": "US"
    },
    "rooms": [
      {
        "party": {
          "adults": 2,
          "children": [
            1
          ]
        },
        "traveler_first_name": "Christopher",
        "traveler_last_name": "Palmer"
      }
    ],
    "legal_text": "some legal stuff for confirmation",
    "comments": "special comment for confirmation",
    "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": "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
problems Problem array

An array of problems that occurred

true, if status is "Failure" or "UnknownReference"
reference_id string Echo the reference_id requested by trivago in the request. If the request fails (timeout or otherwise), trivago should be able to use this id in a booking verification request to determine if the call was successful or not. true
status string

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

  • Success
  • Failure
  • UnknownReference
true
reservation Reservation Contains details associated with the reservation ( e.g. receipt, date of stay, guests, etc.). true, if status is "Success"
customer_support CustomerSupport

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

true