Skip to main content

Update Hotel Master

Mutation Overview​

The updateHotelMaster mutation allows you to update an existing hotel master in Inventory. The returned fields include:

  • id
  • name
  • email
  • phones
  • fax
  • address
  • postalCode
  • latitude
  • longitude
  • externalCode
  • category
    • id
    • name
  • locality
    • id
    • name
    • countryCode
  • hotelCode
  • contextCode

1. Criteria​

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

Mandatory Input​

  • hotelCode

Optional Input​

  • contextCode
  • name
  • email
  • phones
  • fax
  • address
  • postalCode
  • latitude
  • longitude
  • externalCode
  • categoryId
  • localityId
  • maxAgeBaby
  • maxAgeChild

2. Settings​

To build your updateHotelMaster input, identify the hotel to modify through its hotelCode and provide only the fields you want to update. Any field left out will keep its current value.

If the hotel belongs to a specific supplier that requires native hotel codes, the field contextCode must be provided together with the hotelCode. Otherwise the default value "TGX_PUSH" will be used.

note

The localityId value from the desired locality can be retrieved using the queries Localities or Search Localities.
The possible values for contextCode can be retrieved using the query Inventory Contexts.

{
"input":{
"hotel":{
"hotelCode": "1",
"contextCode": "TGX_PUSH",
"name": "hotel test updated",
"email": "hotelpush@xmltravelgate.com",
"phones": ["971858585"],
"address": "Calle Prueba TEST 2",
"postalCode": "07121",
"latitude": 50.07,
"longitude": 14.14,
"localityId": 1042
}
}
}

Response Considerations​

The mutation returns the updated hotel object along with success status and possible advise messages.

HotelsRs (OBJECT)​

  • hotels (InventoryHotelMaster) - A collection of updated hotels.
    • id (Int) - Unique identifier.
    • name (String) - Hotel name.
    • email (String) - Contact email.
    • phones ([String]) - Phone numbers.
    • fax (String) - Fax number.
    • address (String) - Physical address.
    • postalCode (String) - Postal code.
    • latitude (Decimal) - Geographic latitude.
    • longitude (Decimal) - Geographic longitude.
    • category (InventoryCategory)
      • id (Int) - Category ID.
      • name (String) - Category name.
    • locality (InventoryLocality)
      • id (Int) - Locality ID.
      • name (String) - Locality name.
      • countryCode (String) - ISO country code.
    • hotelCode (String) - Supplier's hotel code.
    • contextCode (String) - Context code associated.
  • success (Boolean) - Indicates if the operation was successful.
  • adviseMessages (AdviseMessage) - Messages related to the operation.

Mutation Inputs​

InventoryHotelMasterUpdateInput (INPUT_OBJECT)
Hotel master update mutation input.

hotelΒ  *Β  (InventoryUpdateHotelMasterInput)

Hotel input data.

hotelCodeΒ  *Β  (String)

Code of the hotel.

contextCode(String)

Sets the context code associated with the hotel. If null, TGX_PUSH will be used.

name(String)

Name of the hotel.

email(String)

Email of the hotel.

phones([String])

List of phone numbers of the hotel.

fax(String)

Fax number of the hotel.

address(String)

Address of the hotel.

postalCode(String)

Postal code of the hotel.

latitude(Decimal)

Latitude of the hotel location.

longitude(Decimal)

Longitude of the hotel location.

externalCode(String)

External code associated with the hotel.

categoryId(Int)

ID of the category associated with the hotel.

localityId(Int)

ID of the locality associated with the hotel.

maxAgeBaby(Int)

MaxInfantAge

maxAgeChild(Int)

MaxChildrenAge

Returned Fields​

HotelsRs (OBJECT)
The HotelsRs class represents the response object for hotel-related operations.

adviseMessages(AdviseMessage)

A collection of advise messages related to the operation. See AdviseMessage.

codeΒ  *Β  (ID)

AM code: The following codes can be returned:

descriptionΒ  *Β  (String)

Error description

levelΒ  *Β  (AdviseMessageLevel)

Indicates the level of importance of the message. Possible values: ERROR, WARN, INFO. Possible values:

  • WARN: Warning message.
  • ERROR: Error message.
  • INFO: Info message.
external(ExternalMessage)

Specify the external message.

code(String)

External code.

messageΒ  *Β  (String)

External message.

correlationIDΒ  *Β  (ID)

Identifier to investigate the cause of the error.

hotels(InventoryHotelMaster)

A collection of hotels. See Hotel.

idΒ  *Β  (Int)

The unique identifier of the hotel.

name(String)

The name of the hotel.

email(String)

The email address of the hotel.

phones(String)

The list of phone numbers of the hotel.

fax(String)

The fax number of the hotel.

address(String)

The physical address of the hotel.

postalCode(String)

The postal code of the hotel's location.

latitude(Decimal)

The latitude of the hotel's location.

longitude(Decimal)

The longitude of the hotel's location.

externalCode(String)

The external code of the hotel.

category(InventoryCategory)

The category of the hotel.

idΒ  *Β  (Int)

Category Id.

name(String)

Category Name.

locality(InventoryLocality)

The locality of the hotel.

idΒ  *Β  (Int)

Unique identifier for the locality.

name(String)

Name of the locality.

countryCode(String)

ISO 2-character country code associated with the locality.

unLocode(String)

UN/LOCODE associated with the locality.

hotelCode(String)

The code of the hotel.

contextCode(String)

The context code of the hotel.

successΒ  *Β  (Boolean)

Indicates whether the operation was successful.

Examples​

{
"data": {
"inventory": {
"hotelsMaster": {
"hotels": [
{
"id": 1,
"name": "hotel test updated",
"hotelCode": "1",
"contextCode": "TGX_PUSH",
"email": "hotelpush@xmltravelgate.com",
"phones": [
"971858585"
],
"fax": null,
"address": "Calle Prueba TEST 2",
"postalCode": "07121",
"latitude": 50.07,
"longitude": 14.14,
"category": {
"id": 1,
"name": "1*"
},
"locality": {
"id": 1042,
"name": "Andorra la Vella",
"countryCode": "AD"
}
}
]
}
}
}
}