Last updated

Step 6 - Create policies

Use the Policies API to create, modify, and retrieve cancellation policies for your properties.

Cancellation policies are specific to a property. You must create cancellation policies on the property level but assign them on the roomrate level.

In this tutorial, we create a non-refundable cancellation policy with the following conditions:

  • The guest can cancel free of charge until 2 days before arrival.
  • The guest will be charged 50% of the total price if they cancel in the 2 days before arrival.
  • If the guest doesn't show up, they will be charged the total price of the reservation.

Prerequisites

You must have a property ID by completing step 2 successfully.

Creating a cancellation policy

POST
https://supply-xml.booking.com/policy-api/properties/{property_id}/policies

Note down the policy ID in the response. You'll need it when creating the roomrate in step 12.

Path parameters

The following table describes the elements you must specify in the path:

ElementDescriptionTypeRequired/
Optional
Notes
property_idSpecifies the unique ID of the property.integerrequired

Request body parameters

All parameters are required unless otherwise noted.

ParameterDescription
RequestRoot element
> PoliciesContains the cancellation policy information you want to create for a property. There is a limit to the total number of cancellation policies you can create, that is, 7 for properties.
>> PolicyContains cancellation, guarantee payment and no show penalty fees for the policy. For more information on cancellation, guarantee payment and noshow penalty conditions, see Understanding cancellation policy penalty conditions.
typeSpecifies the policy type. Currently, the API supports only Cancellation.
>>> CancelPenaltyContains the details of the cancellation penalty assigned to the policy.
PolicyCodeSpecifies the Booking.com cancellation code that suits your business needs. For a full list of cancellation codes and their descriptions, see the cancellation policy codes.
>>> GuaranteePaymentContains guarantee payment details. Certain penalty codes accept only specific combinations of Required and EffectiveFrom values. For example, a non-refundable penalty code must have the Required attribute always set to true and the fully-flexible penalty code must have the Required attribute always set to false. Except for the penalty codes specified in the Penalty code and guarantee payment matrix, you can specify any guarantee payment value for all other penalty codes.
RequiredIndicates whether a guarantee payment is mandatory. Possible values are:
- true: Guarantee payment required
- false: Guarantee payment is not required
For CancelPenalty PolicyCode= 1,152,166 and 168, see the Penalty code and guarantee payment matrix.
EffectiveFrom[Mandatory only when Required = "true"] Specifies when the guarantee payment is charged. Mandatory only when Required = "true". Possible values are:
- after_reservation_is_made: Use if you want the guests to make a payment immediately after reservation.
- after_cancellation_fee_begins: Use if you want the guests to make a payment after the free cancellation window has closed.
If Required = "false", then any value provided here is ignored.
For CancelPenalty PolicyCode = 1, 166 and 168, see the Penalty code and guarantee payment matrix.
>>> NoShowPolicy[Optional] Contains the no show penalty details.
Penalty[Optional] Specifies the penalty charged in case the guest does not turn up for the reservation. Possible values are:
- default: Use if you want the no show penalty to follow the cancellation fee.
- total_price: Use if you want the no show penalty to equal the total reservation price.
By default, the API creates a policy with a no show penalty that equals the cancellation penalty.

Sample request

This is a sample request for a cancellation policy with code 55.

<Request>
   <Policies>
      <Policy Type="Cancellation">
         <CancelPenalty PolicyCode="55" />
         <GuaranteePayment Required="true" EffectiveFrom="after_reservation_is_made">
         </GuaranteePayment>
         <NoShowPolicy Penalty="total_price" />
      </Policy>
   </Policies>
</Request>

Sample response

A successful response looks as follows:

Note down the Policy ID from the response which we will use in step 12: Add roomrate.

<?xml version='1.0' encoding='UTF-8'?>
<Response>
    <Success/>
    <Policies>
        <Policy Id="419417191" GroupName="non refundable" Type="Cancellation">
            <CancelPenalty PolicyCode="55">
                <PenaltyDescription>
                    <text>The guest can cancel free of charge until 2 days before arrival. The guest will be charged 50% of the total price if they cancel in the 2 days before arrival. If the guest doesn't show up, they will be charged the total price of the reservation.</text>
                </PenaltyDescription>
            </CancelPenalty>
            <NoShowPolicy Penalty="total_price"/>
            <GuaranteePayment Required="true" EffectiveFrom="after_reservation_is_made">
                <TPA_Extensions>
                    <Description>The guest will be charged a prepayment of 50% of the total price after reservation.</Description>
                </TPA_Extensions>
            </GuaranteePayment>
        </Policy>
    </Policies>
</Response>
<!-- RUID: [XXXXXXXXXXXXXXXXXXX] -->