Last updated

Self-assessment tutorial: Reporting API

In this self-assessment tutorial, you will learn how to use the Reporting API to:

  • Report no-shows.
  • Report invalid credit card usage and cancel a reservation booked using an invalid credit card details.
  • Change the check-out date and price.

Who is this for?

You should read this if you're a developer:

  • Who works for an existing Connectivity Partner, which is preparing to implement the Reporting API.
  • Who wants to try out the Reporting API in a test environment.

!!! Warning "Test properties do not come with reservations prefilled"

To start the tutorial you need a test property with an active connection that has at least one room, availability, and prices.


Tutorial

  1. Create three test reservations with your test property ID by using the following link:
https://secure.booking.com/book.html?test=1;hotel_id={property_id}
  • Reservation One:

    • Use today as check-in date.
    • Book for one night.
    • Use "Test One" as guest name.
    • Use an email address that you have access to.
    • Fill in the rest of the required information. (Use 4111 1111 1111 1111 for a Visa test card.)
  • Reservation Two and Three:

    • Do same as above but book for two nights.
    • Use "Test Two" and "Test Three" as guest name respectively.

    After you complete your reservations, you receive confirmation messages on the specified email address.

  1. Retrieve the reservation IDs for the three test reservations through OTA:
  • For OTA, you can find the ID by searching for HotelReservationID: <HotelReservationID ResID_Value="{Reservation_ID}">
  • For B.XML, you can find the ID by searching for id: <id>{Reservation_ID}</id>`
  1. Mark Reservation One as a no-show by calling the following endpoint and including its reservation ID:

HTTP request

  POST https://supply-xml.booking.com/hotels/xml/reporting

Request body example

<request>
   <reservation_id>{Reservation_One_ID}</reservation_id>
   <report waived_fees="no">is_no_show</report>
</request>

Response body example (success)

<status>enqueued</status>
<!-- RUID: [YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY==] -->
  1. Report an invalid credit card for Reservation Two by calling the following endpoint and including its reservation ID again:

HTTP Request

POST https://supply-xml.booking.com/hotels/xml/reporting

Request body example

<request>
   <reservation_id>{Reservation_Two_ID</reservation_id>
   <report>cc_is_invalid</report>
</request>

Response body example (success)

<status>enqueued</status>
<!-- RUID: [YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY==] -->

The reservation is not yet cancelled. The guest receives an email stating that their card is declined and to update their payment information within a specified time span.

  1. Cancel Reservation Two because of the invalid credit card by calling the following endpoint and including its reservation ID again:

HTTP request

POST https://supply-xml.booking.com/hotels/xml/reporting

Request body example

<request>
   <reservation_id>{Reservation_Two_ID</reservation_id>
   <report>cancel_reservation_invalid_cc</report>
</request>

Response body example (success)

<status>ok</status>
<!-- RUID: [YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY==] -->
  1. Change the check-out date and price for Reservation Three by calling the following endpoint and including its reservation ID again:

HTTP request

POST https://supply-xml.booking.com/hotels/xml/reporting

Request body example

<request>
   <reservation_id>Reservation_Three_ID</reservation_id>
   <stay_change>
      <roomreservation_id>{Room_Reservation_ID</roomreservation_id>
      <checkin>YYYY-MM-DD</checkin>
      <checkout>YYYY-MM-DD</checkout>
      <price>{Price}</price>
   </stay_change>
</request>

Response body example (success)

<status>enqueued</status>
<!-- RUID: [YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY==] -->
  1. Retrieve the three reservations again to check the modifications.