Skip to main content

Load Rate Availability

Mutation Overview

The loadAvailRates mutation allows you to load the availability of specific rates in Inventory. The returned fields include:

  • success
  • rates
    • rateCode
    • dateRange
      • start
      • end
    • rooms
    • restrictions
      • bookingLimit
      • minRelease
      • maxRelease
      • freeSales
      • lengthOfStay
        • fullStay
          • minimum
          • maximum
        • arrival
          • minimum
          • maximum
      • stopSales
        • closeMaster
        • closeOnArrival
        • closeOnDeparture
    • applicableWeekdays
      • all
      • monday
      • tuesday
      • wednesday
      • thursday
      • friday
      • saturday
      • sunday
  • adviseMessages
    • code
    • description
    • level
    • correlationID
    • external
      • code
      • message

1. Criteria

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

Mandatory Input

  • clientCode
  • supplierCode
  • hotelCode
  • rates
    • rateCode
    • rooms
    • restrictions
    • dateRange
      • start
      • end

2. Settings

This mutation allows loading availability for specific rates by defining relevant details such as clientCode, supplierCode, hotelCode, dateRange, and restrictions.

{
"input": {
"clientCode": "ABC123",
"supplierCode": "SUP001",
"hotelCode": "HTL567",
"rates": [
{
"rateCode": "RATE001",
"rooms": ["ROOM1", "ROOM2"],
"restrictions": {
"bookingLimit": 10,
"minRelease": 2,
"maxRelease": 30,
"freeSales": true,
"lengthOfStay": {
"fullStay": {
"minimum": 2,
"maximum": 7
},
"arrival": {
"minimum": 1,
"maximum": 5
}
},
"stopSales": {
"closeMaster": false,
"closeOnArrival": true,
"closeOnDeparture": false
}
},
"dateRange": {
"start": "2024-03-01",
"end": "2024-03-10"
}
}
]
}
}

Response Considerations

The mutation returns the processed rates along with success status and possible advise messages.

AvailRatesRs (OBJECT)

  • rates (RateAvailLoad) - List of rates with availability information.
    • rateCode (String) - The rate code for the rates.
    • dateRange (DateRangeProduct) - Date range applied.
      • start (DateTime) - Start date.
      • end (DateTime) - End date.
    • restrictions (RestrictionsLoad) - Restrictions applied to the rates.
      • bookingLimit, minRelease, maxRelease, freeSales, stopSales conditions.
  • success (Boolean) - Indicates whether the operation was successful.
  • adviseMessages (array of AdviseMessage) - Messages related to the operation.
    • code (ID) - AM code.
    • type (String) - Error type.
    • description (String) - Error description.
    • level (Enum of AdviseMessageLevel) - Importance level (ERROR, WARN, INFO).
    • external (ExternalMessage) - External message details.
    • correlationID (ID) - Identifier for debugging.

Error Handling

When the operation fails, the envelope returns success: false, data is null, and the reason is described in adviseMessages. Any message with level: ERROR marks the operation as unsuccessful and nothing is loaded.

The most relevant fields of each advise message are:

  • levelERROR blocks the operation; WARN/INFO are informational (e.g. an element skipped in a batch while the rest succeeded).
  • code – machine-readable error code. Common values are INPUT_VALIDATION_FAILED (a field is missing or malformed) and STATE_CONFLICT (the resulting state is not valid).
  • type – exposed in the schema for compatibility but currently not populated; rely on code for programmatic handling.
  • description – human-readable reason, prefixed with the affected identifier when applicable.
  • external – present only when the error originates in an external/source system, carrying its own code and message.
  • correlationID – identifier to share with support when investigating the error.
{
"success": false,
"data": null,
"adviseMessages": [
{
"code": "INPUT_VALIDATION_FAILED",
"description": "RATE001: rateCode not found for the specified hotel.",
"level": "ERROR",
"correlationID": "3f9c1a5e-0b7d-4e2a-9c1b-8a2f7d6e4c10"
}
]
}

Mutation Inputs

InventoryAvailRatesLoadInput (INPUT_OBJECT)
Load availability rates mutation input

clientCode  *  (String)
Client code.

supplierCode  *  (String)
Travelgate Supplier/Channel code.

rates  *  (RateAvailLoadInput)
Hotel rates input data.

rateCode (String)
Code associated with the rate.

rooms (String)
List of rooms associated with the rate.

restrictions (RestrictionsLoadInput)
Restrictions for the rate. See RestrictionsLoad.

bookingLimit (Int)
Booking limit associated with the product.

