Skip to main content

Create Localities

Mutation Overviewโ€‹

The createLocalities mutation allows you to create new localities that a hotel can have assigned in Inventory. The returned fields include:

  • id
  • name
  • countryCode
  • unLocode

1. Criteriaโ€‹

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

Mandatory Inputโ€‹

  • countryCode
  • name

Optional Inputโ€‹

  • unLocode

2. Settingsโ€‹

To create a locality, ensure that all mandatory fields are properly filled out and provide accurate identifiers for the locality.

Response Considerationsโ€‹

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

LocalitiesRs (OBJECT)โ€‹

  • localities (InventoryLocality) - A collection of created localities.
    • id (Int) - Unique identifier for the locality.
    • name (String) - Name of the locality.
    • countryCode (String) - ISO 2-character country code.
    • unLocode (String) - UN/LOCODE for Trade and Transport Locations.
  • success (Boolean) - Indicates if the operation was successful.
  • adviseMessages (AdviseMessage) - Messages related to the operation.

Mutation Inputsโ€‹

InventoryLocalitiesCreateInput (INPUT_OBJECT)
Represents a request to create a locality.

nameย  *ย  (String)

Sets the name of the locality.

countryCodeย  *ย  (String)

Sets the country code, as ISO2, of the locality.

unLocode(String)

United Nations code for Trade and Transport Locations. It is not mandatory but it is recommended in order to identify the locality unequivocally.

Returned Fieldsโ€‹

LocalitiesRs (OBJECT)
Represents response data for localities.

adviseMessages(AdviseMessage)

Collection of advise messages.

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.

localities(InventoryLocality)

Collection of localities.

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.

successย  *ย  (Boolean)

Indicates whether the response was successful based on the absence of advise messages.

Examplesโ€‹

{
"data": {
"inventory": {
"createLocalities": {
"localities": [
{
"name": "Palma de Mallorca",
"countryCode": "ES",
"id": 31104,
"unLocode": "ES-PMI"
}
]
}
}
}
}