Last updated

Managing policies

The Policies API enables you to create and manage cancellation policies on the property level. You can:

Creating a cancellation policy

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

This endpoint enables you to create a new cancellation policy for a property. You can create a maximum of 7 cancellation policies for properties.

Use this endpoint to create one cancellation policy at a time. To create more than 1 cancellation policy, run the endpoint multiple times.

Cannot create duplicate cancellation policies

You cannot create cancellation policies with the same combination of penalty code, guarantee payment and no show penalty conditions. However, you can use the same penalty code to create multiple cancellation policies with one or more combinations of these conditions.

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 to which the cancellation policy applies.integerrequiredYou must have permission to edit the property.

Request body parameters

The following table describes the elements you must add in the request body:

ElementAttributeDescriptionTypeRequired/
Optional
Notes
RequestRoot elementobjectrequired
> PoliciesContains the cancellation policy information you want to create for a property.objectrequiredThere 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.objectrequiredFor more information on cancellation, guarantee payment and noshow penalty conditions, see Understanding cancellation policy penalty conditions.
typeSpecifies the policy type.enumerated stringrequiredCurrently, the API supports only Cancellation.
>>> CancelPenaltyContains the details of the cancellation penalty assigned to the policy.objectrequired
PolicyCodeSpecifies the Booking.com cancellation code that suits your business needs.integerrequiredFor a full list of cancellation codes and their descriptions, see the cancellation policy codes.
>>> GuaranteePaymentContains guarantee payment details.objectrequiredCertain 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 have the freedom to specify any guarantee payment value for all other penalty codes.
RequiredIndicates whether a guarantee payment is mandatory.booleanrequiredPossible 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.
EffectiveFromSpecifies when the guarantee payment is charged.enumerated stringmandatory 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.
>>> NoShowPolicyContains the no show penalty details.objectoptional
PenaltySpecifies the penalty charged in case the guest does not turn up for the reservation.enumerated stringoptionalPossible 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.

Penalty code and guarantee payment matrix

The following table contains cancellation policy codes that need specific GuaranteePayment Required and EffectiveFrom values.

Cancel Penalty CodeGuarantee payment requiredGuarantee payment EffectiveFromNotes
1trueafter_reservation_is_madeNon-refundable policy.
152falseNot applicableFully flexible policy.
166trueafter_reservation_is_madePartially refundable policy.
168trueafter_reservation_is_madePartially refundable policy.

Request body example

The following request body example creates a cancellation policy as shown in the Response body section:

PolicyCode="55": 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. In this case, until 2 days before the arrival date. If the guests do not turn up for the reservation, then they are charged the total stay price.
Alternatively, you can set NoShowPolicy Penalty to default to charge the guests the same as the cancellation fee.

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

Response body

<?xml version='1.0' encoding='UTF-8'?>
<Response>
 <Success/>
 <Policies>
  <Policy Id="342546364" GroupName="partially 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: [UmFuZG9tSVYkc2RlIyh9YYpJvAsQ/OdctGdjkiDQ+B+dNlGSmheRnEVdvjxt7REIIRr8gNYNj0Gn3CLTKeGYjg==] -->

Response body elements

The following table describes the response elements:

ElementAttributeDescriptionTypeNotes
ResponseRoot elementobject
> PoliciesContains the details of the cancellation policy created for the property.object
>> PolicyContains the cancellation, guarantee payment, and no show penalty details for each cancellation policy.object
IdSpecifies the uniquely identifiable policy ID.integerUse this value to make subsequent edits to the policy. However, the policy ID remains unchanged across the policy's lifespan.
GroupNameSpecifies the internal policy name. GroupName and Policy ID are unrelated.stringThe group name does not hold any logic and is randomly assigned, except for 'general' which indicates it is the default policy. However, you can use a policy's group name to identify it in the extranet. In future, GroupName may get deprecated.
TypeSpecifies the policy type.enumerated stringCurrently, the API supports only Cancellation.
>>> CancelPenaltyContains the details of the cancellation penalty assigned to the policy.object
PolicyCodeSpecifies the Booking.com cancellation code that was included in the request.integer
>>>> PenaltyDescriptionContains the cancellation penalty description.object
>>>>> textSpecifies the cancellation penalty in natural language.stringCurrently, the API supports description text in English.
>>> NoShowPolicyContains the no show penalty details.object
PenaltySpecifies the penalty charged in case the guest does not turn up for the reservation.enumerated stringPossible 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.
>>> GuaranteePaymentContains the guarantee payment details.object
RequiredSpecifies whether a guarantee payment is mandatory.booleanPossible values are:
- true: Guarantee payment required
- false: Guarantee payment is not required
EffectiveFromSpecifies when the guarantee payment is charged.enumerated stringPossible values are:
- after_reservation_is_made: Enforces guests to make a payment immediately after reservation.
- after_cancellation_fee_begins: Enforces guests to make a payment after the free cancellation window has closed.
>>>> TPA_ExtensionsContains the guarantee payment description.object
>>>>> DescriptionSpecifies the guarantee payment in natural language.stringCurrently, the API supports description text in English.
ruidSpecifies the unique request ID.stringYou can share this ID with Booking.com customer support when you run into an issue. This can help in understanding what went wrong.
SuccessSpecifies the success status of the request.object
errorsLists potential errors. This can help in understanding what went wrong with your request.arrayThis can help in understanding what went wrong with your request. For a list of errors/warnings and how to troubleshoot them, see Troubleshooting errors.
warningsLists potential warnings. This can help you improve your requests.arrayThis can help improve your requests in future.