lengthOfStay (LengthOfStayInput)
Length of stay associated with the product. See LengthOfStay.

fullStay (FullStayInput)
Full stay associated with the product. See FullStay.

minimum (Int)
Minimum length of the full stay.

maximum (Int)
Maximum length of the full stay.

arrival (ArrivalInput)
Arrival associated with the product. See Arrival.

minimum (Int)
Minimum length of the arrival period.

maximum (Int)
Maximum length of the arrival period.

minRelease (Int)
Minimum release period associated with the product.

maxRelease (Int)
Maximum release period associated with the product.

stopSales (StopSalesInput)
Stop sales associated with the product. See StopSales.

closeMaster (Boolean)
Indicates whether to close the master.

closeOnArrival (Boolean)
Indicates whether to close on arrival. Null if not applicable.

closeOnDeparture (Boolean)
Indicates whether to close on departure. Null if not applicable.

freeSales (Boolean)
Indicates whether the product is available for free sales.

applicableWeekdays (ApplicableWeekdaysInput)
Weekdays when the rate is applicable. See ApplicableWeekdays.

all (Boolean)
Indicates whether the price or rate is applicable on all days.

monday (Boolean)
Indicates whether the price or rate is applicable on Mondays.

tuesday (Boolean)
Indicates whether the price or rate is applicable on Tuesdays.

wednesday (Boolean)
Indicates whether the price or rate is applicable on Wednesdays.

thursday (Boolean)
Indicates whether the price or rate is applicable on Thursdays.

friday (Boolean)
Indicates whether the price or rate is applicable on Fridays.

saturday (Boolean)
Indicates whether the price or rate is applicable on Saturdays.

sunday (Boolean)
Indicates whether the price or rate is applicable on Sundays.

dateRange (DateRangeProductInput)
Date range to apply

start  *  (DateTime)
Start date.

end  *  (DateTime)
End date.

hotelCode  *  (String)
Code associated with the hotel.

contextCode (String)
Context code.

Returned Fields

AvailRatesRs (OBJECT)
Represents the response data for rates availability operations.

rates (RateAvailLoad)
List of rates availabilities. See RateAvailLoad.

rateCode (String)
Code associated with the rate.

rooms (String)
List of rooms associated with the rate.

restrictions (RestrictionsLoad)
Restrictions for the rate. See RestrictionsLoad.

bookingLimit (Int)
Booking limit associated with the product.

lengthOfStay (LengthOfStay)
Length of stay associated with the product. See LengthOfStay.

fullStay (FullStay)
Full stay associated with the product. See FullStay.

minimum (Int)
Minimum length of the full stay.

maximum (Int)
Maximum length of the full stay.

arrival (InventoryArrivalType)
Arrival associated with the product. See Arrival.

minimum (Int)
Minimum length of the arrival period.

maximum (Int)
Maximum length of the arrival period.

minRelease (Int)
Minimum release period associated with the product.

maxRelease (Int)
Maximum release period associated with the product.

stopSales (StopSales)
Stop sales associated with the product. See StopSales.

closeMaster (Boolean)
Indicates whether to close the master.

closeOnArrival (Boolean)
Indicates whether to close on arrival. Null if not applicable.

closeOnDeparture (Boolean)
Indicates whether to close on departure. Null if not applicable.

freeSales (Boolean)
Indicates whether the product is available for free sales.

applicableWeekdays (ApplicableWeekdays)
Weekdays when the rate is applicable. See ApplicableWeekdays.

all (Boolean)
Indicates whether the price or rate is applicable on all days.

monday (Boolean)
Indicates whether the price or rate is applicable on Mondays.

tuesday (Boolean)
Indicates whether the price or rate is applicable on Tuesdays.

wednesday (Boolean)
Indicates whether the price or rate is applicable on Wednesdays.

thursday (Boolean)
Indicates whether the price or rate is applicable on Thursdays.

friday (Boolean)
Indicates whether the price or rate is applicable on Fridays.

saturday (Boolean)
Indicates whether the price or rate is applicable on Saturdays.

sunday (Boolean)
Indicates whether the price or rate is applicable on Sundays.

dateRange (DateRangeProduct)
Date range to apply

start  *  (DateTime)
Start date.

end  *  (DateTime)
End date.

adviseMessages (AdviseMessage)
List of advise messages associated with the operation. 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.

success  *  (Boolean)
Indicates whether the operation was successful.

Examples

Load availability for a specific rate

With this example, we are going to load the availability for a specific rate within a specific date range.