The hoteliga API

Guest

Guest is the object that represents a person who will also use a reserved room, additionally to the customer.

Resources
Resource Description
GET /v1/Guests Get the stored data for all guests
GET /v1/Guest/{id} Get the stored data for a guest
GET /v1/Guests/{reservationId} Get the stored data for all guests of a reservation
POST /v1/Guest Add a new Guest
PUT /v1/Guest Update selected data of a guest
DELETE /v1/Guest/{id} Delete a guest
Object properties
Name Type Description
id int Unique identifier of Guest
firstName string (100) Guest's first name
lastName string (100) Guest's last name
lastName2 string (100) Guest's second last name
dateOfBirth date (YYYY-MM-DD) Guest's date of birth
idDocIssueDate date (YYYY-MM-DD) Date that the guest's identification document was issued
idDocType string (50) Guest's identification document type identifier
1:Passport, 2:National ID, 3:Driving License, 4:National ID (other country), 5:Residence Permit, 6:Residence Permit (other country), 7:Foreigner ID, 8:Diplomatic Card
idDocNumber string (50) Guest's identification document number
IdDocIssueCountryId string (2) Guest's identification document issue country code accordind to ISO 3166-1 alpha-2
IdDocExpirationDate date (YYYY-MM-DD) Guest's identification document expiration date
nationalityCountryId string (2) Guest's nationality country code accordind to ISO 3166-1 alpha-2
provinceId int Unique identifier of guest's province
isPrimaryGuest int Flag that shows if the guest is the primary one for a reservation or not (1/0)
salutationId int Unique identifier of salutation message
1:Mr., 2:Mrs., 3:Ms., 4:Dr.(male), 5:Dr.(female)
reservationId int Unique identifier of reservation

GET /v1/Guests

Get the stored data for all Guests.

Request parameters

None

Response

The result is a list of Guest objects.

Example Response

<?xml version="1.0" ?>
<Guests>
<Guest>
    <Id>8</Id>
    <DateOfBirth>1990-06-03</DateOfBirth>
    <FirstName>Nicole</FirstName>
    <LastName>Kidman</LastName>
    <LastName2/>
    <IdDocType>1</IdDocType>
    <IdDocNumber>A12131</IdDocNumber>
    <IdDocIssueDate>2017-07-18</IdDocIssueDate>
    <IdDocExpirationDate>2026-01-12</IdDocExpirationDate>
    <IdDocIssueCountryId>GR</IdDocIssueCountryId>
    <NationalityCountryId>GR</NationalityCountryId>
    <ProvinceId>1599</ProvinceId>   
    <IsPrimaryGuest>1</IsPrimaryGuest>        
    <SalutationId>2</SalutationId>
</Guest>
...
</Guests>
[
    {
        "id":8, 
        "dateOfBirth":"1990-06-03",
        "firstName":"Nicole",     
        "lastName":"Kidman",  
        "lastName2":"",    
        "idDocType":1, 
        "idDocNumber":"A12131",
        "idDocIssueDate":"2017-07-18",
        "idDocExpirationDate": "2026-01-12",  
        "idDocIssueCountryId": "GR",
        "nationalityCountryId": "GR",
        "provinceId":1599,
        "isPrimaryGuest" : 1,
        "salutationId":2 
    },
    ...
]
        

GET /v1/Guest/{id}

Get the stored data for a guest.

Request parameters

Name Value
id The ID of the requested guest

Response

The result is a Guest object.

Example Response

<?xml version="1.0" ?>
<Guest>
    <Id>8</Id>
    <DateOfBirth>1990-06-03</DateOfBirth>
    <FirstName>Nicole</FirstName>
    <LastName>Kidman</LastName>
    <LastName2/>
    <IdDocType>1</IdDocType>
    <IdDocNumber>A12131</IdDocNumber>
    <IdDocIssueDate>2017-07-18</IdDocIssueDate>
    <IdDocExpirationDate>2026-01-12</IdDocExpirationDate>
    <IdDocIssueCountryId>GR</IdDocIssueCountryId>
    <NationalityCountryId>GR</NationalityCountryId>
    <ProvinceId>1599</ProvinceId>   
    <IsPrimaryGuest>1</IsPrimaryGuest>        
    <SalutationId>2</SalutationId>
</Guest>

{
    "id":8, 
    "dateOfBirth":"1990-06-03",
    "firstName":"Nicole",     
    "lastName":"Kidman",  
    "lastName2":"",    
    "idDocType":1, 
    "idDocNumber":"A12131",
    "idDocIssueDate":"2017-07-18",
    "idDocExpirationDate": "2026-01-12",  
    "idDocIssueCountryId": "GR",  
    "nationalityCountryId": "GR",
    "provinceId":1599,
    "isPrimaryGuest" : 1,
    "salutationId":2 
}
        

GET /v1/Guests/{reservationId}

Get the stored data for all guests of a reservation.

Request parameters

Name Value
reservationId Unique identifier of reservation.

Response

The result is a list of Guest objects.