Creating a duplicate cancellation policy returns an error

When creating a duplicate cancellation policy with the same combination of penalty code, guarantee payment and no show penalty conditions, the API returns an error along with the details of the existing cancellation policy.

<?xml version='1.0' encoding='UTF-8'?>
<Response>
    <Policies>
        <Policy Id="341337682" GroupName="general" Type="Cancellation">
            <CancelPenalty PolicyCode="568"/>
            <NoShowPolicy Penalty="default"/>
            <GuaranteePayment Required="false" EffectiveFrom="after_reservation_is_made"/>
            <Tags>
                <Default/>
            </Tags>
        </Policy>
    </Policies>
    <Errors>
        <Error Code="DUPLICATE_POLICY" ShortText="Cannot have 2 policies with the same cancellation and prepayment codes">
            <Details>
                <PolicyCode>341337682</PolicyCode>
            </Details>
        </Error>
    </Errors>
</Response>
<!-- RUID: [UmFuZG9tSVYkc2RlIyh9Yc2VQEtEQcWis2P7po9uf/HW/V97Zg8yxXcJRBupSbBiP1BtpRH5az5Fe10g+nziEQ==] -->

Changing policy details

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

Use this endpoint to change the existing penalty conditions of a cancellation policy. Note that the policy ID remains unchanged.

Editing cancellation policies assigned to a roomrate

You can change the penalty conditions for any cancellation policy, including a policy that is assigned to a roomrate. Once changed, the new penalty conditions are applied to the roomrate. The API doesn't respond with a warning when a cancellation policy that is already assigned to a roomrate is modified.

Let's consider that a property already has the following 3 cancellation policies:

  • Cancellation policy 1 -- PolicyCode="152", GuaranteePayment Required = "false", NoShow Penalty = "default"
  • Cancellation policy 2 -- PolicyCode="49" , GuaranteePayment Required = "false", NoShow Penalty = "default"
  • Cancellation policy 3 -- PolicyCode="1", GuaranteePayment Required = "true" EffectiveFrom="after_reservation_is_made", NoShow Penalty = "total_price"

You can use the above endpoint to change the cancellation code of the cancellation policy 2 to, let's say, PolicyCode="45" (Flexible - 14:00 on arrival day) , GuaranteePayment Required = "true" EffectiveFrom="after_cancellation_fee_begins", NoShow Penalty = "total_price".

Make sure to specify the appropriate policy ID to edit a cancellation policy. To find the unique policy ID, run the GET policies endpoint.

Path parameters

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

ElementDescriptionTypeRequired/
Optional
Notes
property_idThe unique ID of the property to which the cancellation policy applies.integerrequiredYou must have permission to edit the property.
policy_idThe unique ID of the cancellation policy to edit.integerrequiredYou must have permission to edit the property.

Request body parameters

The following table describes the elements you must add in the request body:

ElementAttributeDescriptionTypeRequired/
Optional
Notes
RequestRoot element.objectrequired
> PoliciesContains the cancellation policy details to update a specific policy.objectrequired
>> PolicyContains the cancellation, guarantee payment and no show penalty fees for the policy.objectrequiredFor more information on cancellation, guarantee payment and noshow penalty fees, see Understanding cancellation policy penalty conditions.
typeSpecifies the policy type.enumerated stringrequiredCurrently, the API supports only Cancellation.
>>> CancelPenaltyContains the details of the cancellation penalty assigned to the policy.objectrequired
PolicyCodeSpecifies the Booking.com cancellation code that suits your business needs.integerrequiredFor a full list of cancellation codes and their descriptions, see the cancellation policy codes.
>>> GuaranteePaymentContains guarantee payment details.objectrequiredCertain penalty codes accept only specific combinations of Required and EffectiveFrom values. For example, a non-refundable penalty code must have the Required option 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 have the freedom to specify any guarantee payment value for all other penalty codes.
RequiredSpecifies whether a guarantee payment is mandatory.booleanrequiredPossible 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.
EffectiveFromSpecifies when the guarantee payment is charged.enumerated stringmandatory 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.
>>> NoShowPolicyContains the no show penalty details.objectoptional
PenaltySpecifies the penalty charged in case the guest does not turn up for the reservation.enumerated stringoptionalPossible 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.

