Обзор
Этот API позволяет указывать возможные скидки. Из указанных акций Google применяет ту или иную акцию или набор акций, которые приводят к самой низкой цене. Если вам нужен API, поддерживающий произвольные корректировки цен, позволяющие увеличивать или уменьшать цену при соблюдении условий, рассмотрите наш API для изменения цен . Обратите внимание, что при наличии обоих API корректировка цен применяется до применения акций.
Запросы
Синтаксис
В сообщении Promotions используется следующий синтаксис:
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner= "partner_key"
id="message_ID"
timestamp="timestamp">
<HotelPromotions hotel_id="HotelID" action="[overlay]">
<Promotion id="PromotionID" action="[delete]">
<BookingDates>
<DateRange start="YYYY-MM-DD[THH:mm:ss]" end="YYYY-MM-DD[THH:mm:ss]"
days_of_week="MTWHFSU_or_subset"/>
<DateRange start="YYYY-MM-DD[THH:mm:ss]" end="YYYY-MM-DD[THH:mm:ss]"
days_of_week="MTWHFSU_or_subset"/>
</BookingDates>
<BookingWindow min="integer_or_duration" max="integer_or_duration"/>
<Ceiling amount_per_night="float"/>
<Floor amount_per_night="float"/>
<CheckinDates>
<DateRange start="[YYYY-]MM-DD" end="[YYYY-]MM-DD" days_of_week="MTWHFSU_or_subset"/>
</CheckinDates>
<CheckoutDates>
<DateRange start="[YYYY-]MM-DD" end="[YYYY-]MM-DD" days_of_week="MTWHFSU_or_subset"/>
</CheckoutDates>
<!-- Specify only one of percentage, percentage_of_base, fixed_amount,
fixed_amount_per_night, fixed_price, or fixed_price_per_night;
applied_nights is only used with percentage, fixed_amount_per_night,
and fixed_price_per_night. -->
<Discount percentage="float" percentage_of_base="float"
fixed_amount="float" fixed_amount_per_night="float"
fixed_price="float" fixed_price_per_night="float"
applied_nights="integer_1_to_99" rank="integer_1_to_99">
<!-- FreeNights may not be used in conjunction with attributes on Discount -->
<FreeNights stay_nights="integer" discount_nights="integer"
discount_percentage="float" night_selection="[cheapest|last]"
repeats="boolean"/>
</Discount>
<!-- Exactly one of Discount or BestDailyDiscount must be specified.
Specify only one of percentage, fixed_amount, or fixed_price. -->
<BestDailyDiscount percentage="float" fixed_amount="float" fixed_price="float"/>
<Devices>
<Device type="[desktop|tablet|mobile]"/>
</Devices>
<InventoryCount min="integer" max="integer"/>
<LengthOfStay min="integer" max="integer"/>
<MembershipRateRule id="RateRuleID"/>
<MinimumAmount before_discount="integer"/>
<Occupancy min="integer" max="integer"/>
<RatePlans>
<RatePlan id="PackageID_1"/>
<RatePlan id="PackageID_2"/>
</RatePlans>
<RoomTypes>
<RoomType id="RoomID_1"/>
<RoomType id="RoomID_2"/>
</RoomTypes>
<Stacking type="[any|base|none|second]"/>
<StayDates application="[all|any|overlap]">
<DateRange start="[YYYY-]MM-DD" end="[YYYY-]MM-DD" days_of_week="MTWHFSU_or_subset"/>
</StayDates>
<UserCountries type="[include|exclude]">
<Country code="country_code"/>
</UserCountries>
</Promotion>
</HotelPromotions>
</Promotions>
Элементы и атрибуты
Рекламное сообщение содержит следующие элементы и атрибуты:
| Элемент / @Атрибут | События | Тип | Описание |
|---|---|---|---|
| Promotions | 1 | Complex element | Основной элемент рекламного сообщения. |
| Promotions / @partner | 1 | string | Партнерская учетная запись для этого сообщения. Это строковое значение соответствует значению "Партнерский ключ", указанному на странице настроек учетной записи в Hotel Center. If you have a backend that provides feeds for multiple accounts, this value needs to match the |
| Promotions / @id | 1 | string | Уникальный идентификатор для данного запроса. Это значение возвращается в ответном сообщении. Допустимые символы: az, AZ, 0-9, _ (подчеркивание) и - (тире). |
| Promotions / @timestamp | 1 | DateTime | Дата и время создания этого сообщения. |
| Promotions / HotelPromotions | 0..n | HotelPromotions | Акции для объекта недвижимости. Каждая акция распространяется на один объект недвижимости. Если не используется |
| Promotions / HotelPromotions / @hotel_id | 1 | string | Уникальный идентификатор объекта недвижимости. Это значение должно совпадать с идентификатором отеля, указанным с помощью <id> в элементе <listing> в ленте списка отелей. Идентификатор отеля также указан в Hotel Center . |
| Promotions / HotelPromotions / @action | 0..1 | enum | Если указано, значение должно быть Если не указано иное, то каждая акция, указанная в текущем сообщении, является либо:
|
| Promotions / HotelPromotions / Promotion | 0..99 | Promotion | Одна рекламная акция для объекта недвижимости. Обратите внимание, что если Если вам необходимо использовать более 99 рекламных акций, свяжитесь со своим техническим менеджером по работе с клиентами (TAM). |
| Promotions / HotelPromotions / Promotion / @id | 1 | string | Уникальный идентификатор акции. Максимальное количество символов — 40. Допустимые символы: az, AZ, 0-9, _ (подчеркивание), - (тире) и . (точка). |
| Promotions /HotelPromotions / Promotion / @action | 0..1 | enum | If specified, the value must be If |
| Promotions / HotelPromotions / Promotion / BookingDates | 0..1 | BookingDates | Для применения акции необходимо наличие контейнера, содержащего один или несколько диапазонов, определяющих условия бронирования. |
| Promotions / HotelPromotions / Promotion / BookingDates / DateRange | 1..99 | DateRange | Укажите временной интервал, в течение которого необходимо оформить бронирование, чтобы скидка была применена. |
| Promotions / HotelPromotions / Promotion / BookingDates / DateRange / @start | 0..1 | Date или DateTime | Начальная дата или время (в соответствии с часовым поясом объекта недвижимости), включая указанный диапазон.
|
| Promotions / HotelPromotions / Promotion / BookingDates / DateRange / @end | 0..1 | Date или DateTime | Дата или время окончания (в соответствии с часовым поясом объекта недвижимости), включая указанный диапазон.
|
| Promotions / HotelPromotions / Promotion / BookingDates / DateRange / @days_of_week | 0..1 | string | The days of the week that are allowed in the date range. If not specified, all days are allowed in the date range. Each character in the string specifies a day. For example, "MTWHF" specifies that weekdays are allowed in the date range. Допустимые символы:
Допустима любая комбинация символов. |
| Promotions / HotelPromotions / Promotion / BookingWindow | 0..1 | BookingWindow | Specifies the time period when booking must occur relative to the check-in date (based on the property's time zone). For example, the booking window can be set to least 7 days, but not more than 180 days, prior to check-in. |
| Promotions / HotelPromotions / Promotion / BookingWindow / @min | 0..1 | integer or duration | Для применения акции необходимо соблюдение минимального срока проживания до момента регистрации заезда, указанного при бронировании. Если этот срок не указан или равен 0 , минимальный срок не применяется.Допустимые типы значений:
|
| Promotions / HotelPromotions / Promotion / BookingWindow / @max | 0..1 | integer or duration | Для применения акции необходимо указать максимальное количество дней, предшествующих заезду при бронировании. Если это значение не указано или равно 0 , то максимального количества дней не существует.Допустимые типы значений:
|
| Promotions / HotelPromotions / Promotion / Ceiling | 0..1 | Ceiling | Определяет ограничения на максимальное значение, которое может быть установлено для тарифа после применения рекламных акций. В условиях акции всегда необходимо указывать If stacking is configured, then multiple promotions with Пример: Расчет стоимости одной ночи проживания, где
Вот порядок вычислений:
Тот факт, что 60 — это более строгий общий потолок, не имеет значения, поскольку он действует только для самой акции, и не может быть единого потолка, который бы охватывал всю систему акций. |
| Promotions / HotelPromotions / Promotion / Ceiling / @amount_per_night | 1 | float | Максимальная сумма, которую можно установить для ночной ставки после применения скидки. Если также указан элемент |
| Promotions / HotelPromotions / Promotion / Floor | 0..1 | Floor | Определяет ограничения на минимальное значение, до которого может быть установлена ставка после применения рекламных акций. В условиях акции всегда необходимо указывать Логика If stacking is configured, then multiple promotions with Пример: Расчет стоимости одной ночи проживания, где
Вот порядок вычислений:
Тот факт, что 90 — это более строгий общий минимальный уровень, не имеет значения, поскольку он действует только для самой акции, и не может быть единого минимального уровня, который бы охватывал весь набор акций. |
| Promotions / HotelPromotions / Promotion / Floor / @amount_per_night | 1 | float | Минимальная сумма, на которую может быть установлена стоимость номера за ночь после применения скидки. Если также указан элемент |
| Promotions / HotelPromotions / Promotion / CheckinDates | 0..1 | CheckinDates | Контейнер для одного или нескольких диапазонов дат, определяющих, когда должна произойти регистрация заезда, чтобы акция была применена. |
| Promotions / HotelPromotions / Promotion / CheckinDates / DateRange | 1..20 | DateRange | Укажите диапазон дат, когда должна произойти регистрация, чтобы акция была применена. Этот параметр не является обязательным, если вы удаляете одну или несколько акций. Поддерживается также формат YearlessDate .
|
| Promotions / HotelPromotions / Promotion / CheckinDates / DateRange / @start | 0..1 | Date or YearlessDate | The starting date (based on the property's time zone), inclusive, of the date range. This date must be before, or the same as, the end date. If start isn't specified, the date range is effectively unlimited in terms of a start date. |
| Promotions / HotelPromotions / Promotion / CheckinDates / DateRange / @end | 0..1 | Date or YearlessDate | The ending date (based on the property's time zone), inclusive, of the date range. This date must be the same as, or after, the start date. If end isn't specified, the date range is effectively unlimited in terms of an end date. |
| Promotions / HotelPromotions / Promotion / CheckinDates / DateRange / @days_of_week | 0..1 | string | The days of the week that are allowed in the date range. If not specified, all days are allowed in the date range. Each character in the string specifies a day. For example, "MTWHF" specifies that weekdays are allowed in the date range. Допустимые символы:
Допустима любая комбинация символов. |
| Promotions / HotelPromotions / Promotion / CheckoutDates | 0..1 | CheckoutDates | Для применения акции необходимо указать один или несколько диапазонов дат, определяющих момент оформления заказа. |
| Promotions / HotelPromotions / Promotion / CheckoutDates / DateRange | 1..20 | DateRange | Укажите диапазон дат, когда должна произойти оплата, чтобы акция была применена. Этот параметр не требуется, если вы удаляете одну или несколько акций. Поддерживается также формат YearlessDate .
|
| Promotions / HotelPromotions / Promotion / CheckoutDates / DateRange / @start | 0..1 | Date or YearlessDate | The starting date (based on the property's time zone), inclusive, of the date range. This date must be before, or the same as, the end date. If start isn't specified, the date range is effectively unlimited in terms of a start date. |
| Promotions / HotelPromotions / Promotion / CheckoutDates / DateRange / @end | 0..1 | Date or YearlessDate | The ending date (based on the property's time zone), inclusive, of the date range. This date must be the same as, or after, the start date. If end isn't specified, the date range is effectively unlimited in terms of an end date. |
| Promotions / HotelPromotions / Promotion / CheckoutDates / DateRange / @days_of_week | 0..1 | string | The days of the week that are allowed in the date range. If not specified, all days are allowed in the date range. Each character in the string specifies a day. For example, "MTWHF" specifies that weekdays are allowed in the date range. Допустимые символы:
Допустима любая комбинация символов. |
| Promotions / HotelPromotions / Promotion / Devices | 0..1 | Devices | Container for listing the user devices that are eligible for the promotion. If specified, only eligible users on the listed devices are offered the discounted rate. If not specified, eligible users on any device are offered the discounted rate. |
| Promotions / HotelPromotions / Promotion / Devices / Device | 1..3 | Device | Определяет один тип пользовательских устройств, которые могут участвовать в акции. |
| Promotions / HotelPromotions / Promotion / Devices / Device / @type | 1 | enum | Тип устройства. Значение должно быть desktop , tablet или mobile . |
| Promotions / HotelPromotions / Promotion / Discount | 1 | Discount | Необходимо указать ровно один из вариантов: Указывает размер скидки, которая будет применена в рамках данной акции. |
| Promotions / HotelPromotions / Promotion / Discount / @percentage | 0..1 | float | Требуется ровно один из следующих параметров: Десятичное значение от 0 до 100, указывающее процентную скидку. Она применяется к Примеры:
|
| Promotions / HotelPromotions / Promotion / Discount / @percentage_of_base | 0..1 | float | Требуется ровно один из следующих параметров: Десятичное значение от 0 до 100, указывающее процент базовой скидки. Аналогично В отличие от Пример:
|
| Promotions / HotelPromotions / Promotion / Discount / @fixed_amount | 0..1 | float | Требуется ровно один из следующих параметров: Фиксированная сумма, которая вычитается из суммы суточных тарифов Примеры:
|
| Promotions / HotelPromotions / Promotion / Discount / @fixed_amount_per_night | 0..1 | float | Требуется ровно один из следующих параметров: Фиксированная скидка применяется к каждому из тарифов Примеры:
|
| Promotions / HotelPromotions / Promotion / Discount / @fixed_price | 0..1 | float | Требуется указать ровно один из следующих параметров: Если указан параметр Если Примеры:
|
| Promotions / HotelPromotions / Promotion / Discount / @fixed_price_per_night | 0..1 | float | Требуется указать ровно один из следующих параметров: Если указан параметр Если Если указан параметр Примеры:
|
| Promotions / HotelPromotions / Promotion / Discount / @applied_nights | 0..1 | integer | Этот параметр следует использовать только с Количество ночей, на которые распространяется скидка, начиная с самой дешевой. Должно быть целым числом от 1 до 99. Если не указано, скидка применяется ко всем ночам. |
| Promotions / HotelPromotions / Promotion / Discount / FreeNights | 0..1 | FreeNights | Указывает скидку на определенные ночи проживания при достижении минимальной продолжительности пребывания. При использовании этого элемента атрибуты родительского элемента Discount не допускаются. |
| Promotions / HotelPromotions / Promotion / Discount / FreeNights / @stay_nights | 1 | integer | Количество ночей, необходимых для применения скидки. Каждая скидка применяется к отдельному сегменту ночей проживания. Например, при 10-дневном пребывании, когда |
| Promotions / HotelPromotions / Promotion / Discount / FreeNights / @discount_nights | 1 | integer | Количество ночей со скидкой в каждом сегменте проживания. |
| Promotions / HotelPromotions / Promotion / Discount / FreeNights / @discount_percentage | 1 | float | Скидка, применяемая к выбранным ночам. Если это значение равно 50 , то на каждую выбранную ночь предоставляется скидка 50%. |
| Promotions / HotelPromotions / Promotion / Discount / FreeNights / @night_selection | 1 | string | Должно быть либо cheapest , либо last . Если last , то скидка распространяется на ночи в конце отрезка проживания. Если cheapest , то скидка распространяется на самые дешевые ночи в пределах отрезка проживания. |
| Promotions / HotelPromotions / Promotion / Discount / FreeNights / @repeats | 1 | boolean | Указывается, может ли скидка применяться к нескольким сегментам проживания в течение нескольких ночей. Если Например, если |
| Promotions / HotelPromotions / Promotion / Discount / @rank | 0..1 | integer | Присваивает данной акции ранг и включает её в ранжированный список, где для применения выбирается только акция с самым низким рангом. Значения должны быть от 1 до 99 включительно. Если несколько акций имеют одинаковый ранг, то произвольно выбирается и применяется одна из них. |
| Promotions / HotelPromotions / Promotion / BestDailyDiscount | 1 | Discount | Необходимо указать ровно один из вариантов: Указывает на ежедневную скидку, которая может быть применена к одной ночи проживания. Это отличается от В каждом отеле может быть своя группа акций, которые считаются «лучшими предложениями дня». Это означает, что для каждой ночи проживания выбирается единственное подходящее «лучшее предложение дня», которое дает наибольшую скидку за эту ночь, и оно может быть применено. С помощью параметра |
| Promotions / HotelPromotions / Promotion / BestDailyDiscount / @percentage | 0..1 | float | Требуется указать ровно один из следующих параметров: Десятичное значение от 0 до 100, указывающее процентную скидку. Она применяется к Примеры:
|
| Promotions / HotelPromotions / Promotion/ BestDailyDiscount / @fixed_amount | 0..1 | float | Требуется указать ровно один из следующих параметров: Фиксированная сумма, вычитаемая из единой ночной ставки Примеры:
|
| Promotions / HotelPromotions / Promotion/ BestDailyDiscount / @fixed_price | 0..1 | float | Требуется указать ровно один из следующих параметров: Если указан параметр Примеры:
|
| Promotions / HotelPromotions / Promotion / InventoryCount | 0..1 | InventoryCount | Определяет ограничения на количество номеров, которые должны быть доступны для применения данной акции. Скидка применяется только к тем ночам, которые соответствуют этому ограничению. Не допускается использование скидки fixed_amount . Обратите внимание, что количество доступных номеров указывается либо с помощью OTA_HotelInvCountNotifRQ ( InvCount ), либо с помощью OTA_HotelAvailNotifRQ ( BookingLimit ). |
| Promotions / HotelPromotions / Promotion / InventoryCount / @min | 0..1 | integer | Минимальное количество номеров, которое должно быть доступно для применения акции к стоимости за ночь. Если это не указано, минимального количества нет. |
| Promotions / HotelPromotions / Promotion / InventoryCount / @max | 0..1 | integer | Максимальное количество номеров, которое должно быть доступно для применения акции к стоимости за ночь. Если это не указано, максимального количества нет. |
| Promotions / HotelPromotions / Promotion / LengthOfStay | 0..1 | LengthOfStay | Определяет ограничения по продолжительности пребывания, в рамках которых может применяться данная акция. Акция не применяется, если продолжительность пребывания выходит за пределы минимального и максимального лимитов. |
| Promotions / HotelPromotions / Promotion / LengthOfStay / @min | 0..1 | integer | Минимальное количество ночей, разрешенное для применения акции. Если это не указано, минимального количества ночей нет. |
| Promotions / HotelPromotions / Promotion / LengthOfStay / @max | 0..1 | integer | Максимальное количество ночей, разрешенное для применения акции. Если это не указано, максимального количества ночей нет. |
| Promotions / HotelPromotions / Promotion / MembershipRateRule | 0..1 | MembershipRateRule | Контейнер для правила расчета членского взноса, который запускает определенную обработку пользовательского интерфейса для соответствующей скидки. Этот элемент не следует указывать, если не указан также элемент |
| Promotions / HotelPromotions / Promotion / MembershipRateRule / @id | 1 | string | Идентификатор правила расчета тарифов, связанного с программой членства. |
| Promotions / HotelPromotions / Promotion / MinimumAmount | 0..1 | MinimumAmount | Указывает минимальную сумму суточных тарифов на проживание (используя большее из значений AmountBeforeTax или AmountAfterTax ), которую необходимо превысить для применения акции. |
| Promotions / HotelPromotions / Promotion / MinimumAmount / @before_discount | 1 | integer | Значение, которое необходимо превысить для применения акции. |
| Promotions / HotelPromotions / Promotion / Occupancy | 0..1 | Occupancy | Определяет ограничения на заполняемость, на которые распространяется данная акция. Акция не применяется, если заполняемость выходит за пределы минимального и максимального лимитов. Акционные предложения распространяются на стоимость поездки. Установить максимальную скидку на одного пассажира невозможно. |
| Promotions / HotelPromotions / Promotion / Occupancy / @min | 0..1 | integer | Для применения скидки указанная пользователем вместимость должна быть не ниже этого значения. |
| Promotions / HotelPromotions / Promotion / Occupancy / @max | 0..1 | integer | Для применения скидки указанное пользователем количество проживающих должно быть не более указанного значения. |
| Promotions / HotelPromotions / Promotion / RatePlans | 0..1 | RatePlans | Контейнер для списка тарифных планов, на которые распространяется акция. Если <RatePlans> не указан, акция распространяется на все тарифные планы. |
| Promotions / HotelPromotions / Promotion / RatePlans / RatePlan | 1..n | RatePlan | Указывает тарифный план. Тарифный план определяется комбинацией пакета услуг, тарифов и доступности, как это определено в сообщениях Transaction (Property Data), OTA_HotelRateAmountNotifRQ и OTA_HotelAvailNotifRQ, а также идентифицируется по PackageID. |
| Promotions / HotelPromotions / Promotion / RatePlans / RatePlan / @id | 1 | string | Уникальный идентификатор тарифного плана. Это значение сопоставляется со значением PackageID в <PackageData> в сообщении транзакции (данные объекта) и с атрибутом RatePlanCode в <StatusApplicationControl> в сообщениях <OTA_HotelRateAmountNotifRQ> и <OTA_HotelAvailNotifRQ> . Максимальное допустимое количество символов — 50. |
| Promotions / HotelPromotions / Promotion / RoomTypes | 0..1 | RoomTypes | Контейнер для списка типов номеров, на которые распространяется акция. Акция применяется к каждому указанному <RoomType> . Если <RoomTypes> не указан, акция применяется ко всем номерам. |
| Promotions / HotelPromotions / Promotion / RoomTypes / RoomType | 1..n | RoomType | Указывает тип номера. Тип номера определяется в элементе <RoomData> в сообщении транзакции (данные объекта недвижимости) и указывается с помощью значения <RoomID> . (Значение <RoomID> также указывается атрибутом InvTypeCode в сообщениях OTA_HotelRateAmountNotifRQ.) |
| Promotions / HotelPromotions / Promotion / RoomTypes / RoomType / @id | 1 | string | Уникальный идентификатор инвентаря (типа номера). Это значение сопоставляется с <RoomID> в сообщении транзакции (данные об объекте недвижимости). Максимально допустимое количество символов — 50. |
| Promotions / HotelPromotions / Promotion / Stacking | 0..1 | Stacking | Указывает, как можно комбинировать акции. Если не указано, "тип" считается base . |
| Promotions / HotelPromotions / Promotion / Stacking / @type | 1 | enum | В зависимости от этой настройки к одному тарифу может быть применено несколько акций:
Из допустимых комбинаций к цене применяется тот набор акций, который обеспечивает наибольшую скидку. |
| Promotions / HotelPromotions / Promotion / StayDates | 0..1 | StayDates | Контейнер для одного или нескольких диапазонов дат, определяющих порядок применения акции, например, для учета сезонных скидок. |
| Promotions / HotelPromotions / Promotion / StayDates / @application | 1 | enum | Описывает порядок применения данной акции. Допустимые значения:
Этот атрибут необходимо указывать всегда.
|
| Promotions / HotelPromotions / Promotion / StayDates / DateRange | 1..99 | DateRange | Диапазон дат, указывающий периоды, когда должна быть применена акция. Поддерживается также формат YearlessDate .
Если вы хотите установить диапазон |
| Promotions / HotelPromotions / Promotion / StayDates / DateRange / @start | 0..1 | Date or YearlessDate | Начальная дата (с учетом часового пояса объекта недвижимости), включая дату начала диапазона дат. Эта дата должна быть раньше или совпадать с end датой. Если start не указана, диапазон дат фактически неограничен с точки зрения начальной даты. Если |
| Promotions / HotelPromotions / Promotion / StayDates / DateRange / @end | 0..1 | Date or YearlessDate | Конечная дата (с учетом часового пояса объекта недвижимости), включая дату начала, указанную в диапазоне дат. Эта дата должна совпадать с start датой или быть позже нее. Если end не указана, диапазон дат фактически неограничен, начиная с start даты. Если |
| Promotions / HotelPromotions / Promotion / StayDates / DateRange / @days_of_week | 0..1 | string | The days of the week that are allowed in the date range. If not specified, all days are allowed in the date range. Each character in the string specifies a day. For example, "MTWHF" specifies that weekdays are allowed in the date range. Valid characters are:
Any character combination is valid. |
| Promotions / HotelPromotions / Promotion / UserCountries | 0..1 | UserCountries | Container for listing the user locations (countries) that are eligible for the promotion. If specified, only eligible users in the listed countries are offered the discounted rate. If not specified, eligible users in any country are offered the discounted rate. |
| Promotions / HotelPromotions / Promotion / UserCountries / @type | 0..1 | enum | The type of UserCountries specification. Valid values are If the UserCountries If the UserCountries If the UserCountries |
| Promotions / HotelPromotions / Promotion / UserCountries / Country | 1..300 | Country | Defines one country where users are eligible for the promotion. |
| Promotions / HotelPromotions / Promotion / UserCountries / Country / @code | 1 | string | A CLDR country code , such as DE or FR . Note that, for some countries, the CLDR country code isn't the same as the 2-letter ISO country code. Also, CLDR region codes are not supported. |
Примеры
There is a limit of 500 promotions per property. Refer to "Delete one promotion" example to remove promotions from a property.
Basic message
The following example shows a basic Promotions message:
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<BookingDates>
<DateRange start="2020-07-01" end="2020-07-31" days_of_week="MTWHF"/>
<DateRange start="2020-09-01" end="2020-09-30"/>
</BookingDates>
<BookingWindow min="7" max="330"/>
<CheckinDates>
<DateRange start="2020-10-01" end="2020-10-31" days_of_week="FSU"/>
</CheckinDates>
<CheckoutDates>
<DateRange start="2020-10-08" end="2020-11-07" days_of_week="FSU"/>
</CheckoutDates>
<Devices>
<Device type="mobile"/>
<Device type="tablet"/>
</Devices>
<Discount percentage="20" applied_nights="2"/>
<LengthOfStay min="2" max="14"/>
<RatePlans>
<RatePlan id="234"/>
<RatePlan id="567"/>
</RatePlans>
<RoomTypes>
<RoomType id="123"/>
<RoomType id="456"/>
</RoomTypes>
<Stacking type="base"/>
<UserCountries>
<Country code="US"/>
<Country code="GB"/>
</UserCountries>
</Promotion>
</HotelPromotions>
</Promotions>
Inventory condition
The following example shows how to create a discount if there is excess inventory close to the arrival date:
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<BookingWindow max="7"/>
<Discount percentage="10"/>
<InventoryCount min="3"/>
</Promotion>
</HotelPromotions>
</Promotions>
Delete one promotion
The following example shows how to delete one promotion for a property:
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1" action="delete"/>
</HotelPromotions>
</Promotions>
Delete all promotions
The following example shows how to delete all promotions for a property:
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1" action="overlay"/>
</Promotions>
Overlay all promotions
The following example shows how to overlay <HotelPromotions> for a property with one or more new promotions. When action="overlay" , all stored promotions are deleted prior to storing the promotions specified in the current message:
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1" action="overlay">
<Promotion id="1">
<BookingDates>
<DateRange start="2020-09-01" end="2020-09-30"/>
</BookingDates>
<Discount percentage="10"/>
<RoomTypes>
<RoomType id="123"/>
<RoomType id="456"/>
</RoomTypes>
<RatePlans>
<RatePlan id="234"/>
<RatePlan id="567"/>
</RatePlans>
<Stacking type="base"/>
</Promotion>
</HotelPromotions>
</Promotions>
3 Different Stacking Types
The following example shows a case where three different promotions would be applied ( base , second , any ). Note that the none promotion wouldn't be applied since the other promotions provide a better discount. If the original price was $100, the discounted price would be $72.90.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<Discount percentage="10"/>
<Stacking type="base"/>
</Promotion>
<Promotion id="2">
<Discount percentage="10"/>
<Stacking type="second"/>
</Promotion>
<Promotion id="3">
<Discount percentage="10"/>
<Stacking type="any"/>
</Promotion>
<Promotion id="4">
<Discount percentage="25"/>
<Stacking type="none"/>
</Promotion>
</HotelPromotions>
</Promotions>
None Stacking Type
The following example shows a case where the none promotion is used because the combination of other promotions provides a smaller discount. If the original price was $100, the discounted price would be $75.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<Discount percentage="10"/>
<Stacking type="base"/>
</Promotion>
<Promotion id="2">
<Discount percentage="10"/>
<Stacking type="any"/>
</Promotion>
<Promotion id="3">
<Discount percentage="25"/>
<Stacking type="none"/>
</Promotion>
</HotelPromotions>
</Promotions>
Booking Window Duration Bounds
The following example shows a case where the BookingWindow element is used with its start and end bounds defined as an ISO 8601 Duration type. This booking window restriction requires booking on or before 18:00 the day prior to arrival, and on or after 12:00 on the 2nd day before arrival.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<BookingWindow min="P1DT6H" max="P2DT12H"/>
<Discount percentage="20"/>
</Promotion>
</HotelPromotions>
</Promotions>
Booking Dates DateTime Bounds
The following example shows a case where the BookingDates element is used with start and end attributes as DateTime types. This booking date restriction requires booking to occur between 06:30 on 2020-07-01 and 18:45 on 2020-07-02.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<BookingDates>
<DateRange start="2020-07-01T06:30:00" end="2020-07-02T18:45:00"/>
</BookingDates>
<Discount percentage="20"/>
</Promotion>
</HotelPromotions>
</Promotions>
Yearless date ranges
The following example shows a case where the CheckInDates element contains DateRanges that have start and end fields without years. In this example, the promotion applies to check-in dates between 12/29 and 1/2, regardless of the year. Yearless date ranges that cross the new-year boundary are invalid, so the DateRange is expressed as two adjacent date ranges.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<CheckInDates>
<DateRange start="12-29" end="12-31"/>
<DateRange start="01-01" end="01-02"/>
</CheckInDates>
<Discount percentage="20"/>
</Promotion>
</HotelPromotions>
</Promotions>
FreeNights discount
The following example discounts two nights 50% for each four nights stayed for the specified range of booking dates. For a ten night itinerary, a total of four nights would be discounted 50%.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<BookingDates>
<DateRange start="2022-01-01" end="2022-05-31"/>
</BookingDates>
<Discount>
<FreeNights stay_nights="4" discount_nights="2" discount_percentage="50" night_selection="cheapest" repeats="true"/>
</Discount>
</Promotion>
</HotelPromotions>
</Promotions>
The next example discounts one night 50% for each three nights stayed for the specified ranges of stay dates. Only the overlapping nights of stay count towards qualifying for the discount. For the following itinerary with check-in on 2022-01-01 and check-out on 2022-01-07, the qualified nights of stay and discounts are applied as follows.
- 2022-01-01 (stay)
- 2022-01-02 (stay)
- 2022-01-03
- 2022-01-04 (discounted)
- 2022-01-05 (stay)
- 2022-01-06 (stay)
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<StayDates application="overlap">
<DateRange start="2022-01-01" end="2022-01-02"/>
<DateRange start="2022-01-04" end="2022-01-06"/>
</StayDates>
<Discount>
<FreeNights stay_nights="3" discount_nights="1" discount_percentage="50" night_selection="last" repeats="true"/>
</Discount>
</Promotion>
</HotelPromotions>
</Promotions>
Ranked Selection
The following example offers two discounts, one for 20% off and another for 15% off. During evaluation, only the 15% discount is applied because it has a lower rank.
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="Property_1">
<Promotion id="1">
<Discount percentage="15" rank="25"/>
</Promotion>
<Promotion id="2">
<Discount percentage="20" rank="50"/>
</Promotion>
</HotelPromotions>
</Promotions>
BestDailyDiscount
The following example discounts a two night stay by applying BestDailyDiscount stacked with a Discount .
<?xml version="1.0" encoding="UTF-8"?>
<Promotions partner="account_xyz"
id="123_abc"
timestamp="2020-05-18T16:20:00-04:00">
<HotelPromotions hotel_id="HotelID" action="overlay">
<Promotion id="general">
<BestDailyDiscount fixed_amount="20"/>
</Promotion>
<Promotion id="may">
<BestDailyDiscount fixed_amount="50"/>
<StayDates application="overlap">
<DateRange start="2023-05-01" end="2023-05-31"/>
</StayDates>
</Promotion>
<Promotion id="fiesta">
<Discount fixed_amount_per_night="5"/>
<Stacking type="any"/>
</Promotion>
</HotelPromotions>
</Promotions>
Consider a two night stay from April 30, 2023 to May 2, 2023 For calculation, the combination of best daily discounts that yields the deepest discount is found first.
For the first night, the "general" promotion is the only eligible amount with a fixed discount of 20.
For the second night, the "may" promotion offers a deeper discount than the "general" discount. So, when "may" is selected the fixed discount amount is 50.
Then for the stay, the "fiesta" promotion discounts to 5 per night, or 10 total. It can be stacked with the combination of best daily discounts because "fiesta" has stacking type set to any . If it were set to base , then only the combination of best daily discounts or the "fiesta" discount is applied. See description of Stacking for more information.
`Overall, the price of the stay receives a 20 + 50 + 10 = 80 fixed amount discount.
Ответы
Синтаксис
The PromotionsResponse message uses the following syntax:
<?xml version="1.0" encoding="UTF-8"?>
<PromotionsResponse timestamp="timestamp"
id="message_ID"
partner="partner_key">
<!-- Either Success or Issues are populated. -->
<Success/>
<Issues>
<Issue code="issue_code"
status="issue_type">
issue_description
</Issue>
</Issues>
</PromotionsResponse>
Elements and Attributes
The PromotionsResponse message has the following elements and attributes:
| Element / @Attribute | События | Тип | Описание |
|---|---|---|---|
| PromotionsResponse | 1 | Complex element | The root element indicating the success or issues for a received Promotions request message. |
| PromotionsResponse / @timestamp | 1 | DateTime | The creation date and time of this message. |
| PromotionsResponse / @id | 1 | string | The unique identifier from the associated Promotions message. |
| PromotionsResponse / @partner | 1 | string | The partner account for this message. |
| PromotionsResponse / Success | 0..1 | Success | Indicates that the Promotions message was processed successfully without warnings, errors, or failures. Either |
| PromotionsResponse / Issues | 0..1 | Issues | A container for one or more issues encountered while processing the Promotions message. Either |
| PromotionsResponse / Issues / Issue | 1..n | Issue | The description of a warning, error, or failure encountered while processing the Promotions message. Details on these issues can be found in Feed Status Error Messages . |
| PromotionsResponse / Issues / Issue / @code | 1 | integer | The identifier for the issue. |
| PromotionsResponse / Issues / Issue / @status | 1 | enum | The type of issue encountered. Valid values are |
Примеры
Успех
The following is a response to a successfully processed Promotions message.
<?xml version="1.0" encoding="UTF-8"?>
<PromotionsResponse timestamp="2020-05-18T16:20:00-04:00"
id="12345678"
partner="partner_key">
<Success/>
</PromotionsResponse>
Проблемы
The following is a response to a Promotions message not processed due to errors.
<?xml version="1.0" encoding="UTF-8"?>
<PromotionsResponse timestamp="2020-05-18T16:20:00-04:00"
id="12345678"
partner="partner_key">
<Issues>
<Issue code="1001" status="error">Example</Issue>
</Issues>
</PromotionsResponse>