JSON API

Last updated: Mar 6th, 2018

Intro

Use our API to access, retrieve and manage information about hotels and their availability. Finalize a booking!

Requests

Onetourismo API consists of the following request types which are described in details in this current document

  • Availability
  • Room Availability
  • Specific Availability
  • Book
  • Cancel
  • Reservation Info

Availability

1. Description

Use this endpoint in order to retreive hotels' availability in a specific location

2. Endpoint

http://json.onetourismo.com/api/availability
                                        

3. Request Body

{
  
  *"username": String,
  *"password": String, 
  *"start_date": 'YYYY-MM-DD', 
  *"end_date": 'YYYY-MM-DD',
  "stars": {  //use this in order to filter results by their rating
    "min": Integer(0-5),
    "max": Integer(0-5) //of course it has to be greater than stars.min
  },
  *"rooms": ArrayOf({
    *"adults": Integer(1-8), //Number of adults in this room
    *"children": Integer(0-8), //Number of children in this room
    *"childrenAges": ArrayOf(Integer(1-13)), //Age of each children
    *"quantity": Integer(1-10) // Number of rooms of this type
  }),
  *"otagDestinationCode": String // Download our destination codes from the codes section in this current page
}
  
                                        

4. Response Body


{
  "status": Enum('success','failure'), 
  "results": ArrayOf(
    {
        "provider" : {   //which contract provides this hotel (you should use the provider.id value 
                      //in the next API calls as described below (room availability, specific availability,book))
            "name": String,
            "id" : String
        },
        "id" : String // id of hotel,
        "name" : String,
        "location" : {
            "country" : {
                "code":  String //isocode
                "name" : String
            },
            "city" : String,
            "region" : String,
            "address" : String,
            "latitude" : Float,
            "longitude" : Float
        },
        "distance" : Number, //distance from the searched location
        "photo" : String //url of hotel's thumbnail image,
        "description" : String,
        "rooms" : ArrayOf({
            "onRequest" : Boolean //wether the room is on-request or not,
            "index" : Number , //in which of the request's rooms , this room corresponds.¹,
            "code" : String, ²
            "type" : String, 
            "plan" : String, ²
            "mealPlans" : ArrayOf( //meal plans available for this room
                {
                    "code" : String, ²
                    "price" : Number
                    "description" : String
                }
            )
        })
    }
  )
}

                                        

1: For example if you searched for one room for two adults and one for three adults, index =0 means that this room is for two adults, and index=1 means that this room is a 3-adults one

2: These codes will be used in the next API calls in order to determine a specific room.

Room Availability

1. Description

Use this endpoint in order to retreive available rooms of specific hotel

2. Endpoint

http://json.onetourismo.com/api/rooms_availability
                                        

3. Request Body

{
  
  *"username": String,
  *"password": String, 
  *"start_date": 'YYYY-MM-DD', 
  *"end_date": 'YYYY-MM-DD',
  *"propertyID": String // hotel.id as retreived from the availability call
  *"providerContractID": String // provider.id as retreived from the availability call
  *"rooms": ArrayOf({
    *"adults": Integer(1-8), //Number of adults in this room
    *"children": Integer(0-8), //Number of children in this room
    *"childrenAges": ArrayOf(Integer(1-13)), //Age of each children
    *"quantity": Integer(1-10) // Number of rooms of this type
  }),
  *"propertyType": "HOTEL" 
}
  
                                        

4. Response Body


{
  "status": Enum('success','failure'), 
  "results": ArrayOf(
  {
        "onRequest" : Boolean //wether the room is on-request or not,
        "index" : Number , //in which of the request's rooms , this room corresponds.¹,
        "code" : String, ²
        "type" : String, 
        "id" : String, ²
        "mealPlans" : ArrayOf( //meal plans available for this room
            {
                "code" : String, ²
                "price" : Number
                "description" : String
            }
        )
    })
  )
}

                                        

1: For example if you searched for one room for two adults and one for three adults, index =0 means that this room is for two adults, and index=1 means that this room is a 3-adults one

2: These codes will be used in the next API calls in order to determine a specific room.

Specific Availability

1. Description

Use this endpoint in order to retreive availability of a specific rate (hotel,room,meal)

2. Endpoint

http://json.onetourismo.com/api/specific_availability
                                        

3. Request Body

{
  
  *"username": String,
  *"password": String, 
  *"start_date": 'YYYY-MM-DD', 
  *"end_date": 'YYYY-MM-DD',
  *"hotelID": String // hotel.id as retreived from the availability call
  *"providerContractID": String // provider.id as retreived from the availability call
  *"rooms": ArrayOf({
    "adults": Integer(1-8),
    "children": Integer(1-8), 
    "childrenAges": ArrayOf(Integer(1-13)),
    "id": String // as returned from room_availability at field room.id
    "mealPlan": String // as returned from room_availability at field room.mealPlan.code
    "code": String // as returned from room_availability at field room.code
    "quantity": Integer(1-10) // Number of rooms of this type
  }),
  *"propertyType": "HOTEL" 
}
  
                                        

4. Response Body