Request body example

The following is a request body example where you can modify a cancellation policy's penalty conditions:

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

Response body example

<?xml version='1.0' encoding='UTF-8'?>
<Response>
    <Success/>
    <Policies>
        <Policy Id="342546377" GroupName="special conditions 2" Type="Cancellation">
            <CancelPenalty PolicyCode="45">
                <PenaltyDescription>
                    <text>The guest can cancel free of charge until 14:00 on the day of arrival. The guest will be charged 50% of the total price if they cancel after 14:00 on the day of 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_cancellation_fee_begins">
                <TPA_Extensions>
                    <Description>The guest will be charged a prepayment of 50% of the total price after 14:00 on the day of arrival.</Description>
                </TPA_Extensions>
            </GuaranteePayment>
        </Policy>
    </Policies>
</Response>
<!-- RUID: [UmFuZG9tSVYkc2RlIyh9YdeUx1ir1qlOvYo5I5xc56iKQJbXCr6IJtAiYYsytOvMji/5UbFFD4dFStbg0mqYyQ==] -->

Response body elements

The following table describes the response elements:

ElementAttributeDescriptionTypeNotes
ResponseRoot element.object
> PoliciesContains the details of the cancellation policy created for the property.object
>> PolicyContains the cancellation, guarantee payment, and no show penalty details for each cancellation policy.object
IdSpecifies the uniquely identifiable policy ID.integerThe policy ID remains unchanged across the policy's lifespan.
GroupNameSpecifies the internal policy name. Policy ID and GroupName are unrelated.stringThe group name does not hold any logic and is randomly assigned, except for 'general' which indicates it is the default policy. However, you can use a policy's group name to identify it in the extranet. In future, GroupName may get deprecated.
TypeSpecifies the policy type.enumerated stringCurrently, the API supports only Cancellation.
>>> CancelPenaltyContains the details of the cancellation penalty assigned to the policy.object
PolicyCodeSpecifies the Booking.com cancellation code that was included in the request.integer
>>>> PenaltyDescriptionContains the cancellation penalty description.object
>>>>> textSpecifies the cancellation penalty in natural language.stringCurrently, the API supports description text in English.
>>> NoShowPolicyContains the no show penalty details.object
PenaltySpecifies the penalty charged in case the guest does not turn up for the reservation.enumerated stringPossible 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.
>>> GuaranteePaymentContains the guarantee payment details.object
RequiredSpecifies whether a guarantee payment is mandatory.booleanPossible values are:
- true: Guarantee payment required
- false: Guarantee payment is not required
EffectiveFromSpecifies when the guarantee payment is charged.enumerated stringPossible values are:
- after_reservation_is_made: Enforces guests to make a payment immediately after reservation.
- after_cancellation_fee_begins: Enforces guests to make a payment after the free cancellation window has closed.
>>>> TPA_ExtensionsContains the guarantee payment description.object
>>>>> DescriptionSpecifies the guarantee payment in natural language.stringCurrently, the API supports description text in English.
ruidSpecifies the unique request ID.stringYou can share this ID with Booking.com customer support when you run into an issue. This can help in understanding what went wrong.
SuccessSpecifies the success status of the request.object
errorsLists potential errors. This can help in understanding what went wrong with your request.arrayThis can help in understanding what went wrong with your request. For a list of errors/warnings and how to troubleshoot them, see Troubleshooting errors.
warningsLists potential warnings. This can help you improve your requests.arrayThis can help improve your requests in future.

Retrieving policy details

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

Use this endpoint to retrieve all the existing cancellation policies of a property.

Path parameters

The following table lists the path parameters in the request:

ParameterDescriptionTypeRequired/OptionalNotes
property_idSpecify the property ID to view all the cancellation policies created for it.integerrequiredYou can only specify one property ID per call.

Request body example

This request has no body parameters. The property ID is specified in the path.

Response body example

The following is a successful response body example:

<?xml version='1.0' encoding='UTF-8'?>
<Response>
    <Policies>
        <Policy Id="341337682" GroupName="general" Type="Cancellation">
            <CancelPenalty PolicyCode="43">
                <PenaltyDescription>
                    <text>The guest can cancel free of charge until 14:00 on the day of arrival. The guest will be charged the cost of the first night if they cancel after 14:00 on the day of 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_cancellation_fee_begins">
                <TPA_Extensions>
                    <Description>The guest will be charged a prepayment of the cost of the first night after 14:00 on the day of arrival.</Description>
                </TPA_Extensions>
            </GuaranteePayment>
            <Tags>
                <Default/>
            </Tags>
        </Policy>
        <Policy Id="341337684" GroupName="non refundable" Type="Cancellation">
            <CancelPenalty PolicyCode="1">
                <PenaltyDescription>
                    <text>The guest will be charged the total price of the reservation if they cancel at any time. 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 the total price of the reservation at any time.</Description>
                </TPA_Extensions>
            </GuaranteePayment>
        </Policy>
    </Policies>
</Response>
<!-- RUID: [UmFuZG9tSVYkc2RlIyh9YfVa0UDxWENgbrndLA72Iett82KnybF4RoaYlUrkCWX90ubm68zY3Nhwm4kPeKcIvQ==] -->

Response body elements

The following table describes the response elements:

ElementAttributeDescriptionTypeNotes
ResponseRoot elementobject
> PoliciesContains the details of all the cancellation policies created for the property.array of Policy
>> PolicyContains the cancellation, guarantee payment, and no show penalty details for each cancellation policy.object
IdSpecifies the unique policy ID.integerThe policy ID remains unchanged across the policy's lifespan.
GroupNameSpecifies the internal policy name. Policy ID and GroupName are unrelated.stringThe group name does not hold any logic and is randomly assigned, except for 'general' which indicates it is the default policy. However, you can use a policy's group name to identify it in the extranet. In future, GroupName may get deprecated.
TypeSpecifies the policy type.enumerated stringCurrently, the API supports only Cancellation.
>>> CancelPenaltyContains the details of the cancellation penalty assigned to the policy.object
PolicyCodeSpecifies the Booking.com cancellation code that was included in the request.integerFor a list of all the available cancellation codes, see the cancellation policy codes.
>>>> PenaltyDescriptionContains the cancellation penalty description.object
>>>>> textSpecifies the cancellation penalty in natural language.stringCurrently, the API supports description text in English.
>>> NoShowPolicyContains the no show penalty details.object
PenaltySpecifies the penalty charged in case the guest does not turn up for the reservation.enumerated stringPossible 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.
>>> GuaranteePaymentContains the guarantee payment details.object
RequiredSpecifies whether a guarantee payment is mandatory.booleanPossible values are:
- true: Guarantee payment required
- false: Guarantee payment is not required
EffectiveFromSpecifies when the guarantee payment is charged.enumerated stringPossible values are:
- after_reservation_is_made - Enforces guests to make a payment immediately after reservation.
- after_cancellation_fee_begins: Enforces guests to make a payment after the free cancellation window has closed.
>>>> TPA_ExtensionsContains the guarantee payment description.object
>>>>> DescriptionSpecifies the guarantee payment in natural language.stringCurrently, the API supports description text in English.
>>> TagsContains the Default element.array
>>>> DefaultIndicates that the cancellation policy is the default policy.objectWhen a roomrate is created without specifying a policy, the OTA_HotelProductNotif API assigns the policy with this tag to the roomrate.
ruidSpecifies the unique request ID.stringYou can share this ID with Booking.com customer support when you run into an issue. This can help in understanding what went wrong.
errorsLists potential errors.arrayThis can help in understanding what went wrong with your request. For a list of errors/warnings and how to troubleshoot them, see Troubleshooting errors.
warningsLists potential warnings.arrayThis can help improve your requests in future.

Repurpose existing policy

Policies API does not support deleting existing policies. Adding to the constraint, you can only create seven policies. This section shows you how to repurpose an existing policy to enforce new cancellation penalty conditions.

Following are the high-level steps:

  1. Select a policy to repurpose.

    Identify an unused policy or one that can be repurposed. You can also check with the property to identify an existing policy that can be repurposed to a new policy.

  2. Remove policy assignments.

    If the selected policy is attached to roomrate(s), use the POST /ota/OTA_HotelProductNotif endpoint to assign a different policy to the impacted roomrates.

    New cancellation penalty condition is enforced

    When you change cancellation penalty conditions of policies that are attached to roomrate(s), the new conditions take effect immediately. The original penalty conditions are applied only for reservations made during the update.

  3. Update policy details.

    Update the cancellation penalty details to match the new penalty conditions.

  4. Assign the repurposed policy.

    Use the POST /ota/OTA_HotelProductNotif endpoint to assign the repurposed policy to relevant roomrate(s).

  5. Verify the changes.

    Use the GET OTA_HotelProductNotif or the POST /xml/roomrates endpoint to retrieve active roomrates. Confirm the policy is correctly assigned to the intended roomrates.

Quick Actions

→ To view roomrate details including the cancellation policy assigned to it, see Retrieving active roomrates.