Self-assessment tutorial: Promotions API

In this Self-assessment tutorial, you will use the Promo API to:

  • Create and manage different promotion rates
  • Create Basic, Last Minute, Business Booker, or Early Booker rates
  • Create rates that target a certain audience – public, subscribers, China
  • Retrieve details from existing promotion rates

Who is this for?

You should read this if you are any of the following: - a developer who works for an existing Connectivity Partner which had certified for Rates & Availability API and is preparing to implement Promo API - a developer who wants to estimate the time needed to implement the Promo API - a developer who wants to try out most of the essential endpoints of Promo API on test environment

Before you start

You will need the below to complete the tutorial: - A test property with the appropriate machine account permissions. Contact your support team if needed to enable necessary permissions. - The test property must have built/active rate plans and room types (works best if there is open availability for the test property)

Step 1 – Create a Basic Promotion

Send the request with below method and URL to create Basic Promotion:

POST https://supply-xml.booking.com/hotels/xml/promotions
Sample Request body
<request>
   <hotel_id>12312</hotel_id>
    <promotion
        name="Basic Promotion"
        type="basic"
        target_channel="public"
        min_stay_through="3"
        non_refundable="0"
        no_cc_promotion="1">
        <book_date start="2019-05-14" end="2019-07-31" />
        <book_time start="11" end="13" />
        <stay_date start="2019-06-06" end="2019-06-29">
            <active_weekdays>
               <active_weekday>Thu</active_weekday>
           </active_weekdays>
            <excluded_dates>
                <excluded_date>2019-06-15</excluded_date>
                <excluded_date>2019-06-16</excluded_date>
            </excluded_dates>
        </stay_date>
        <additional_dates>
            <additional_date>2019-07-18</additional_date>
            <additional_date>2019-07-20</additional_date>
        </additional_dates>
        <rooms>
            <room id="1423432"/>
            <room id="325436"/>
        </rooms>
        <parent_rates>
            <parent_rate id="756878"/>
            <parent_rate id="543754"/>
        </parent_rates>
        <discount value="10" />
    </promotion>
</request>
Sample Response body
<promotions><id>VR210380280</id></promotions>
<!-- RUID: [...] -->

If the rate is created successfully, the API will return a new promo rate plan ID. Store this ID number! It is needed for any future edits or modifications to the promotion.

Step 2 – Create Last Minute Promo

Send the request with below method and URL to create Last Minute Promotion:

POST https://supply-xml.booking.com/hotels/xml/promotions
Sample Request body
<request>
   <hotel_id>12312</hotel_id>
    <promotion
        name="Late Promotion"
        type="last_minute"
        target_channel="public"
        min_stay_through="3"
        non_refundable="0"
        no_cc_promotion="1">
        <last_minute unit="hour" value="5"/>
        <book_time start="11" end="13" />
        <stay_date start="2019-06-06" end="2019-06-29">
            <active_weekdays>
               <active_weekday>Thu</active_weekday>
           </active_weekdays>
            <excluded_dates>
                <excluded_date>2019-06-15</excluded_date>
                <excluded_date>2019-06-16</excluded_date>
            </excluded_dates>
        </stay_date>
        <additional_dates>
            <additional_date>2019-07-18</additional_date>
            <additional_date>2019-07-20</additional_date>
        </additional_dates>
        <rooms>
            <room id="1423432"/>
            <room id="325436"/>
        </rooms>
        <parent_rates>
            <parent_rate id="756878"/>
            <parent_rate id="543754"/>
        </parent_rates>
        <discount value="10" />
    </promotion>
</request>
Sample Response body
<promotions><id>VR210380280</id></promotions>
<!-- RUID: [...] -->

Step 3 – Create Early Booker Promotion

Send the request with below method and URL to create Last Minute Promotion:

POST https://supply-xml.booking.com/hotels/xml/promotions
Sample Request body
<request>
   <hotel_id>12312</hotel_id>
    <promotion
        name="Dummy Promotion"
        type="early_booker"
        target_channel="public"
        min_stay_through="3"
        non_refundable="0"
        no_cc_promotion="1">
        <early_booker value="5" />
        <book_time start="11" end="13" />
        <stay_date start="2019-06-06" end="2019-06-29">
            <active_weekdays>
               <active_weekday>Thu</active_weekday>
           </active_weekdays>
            <excluded_dates>
                <excluded_date>2019-06-15</excluded_date>
                <excluded_date>2019-06-16</excluded_date>
            </excluded_dates>
        </stay_date>
        <additional_dates>
            <additional_date>2019-07-18</additional_date>
            <additional_date>2019-07-20</additional_date>
        </additional_dates>
        <rooms>
            <room id="1423432"/>
            <room id="325436"/>
        </rooms>
        <parent_rates>
            <parent_rate id="756878"/>
            <parent_rate id="543754"/>
        </parent_rates>
        <discount value="10" />
    </promotion>
