createSingleDiscountPromotion mutation
Creates a single promotion. Its response, if successful, includes the promotion ID that can be used to update the promotion, if necessary.
When creating a same-day promotion, be aware of these limitations:
- You must specify SAME_DAY_PROMOTION for the
name
field. The name cannot be changed after creation. To change the name from or to SAME_DAY_PROMOTION, you must first deactivate the existing promotion (by setting thestatus
field to INACTIVE) and then recreate it using the desired name. memberOnlyAdditionalValue
field is not supported.sameDayBookingStartTime
field is mandatory.- Travel start and end dates (
travelDateFrom
andtravelDateTo
) cannot be more than 364 days apart, andbookingLocalDateTimeXXX
andtravelDateXXX
fields must be the same. minAdvanceBookingDays
andmaxAdvanceBookingDays
fields must be set to 0.
Syntax
1createSingleDiscountPromotion(
Examples
Basic promotion
This request creates a basic promotion that offers a 15% discount to travelers who book between 5 Jan 2021 and 20 Dec 2022, 3-9 days in advance of the stay dates, and for stay 1-2 days between 9 Sep 2021 to 20 Dec 2022. (Dates are inclusive.) The promotion is not valid for the blackout dates of 9-12 Apr and 22 Apr 2022.
- Request
- Response
1mutation {2 createSingleDiscountPromotion(3 propertyId: "1559",4 propertyIdSource: EXPEDIA,5 promotion: {6 name: BASIC_PROMOTION,7 status: ACTIVE,8 category: DISCOUNT_PROMOTION,9 code: "Some code",10 restrictions: {11 isMobileUserOnly: false,12 minLengthOfStay: 1,13 maxLengthOfStay: 2,14 minAdvanceBookingDays: 3,15 maxAdvanceBookingDays: 9,16 bookingLocalDateTimeFrom: "2021-01-05T12:00:00",17 bookingLocalDateTimeTo: "2022-12-20T23:59:00",18 travelDateFrom: "2021-09-09",19 travelDateTo: "2022-12-20"20 },21 eligibleRatePlans: [22 {23 id:"19965"24 }25 ],26 blackoutDates: [27 {28 travelDateFrom: "2022-04-09",29 travelDateTo: "2022-04-12"30 },31 {32 travelDateFrom: "2022-04-22",33 travelDateTo: "2022-04-22"34 }35 ],36 discount: {37 unit: PERCENT,38 value: 1539 }40 }41 )42 {43 __typename44 id45 name46 category47 status48 ... on DiscountPromotion {49 code50 restrictions {51 isMobileUserOnly52 minLengthOfStay53 maxLengthOfStay54 minAdvanceBookingDays55 maxAdvanceBookingDays56 bookingLocalDateTimeFrom57 bookingLocalDateTimeTo58 travelDateFrom59 travelDateTo60 sameDayBookingStartTime61 }62 eligibleRatePlans {63 id64 }65 blackoutDates {66 travelDateFrom67 travelDateTo68 }69 discount {70 __typename71 type72 unit73 ... on SingleDiscount {74 value75 }76 }77 }78 }79}
Basic promotion using variables
- Request
- Variables
- Response
1mutation CreateSingleDiscountPromotion($propertyId: String!, $propertyIdSource: IdSource!, $promotion: SingleDiscountPromotionCreateInput!) {2 createSingleDiscountPromotion(propertyId:$propertyId, propertyIdSource: $propertyIdSource, promotion: $promotion) {3 id4 name5 status6 category7 ... on DiscountPromotion {8 code9 restrictions {10 isMemberOnly11 isMobileUserOnly12 minLengthOfStay13 maxLengthOfStay14 minAdvanceBookingDays15 maxAdvanceBookingDays16 bookingLocalDateTimeFrom17 bookingLocalDateTimeTo18 travelDateFrom19 travelDateTo20 }21 eligibleRatePlans {22 id23 }24 discount {25 unit26 ... on SingleDiscount {27 value28 memberOnlyAdditionalValue29 }30 }31 }32 }33}
Early-booking promotion
This request creates an early-booking promotion that offers a 15% discount to mobile users who book between 5 Jan 2021 and 20 Dec 2022, 20-100 days in advance of the stay dates, and for stay 1-2 days between 9 Sep 2021 to 20 Dec 2022. (Dates are inclusive.) The promotion is not valid for the blackout dates of 9-12 Apr and 22 Apr 2022.
- Request
1mutation {2 createSingleDiscountPromotion(3 propertyId: "1559",4 propertyIdSource: EXPEDIA,5 promotion: {6 name: EARLY_BOOKING_PROMOTION,7 status: ACTIVE,8 category: DISCOUNT_PROMOTION,9 code: "Some code",10 restrictions: {11 isMobileUserOnly: true,12 minLengthOfStay: 1,13 maxLengthOfStay: 2,14 minAdvanceBookingDays: 20,15 maxAdvanceBookingDays: 100,16 bookingLocalDateTimeFrom: "2021-01-05T12:00:00",17 bookingLocalDateTimeTo: "2022-12-20T23:59:00",18 travelDateFrom: "2021-09-09",19 travelDateTo: "2022-12-20"20 },21 eligibleRatePlans: [22 {23 id:"19965"24 }25 ],26 blackoutDates: [27 {28 travelDateFrom: "2022-04-09",29 travelDateTo: "2022-04-12"30 },31 {32 travelDateFrom: "2022-04-22",33 travelDateTo: "2022-04-22"34 }35 ],36 discount: {37 unit: PERCENT,38 value: 1539 }40 }41 )42 {43 __typename44 id45 name46 category47 status48 ... on DiscountPromotion {49 code50 restrictions {51 isMobileUserOnly52 minLengthOfStay53 maxLengthOfStay54 minAdvanceBookingDays55 maxAdvanceBookingDays56 bookingLocalDateTimeFrom57 bookingLocalDateTimeTo58 travelDateFrom59 travelDateTo60 sameDayBookingStartTime61 }62 eligibleRatePlans {63 id64 }65 blackoutDates {66 travelDateFrom67 travelDateTo68 }69 discount {70 __typename71 type72 unit73 ... on SingleDiscount {74 value75 }76 }77 }78 }79}
Same-day promotion
This request creates a recurring same-day promotion offered to mobile users who book after 2PM on the same day as check-in. It offers a 15% discount for stay 1-5 days between 5 Jan and 20 Dec 2021. (Dates are inclusive.) The promotion is not valid for the blackout dates of 9-12 Apr and 22 Apr 2022.
Be sure to observe the limitations documented above. The API will respond with an error if these conditions are not met.
- Request
1mutation {2 createSingleDiscountPromotion(3 propertyId: "1559",4 propertyIdSource: EXPEDIA,5 promotion: {6 name: SAME_DAY_PROMOTION,7 status: ACTIVE,8 category: DISCOUNT_PROMOTION,9 code: "Some code",10 restrictions: {11 isMobileUserOnly: true,12 minLengthOfStay: 1,13 maxLengthOfStay: 5,14 minAdvanceBookingDays: 0,15 maxAdvanceBookingDays: 0,16 bookingLocalDateTimeFrom: "2021-01-05T12:00:00",17 bookingLocalDateTimeTo: "2022-12-20T23:59:00",18 travelDateFrom: "2021-01-05",19 travelDateTo: "2021-12-20",20 sameDayBookingStartTime: "14:00:00"21 },22 eligibleRatePlans: [23 {24 id:"19965"25 }26 ],27 blackoutDates: [28 {29 travelDateFrom: "2021-04-09",30 travelDateTo: "2021-04-12"31 },32 {33 travelDateFrom: "2021-04-22",34 travelDateTo: "2021-04-22"35 }36 ],37 discount: {38 unit: PERCENT,39 value: 1540 }41 }42 )43 {44 __typename45 id46 name47 category48 status49 ... on DiscountPromotion {50 code51 restrictions {52 isMobileUserOnly53 isMemberOnly54 minLengthOfStay55 maxLengthOfStay56 minAdvanceBookingDays57 maxAdvanceBookingDays58 bookingLocalDateTimeFrom59 bookingLocalDateTimeTo60 travelDateFrom61 travelDateTo62 sameDayBookingStartTime63 }64 eligibleRatePlans {65 id66 }67 blackoutDates {68 travelDateFrom69 travelDateTo70 }71 discount {72 __typename73 type74 unit75 ... on SingleDiscount {76 value77 }78 }79 }80 }81}
Arguments
Name | Description |
---|---|
| Required. Additional arguments to specify details for creating the promotion. Type: SingleDiscountPromotionCreateInput |
| Required. Property ID. If using an external ID (from your system, source is SUPPLIER), specify the ID in this format: system_ID/advertiser_ID/property_ID. If the source is EXPEDIA, this is the Expedia ID (EID). Type: String |
| Required. Source of the ID. Type: IdSource |
Types
Name | Type | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BlackoutDateRange | Object | |||||||||||||||||||||||||
BlackoutDateRangeInput | InputObject | |||||||||||||||||||||||||
Boolean | Boolean | |||||||||||||||||||||||||
The | ||||||||||||||||||||||||||
DayOfWeekDiscount | Object | |||||||||||||||||||||||||
Day-of-week discounts enable partners to set discount percentages for specific days of the week. The day fields specify the discount for that day of the week for the travel dates (such as Mondays at 15%, Tuesdays at 10% discount).
| ||||||||||||||||||||||||||
Discount | Interface | |||||||||||||||||||||||||
Implemented by
| ||||||||||||||||||||||||||
DiscountPromotion | Object | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
DiscountType | Enum | |||||||||||||||||||||||||
Discount type values.
| ||||||||||||||||||||||||||
DiscountUnit | Enum | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
EligibleRatePlan | Object | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
EligibleRatePlanInput | InputObject | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
Float | Float | |||||||||||||||||||||||||
The | ||||||||||||||||||||||||||
ID | ID | |||||||||||||||||||||||||
The | ||||||||||||||||||||||||||
IdSource | Enum | |||||||||||||||||||||||||
Source of a given ID.
| ||||||||||||||||||||||||||
Int | Int | |||||||||||||||||||||||||
The | ||||||||||||||||||||||||||
LocalDate | LocalDate | |||||||||||||||||||||||||
A type representing a date in ISO 8601 format: YYYY-MM-DD (such as 2007-12-03). | ||||||||||||||||||||||||||
LocalDateTime | LocalDateTime | |||||||||||||||||||||||||
A type representing a date and time (such as 2007-12-03T10:15:30). | ||||||||||||||||||||||||||
LocalTime | LocalTime | |||||||||||||||||||||||||
Scalar representing a time in this format: HH:mm:ss or HH:mm (such as 10:15:30 or 10:15). | ||||||||||||||||||||||||||
MultiNightDiscount | Object | |||||||||||||||||||||||||
Multi-night discounts offer percentage-based discounts for applicable nights (such as 15% off a third night).
| ||||||||||||||||||||||||||
Promotion | Interface | |||||||||||||||||||||||||
Implemented by
| ||||||||||||||||||||||||||
PromotionCategory | Enum | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
PromotionName | Enum | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
PromotionSellStatus | Enum | |||||||||||||||||||||||||
Values to indicate whether a promotion is currently bookable based on the its reservation date/time range.
| ||||||||||||||||||||||||||
PromotionStatus | Enum | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
Restrictions | Object | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
RestrictionsCreateInput | InputObject | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
SingleDiscount | Object | |||||||||||||||||||||||||
Discount that offers a percentage off a rate (such as 15% off).
| ||||||||||||||||||||||||||
SingleDiscountCreateInput | InputObject | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
SingleDiscountPromotionCreateInput | InputObject | |||||||||||||||||||||||||
| ||||||||||||||||||||||||||
String | String | |||||||||||||||||||||||||
The |