Skip to main content

Create Offers

Mutation Overview

The createOffersSetUp mutation allows you to create new offers for an existing hotel rate in Inventory. The returned fields include:

  • code
  • description
  • isActive
  • rateCode
  • roomCodes
  • mon
  • tue
  • wed
  • thu
  • fri
  • sat
  • sun
  • applyFrom
  • applyTo
  • numberOfNights
  • minLos
  • maxLos
  • nightsType

1. Criteria

When building your mutation, you need to provide the following input fields:

Mandatory Input

  • clientCode
  • supplierCode
  • hotelCode
  • rateCode
  • offers
    • code
    • description
    • isActive
    • nightsType
    • numberOfNights

Optional Input

  • contextCode
  • offers
    • roomCodes
    • mon
    • tue
    • wed
    • thu
    • fri
    • sat
    • sun
    • applyFrom
    • applyTo
    • minLos
    • maxLos

2. Settings

To create an offer, ensure that all mandatory fields are properly filled out and associate the offer with the correct hotel and rate.

Response Considerations

The mutation returns the created offer along with success status and possible advise messages.

OffersRs (OBJECT)

  • offers (OfferDto) - A collection of created offers.
    • code (String) - The offer code.
    • description (String) - Description of the offer.
    • isActive (Boolean) - Indicates if the offer is active.
    • rateCode (String) - The rate code associated with the offer.
    • nightsType (Enum of NightsType) - The type of nights the offer applies to.
    • numberOfNights (Int) - Number of nights the offer applies to.
    • applyFrom (DateTime) - Start date when the offer applies.
    • applyTo (DateTime) - End date when the offer applies.
    • minLos (Int) - Minimum length of stay required.
    • maxLos (Int) - Maximum length of stay allowed.
    • roomCodes (String) - The room codes associated with the offer.
    • mon (Boolean) - Applies on Monday.
    • tue (Boolean) - Applies on Tuesday.
    • wed (Boolean) - Applies on Wednesday.
    • thu (Boolean) - Applies on Thursday.
    • fri (Boolean) - Applies on Friday.
    • sat (Boolean) - Applies on Saturday.
    • sun (Boolean) - Applies on Sunday.
  • success (Boolean) - Indicates if the operation was successful.
  • adviseMessages (AdviseMessage) - Messages related to the operation.

Mutation Inputs

InventoryOffersSetupCreateInput (INPUT_OBJECT)
Offers setup create input.

clientCode  *  (String)
Client code.

supplierCode  *  (String)
Travelgate Supplier/Channel code.

offers  *  (InventoryOfferSetupInput)
Offers input data.

nightsType  *  (Enum of NightsType)
The type of the offer.
Possible values:
FIRST
LAST
CHEAPEST

code  *  (String)
The code of the offer.

description  *  (String)
The description of the offer.

mon (Boolean)
Indicates whether the offer applies on Monday.

tue (Boolean)
Indicates whether the offer applies on Tuesday.

wed (Boolean)
Indicates whether the offer applies on Wednesday.

thu (Boolean)
Indicates whether the offer applies on Thursday.

fri (Boolean)
Indicates whether the offer applies on Friday.

sat (Boolean)
Indicates whether the offer applies on Saturday.

sun (Boolean)
Indicates whether the offer applies on Sunday.

isActive  *  (Boolean)
Indicates whether the offer is active.

applyFrom (DateTime)
The start date when the offer applies.

applyTo (DateTime)
The end date when the offer applies.

numberOfNights  *  (Int)
The number of nights for the offer.

minLos (Int)
The minimum length of stay for the offer.

maxLos (Int)
The maximum length of stay for the offer.

roomCodes (String)
The room codes associated with the offer. Each code represents a specific room. Code

hotelCode  *  (String)
Code associated with the hotel.

contextCode (String)
Context code.

rateCode  *  (String)
Rate Code .

Returned Fields

OffersRs (OBJECT)
Represents a response object for offers.

adviseMessages (AdviseMessage)
Gets or sets the list of advise messages associated with the offers. See AdviseMessage.

code  *  (ID)
AM code: The following codes can be returned:

description  *  (String)
Error description

level  *  (Enum of AdviseMessageLevel)
Indicates the level of importance of the message. Possible values: ERROR, WARN, INFO.
Possible values:
WARN
ERROR
INFO

external (ExternalMessage)
Specify the external message.

code (String)
External code.

message  *  (String)
External message.

correlationID  *  (ID)
Identifier to investigate the cause of the error.

offers (OfferDto)
Gets or sets the list of offers. See OfferDto.

rateCode (String)
The rate code of the offer.

code (String)
The offer code.

isActive  *  (Boolean)
Indicates whether the offer is active.

description (String)
The description of the offer.

nightsType  *  (Enum of NightsType)
The type of the offer.
Possible values:
FIRST
LAST
CHEAPEST

maxLos (Int)
The maximum length of stay for the offer.

minLos (Int)
The minimum length of stay for the offer.

applyFrom (DateTime)
The start date when the offer applies.

applyTo (DateTime)
The end date when the offer applies.

numberOfNights (Int)
The number of free nights for the offer.

roomCodes (String)
The room codes associated with the offer.

mon (Boolean)
Indicates whether the offer applies on Monday.

tue (Boolean)
Indicates whether the offer applies on Tuesday.

wed (Boolean)
Indicates whether the offer applies on Wednesday.

thu (Boolean)
Indicates whether the offer applies on Thursday.

fri (Boolean)
Indicates whether the offer applies on Friday.

sat (Boolean)
Indicates whether the offer applies on Saturday.

sun (Boolean)
Indicates whether the offer applies on Sunday.

success  *  (Boolean)
Gets a value indicating whether the operation was successful.

Examples

Create a new offer for a rate

With the following mutation, we are going to create a new offer available for all rooms linked to a rate that gives away the cheapest night of the booking if the lenght of stay of the reservation is at least a week.