</request>
Sample Response body
<promotions><id>VR210380280</id></promotions>
<!-- RUID: [...] -->

Step 4 – Update a Promotion

Send the request with below method and URL to create Last Minute Promotion:

POST https://supply-xml.booking.com/hotels/xml/promotions
Sample Request body
<request>
  <hotel_id>12312</hotel_id>
  <promotion
    id="VR1234"
    min_stay_through="3">
  </promotion>
</request>
Sample Response body
<promotions><id>VR210380280</id></promotions>
<!-- RUID: [...] -->

Step 5 – Retrieve Promotion Details

This endpoint is used to retrieve promotion statistics like total revenue, number of bookings/cancellations, and number of nights reserved.

Send the request with below method and URL to retrieve promotion details:

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

Sample Request Body

<request>
    <hotel_id>1234</hotel_id>
    <id>VR1234</id>
    <active>1</active>
    <name>Basic Promo</name>
</request>

Sample Response body (this includes all possible information that can be included)

<promotions>
  <promotion id="VR12345" name="Summer Deal" type="basic" target_channel="public" min_stay_through="2" non_refundable="-1" min_booked_nights="2" no_cc_promotion="0" active="1">
    <last_minute unit="-1" value="-1"></last_minute>
    <early_booker value="-1"></early_booker>
    <book_date start="-1" end="-1"></book_date>
    <book_time start="-1" end="-1"></book_time>
    <stay_date start="2017-08-20" end="2017-08-30">
      <active_weekdays>
        <active_weekday>Mon</active_weekday>
        <active_weekday>Tue</active_weekday>
        <active_weekday>wed</active_weekday>
        <active_weekday>Thu</active_weekday>
        <active_weekday>Fri</active_weekday>
        <active_weekday>Sat</active_weekday>
        <active_weekday>Sun</active_weekday>
      </active_weekdays>
      <excluded_dates>
        <excluded_date>2017-08-22</excluded_date>
      </excluded_dates>
    </stay_date>
    <additional_dates>
      <additional_date>2016-09-01</additional_date>
      <additional_date>2016-08-31</additional_date>
    </additional_dates>
    <rooms>
      <room id="12223"></room>
      <room id="12345"></room>
    </rooms>
    <parent_rates>
      <parent_rate id="435345"></parent_rate>
    </parent_rates>
    <discount value="5"></discount>
  </promotion>
  <promotion id="VR34234" name="Lastminute hurry" type="last_minute" target_channel="public" min_stay_through="0" non_refundable="-1" min_booked_nights="0" no_cc_promotion="0" active="1">
    <last_minute unit="hour" value="8"></last_minute>
    <early_booker value="-1"></early_booker>
    <book_date start="-1" end="-1"></book_date>
    <book_time start="-1" end="-1"></book_time>
    <stay_date start="2016-06-10" end="2016-06-10">
      <active_weekdays>
        <active_weekday>Fri</active_weekday>
      </active_weekdays>
      <excluded_dates></excluded_dates>
    </stay_date>
    <additional_dates></additional_dates>
    <rooms>
      <room id="1000419"></room>
    </rooms>
    <parent_rates>
      <parent_rate id="12345"></parent_rate>
      <parent_rate id="47568"></parent_rate>
    </parent_rates>
    <discount value="10"></discount>
    <stats>
      <total_revenue value="418.95" currency="EUR"></total_revenue>
      <nr_room_nights>1</nr_room_nights>
      <nr_bookings>1</nr_bookings>
      <nr_cancellations>0</nr_cancellations>
    </stats>
  </promotion>
</promotions>
<!-- RUID: [...] -->

Step 6 - Deactivate a Promotion

Use the following method and URL

DELETE https://supply xml.booking.com/hotels/xml/promotions?id={promotionID}&hotel_id={hotelID}
Sample Response body
<promotions><id>VR210380223</id></promotions>
<!-- RUID: [...] -->