{
  "status": Enum('success','failure'), 
  "criticalComments": ArrayOf(String) // Remarks for returned rates
  "results": {
    "rooms" :ArrayOf(
       {
            "onRequest" : Boolean //wether the room is on-request or not,
            "index" : Number , //in which of the request's rooms , this room corresponds.¹,
            "code" : String, ²
            "type" : String, 
            "price": Number,
            "id" : String, ²
            "mealPlan" : 
            {
                "code" : String, ²
                "price" : Number
                "description" : String
            }
        }),
    "cancellationPolicies" ³ : ArrayOf({  //cancellation policies of returned rates
        "deadline" : Date ,    
        "amount": Number
    }),
    "merchantReference" ² : String //unique id for this "cart" 
  }
}

                                        

1: For example if you searched for one room for two adults and one for three adults, index =0 means that this room is for two adults, and index=1 means that this room is a 3-adults one

2: These codes will be used in the next API calls in order to determine a specific room.

3: Amount field represents the fee for cancelling the reservation before the Date in the "deadline" field. If no deadline field exists , it's the "No-Show" policy.

Book

1. Description

Use this endpoint in order to make a reservation

2. Endpoint

http://json.onetourismo.com/api/book
                                        

3. Request Body

{

*"username": String,
*"password": String, 
*"start_date": 'YYYY-MM-DD', 
*"end_date": 'YYYY-MM-DD',
*"MerchantReference": String //as returned from specific availability call,
*"hotelID": String // hotel.id as retreived from the availability call
*"providerContractID": String // provider.id as retreived from the availability call
*"rooms": ArrayOf({
    *"id": String // as returned from specific_availability at field room.id,
    *"mealPlan": String // as returned from specific_availability at field room.mealPlan.code,
    *"code": String // as returned from specific_availability at field room.code,
    *"specificAdults": ArrayOf({   //the adults that will stay in every room  
        *"first_name": String,
        *"last_name": String,
        *"index": Number ¹,
        *"title": Enum("Mr","Ms","Mrs")
    }),
    *"specificChildren": ArrayOf({  //the children that will stay in every room 
        *"first_name": String,
        *"last_name": String,
        *"age": Number,
        *"index": Number ¹,
        *"title": Enum("Mr","Ms","Mrs")
    })

}),
*"remarks": {
    "clientRemarks": String // any comment/remark for the reservation
},
"leadCustomer": {
    "address": String,
    "city": String,
    "country": {
      "code": String //isocode
      "name": Stirng 
    },
    "email": String,
    "firstName": String,
    "lastName": String,
    "postalCode": String,
    "telephone": String
},
  
  *"propertyType": "HOTEL" 
}
  
        

1: If there are more than one same type rooms (with same amount of adults , and children of same ages) , this field determines in which one of them the guest will stay. Indexes start from 1

4. Response Body



{
  "status": Enum('success','failure'), 
  "criticalComments": ArrayOf(String) // Remarks for returned rates
  "results": {
    "rooms" :ArrayOf(
       {
            "onRequest" : Boolean //wether the room is on-request or not,
            "index" : Number , //in which of the request's rooms , this room corresponds.¹,
            "code" : String, 
            "type" : String, 
            "price": Number,
            "id" : String, 
            "mealPlan" : 
            {
                "code" : String, 
                "price" : Number
                "description" : String
            }
        }),
    "cancellationPolicies" ³ : ArrayOf({  //cancellation policies of returned rates
        "deadline" : Date ,    
        "amount": Number
    }),
    "merchantReference" ² : String //unique id for this "cart" 
  }
}

                                        

1: For example if you searched for one room for two adults and one for three adults, index =0 means that this room is for two adults, and index=1 means that this room is a 3-adults one

2: These codes will be used in the next API calls in order to determine a specific room.

3: Amount field represents the fee for cancelling the reservation before the Date in the "deadline" field. If no deadline field exists , it's the "No-Show" policy.

Cancel

1. Description

Use this endpoint in order to cancel a reservation

2. Endpoint

http://json.onetourismo.com/api/cancel
                                        

3. Request Body

{

*"username": String,
*"password": String, 
*"merchantReference" : "String"

}
  
        

4. Response Body



{
  "status": Enum('success','failure')
}

                                        

Info

1. Description

Use this endpoint in order to retreive detailed info of a hotel

2. Endpoint

http://json.onetourismo.com/api/info
                                        

3. Request Body

{

*"username": String,
*"password": String, 
*"start_date": 'YYYY-MM-DD', 
*"end_date": 'YYYY-MM-DD',
*"MerchantReference": String //as returned from specific availability call,
*"propertyID": String // hotel.id as retreived from the availability call
*"providerContractID": String // provider.id as retreived from the availability call
}
  
        

4. Response Body



{
  "status": Enum('success','failure'), 
  "results": {
    "id" : String,
    "name": String,
    "description" : String,
    "rating" :{
        "value" : Number // the star/keys rating (0 = unrated hotels)
        "type" : Enum("stars","keys"),
        "text" : String // etc "4 stars","3 keys" , "Villa"(value=0) 
    },
    "services" : ArrayOf({
        "name": String,
        "category" : String //this field not always exists
    }),
    "photos" : ArrayOf({
        "url" : String
    })

  }
}

                                        

Codes

Supported Locations

Download our system's destinations required for availability call : destinations.csv .