Skip to main content

Create Hotel Master

Mutation Overview

The createHotelMaster mutation allows you to create a new 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:

Mandatory Input

  • name
  • email
  • phones
  • postalCode
  • latitude
  • longitude
  • localityId

Optional Input

  • fax
  • address
  • externalCode
  • category
  • hotelCode
  • contextCode
  • unLocode

2. Settings

To build your createHotelMaster input, you need to fill in the hotel's basic information (name, contact details, location, etc.).

If this new hotel is for a specific supplier that requires native hotel codes, the fields hotelCode and contextCode must be provided.

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":{
"name": "hotel test",
"email":"hotelpush@xmltravelgate.com",
"phones": ["971858585"],
"postalCode":"07121",
"latitude": 50.07,
"longitude": 14.14,
"localityId": 1042,
"address":"Calle Prueba TEST"
}
}

Response Considerations

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

HotelsRs (OBJECT)

  • hotels (InventoryHotelMaster) - A collection of created 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

InventoryHotelMasterCreateInput (INPUT_OBJECT)
Represents input data for creating a hotel.

name  *  (String)
Sets the name of the hotel.

email  *  (String)
Sets the email address of the hotel.

phones  *  (String)
Sets the list of phone numbers associated with the hotel.

fax (String)
Sets the fax number of the hotel.

address  *  (String)
Sets the address of the hotel.

postalCode  *  (String)
Sets the postal code of the hotel.

latitude  *  (Decimal)
Sets the latitude of the hotel's location.

longitude  *  (Decimal)
Sets the longitude of the hotel's location.

categoryId (Int)
Sets the category ID of the hotel.

localityId  *  (Int)
Sets the locality ID of the hotel.

hotelCode (String)
Sets the native hotel code from the supplier in case it is necessary.

contextCode (String)
Sets the context code associated with the hotel. Required if hotel code filled, otherwise default value will be TGX_PUSH

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  *  (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.

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",
"hotelCode": "1",
"contextCode": "TGX_PUSH",
"email": "hotelpush@xmltravelgate.com",
"phones": [
"971858585"
],
"fax": null,
"address": "Calle Prueba TEST",
"postalCode": "07121",
"latitude": 50.07,
"longitude": 14.4
"category": {
"id": 1,
"name": "1*"
},
"locality": {
"id": 1042,
"name": "Andorra la Vella",
"countryCode": "AD"
"unLocode": null
}
}
]
}
}
}
}