Example Response

<?xml version="1.0" ?>
<Guests>
<Guest>
    <Id>8</Id>
    <DateOfBirth>1990-06-03</DateOfBirth>
    <FirstName>Nicole</FirstName>
    <LastName>Kidman</LastName>
    <LastName2/>
    <IdDocType>1</IdDocType>
    <IdDocNumber>A12131</IdDocNumber>
    <IdDocIssueDate>2017-07-18</IdDocIssueDate>
    <IdDocExpirationDate>2026-01-12</IdDocExpirationDate>
    <IdDocIssueCountryId>GR</IdDocIssueCountryId>
    <NationalityCountryId>GR</NationalityCountryId>
    <ProvinceId>1599</ProvinceId>   
    <IsPrimaryGuest>1</IsPrimaryGuest>
    <SalutationId>2</SalutationId>
</Guest>
...
<Guests>


[
    {
        "id":8, 
        "dateOfBirth":"1990-06-03",
        "firstName":"Nicole",     
        "lastName":"Kidman",  
        "lastName2":"",    
        "idDocType":1, 
        "idDocNumber":"A12131",
        "idDocIssueDate":"2017-07-18",  
        "idDocExpirationDate": "2026-01-12",  
        "idDocIssueCountryId": "GR",
        "nationalityCountryId": "GR",
        "provinceId":1599,
        "isPrimaryGuest" : 1,
        "salutationId":2 
    },...
]
        

POST /v1/Guest

Add a new Guest.

Request parameters

Name Value
FirstName Guest's first name.
LastName Guest's last name.

If reservation ID is sent in the request the new guest will be connected with the reservation, otherwise just a new guest will be added.

Response

The result is the ID of the newly created guest.

Example Request

<?xml version="1.0" ?>
<Guest>
    <DateOfBirth>1990-06-03</DateOfBirth>
    <FirstName>Nicole</FirstName>
    <LastName>Kidman</LastName>
    <LastName2/>
    <IdDocType>1</IdDocType>
    <IdDocNumber>A12131</IdDocNumber>
    <IdDocIssueDate>2017-07-18</IdDocIssueDate>
    <IdDocExpirationDate>2026-01-12</IdDocExpirationDate>
    <IdDocIssueCountryId>GR</IdDocIssueCountryId>
    <NationalityCountryId>GR</NationalityCountryId>
    <ProvinceId>1599</ProvinceId>   
    <IsPrimaryGuest>1</IsPrimaryGuest>        
    <SalutationId>2</SalutationId>
</Guest>
{
    "dateOfBirth":"1990-06-03",
    "firstName":"Nicole",     
    "lastName":"Kidman",  
    "lastName2":"",    
    "idDocType":1, 
    "idDocNumber":"A12131",
    "idDocIssueDate":"2017-07-18",  
    "idDocExpirationDate": "2026-01-12",  
    "idDocIssueCountryId": "GR",
    "nationalityCountryId": "GR",
    "provinceId":1599,
    "isPrimaryGuest" : 1,
    "salutationId":2 
}
        

Example Response

<?xml version="1.0" ?>
<Guest>
    <Id> 429 </Id>
</Guest>
{
    "id":429
}
        

PUT /v1/Guest

Update selected data of Guest.

Request parameters

Name Value
id Unique identifier of guest.

* The rest of Guest's object fields are optional.

Response

Result is the status code of the request.

Example Request

<?xml version="1.0"?>
<LastName>Tarantino</LastName>
{"LastName":"Tarantino"}
    

Example Response

<?xml version="1.0" ?>
<Guest>
    <DateOfBirth>1990-06-03</DateOfBirth>
    <FirstName>Nicole</FirstName>
    <LastName>Tarantino</LastName>
    <LastName2/>
    <IdDocType>1</IdDocType>
    <IdDocNumber>A12131</IdDocNumber>
    <IdDocIssueDate>2017-07-18</IdDocIssueDate>
    <IdDocExpirationDate>2026-01-12</IdDocExpirationDate>
    <IdDocIssueCountryId>GR</IdDocIssueCountryId>
    <NationalityCountryId>GR</NationalityCountryId>
    <ProvinceId>1599</ProvinceId>   
    <IsPrimaryGuest>1</IsPrimaryGuest>        
    <SalutationId>2</SalutationId>
</Guest>
{
    "dateOfBirth":"1990-06-03",
    "firstName":"Nicole",     
    "lastName":"Tarantino",  
    "lastName2":"",    
    "idDocType":1, 
    "idDocNumber":"A12131",
    "idDocIssueDate":"2017-07-18",  
    "idDocExpirationDate": "2026-01-12",  
    "idDocIssueCountryId": "GR",
    "nationalityCountryId": "GR",
    "provinceId":1599,
    "isPrimaryGuest" : 1,
    "salutationId":2 
}
        

DELETE /v1/Guest/{id}

Delete a Guest.

Request parameters

Name Value
id The ID of the requested guest

Response

Result is the status code of the request.