Accounting

Last updated: Mar 6th, 2018

Intro

In order to connect your Onetourismo account with an accounting system we provide you an endpoint which returns the new -or newly updated- reservations.

So, the accounting system should be able to make an HTTP call to the endpoint given below, get the reservations and update it's own database.

Either you or your accounting company do not hesitate to contact us for any issue.

API Call

1. Credentials

In order to get access to our accounting endpoint, we are going to provide you the following credentials:

      Username
      Password
      USER_ID


You will need to use basic access authentication with the given username and password in order to make HTTP calls to our endpoint.

2. Endpoint

https://accounting.onetourismo.com/bookings/{{USER_ID}}/{{FROM_DATE}}/{{TO_DATE}}
                                        

As you can easily figure out, you have to include your user id in the request endpoint, and replace the FROM_DATE and TO_DATE variables with the actual dates between which you need to get updates.

3. Response

First of all our API is able to respond both in XML and JSON format. To select the response format you have to use the Accept header with the proper values (application/xml or application/json)

JSON


[
    {
        "id": String, //id of the reservation
        "provider": {
            "id": , String // provider's id 
            "code": String //reservation's id given by the provider
        },
        "status": String // reservation status. Might be either "CANCELED" or "CONFIRMED",
        "leadCustomer": {
            "firstName": String //First name of the main customer,
            "lastName": String //Last name of the main customer
        },
        "guests": {
            "pax": Number //number of total paxes
            "adults": [
                {
                    "firstName": String ,
                    "lastName": String 
                },
                {
                    "firstName": String ,
                    "lastName": String 
                }
            ],
            "children": []
        },
        "reservationDate": String  // YYYY-MM-DD Format,
        "priceAnalysis": {
            "sell": Number,
            "net": Number,
            "profit": Number //difference between sell and net price
        },
        "meta": {
            "id": String // an Onetourismo's internal id. please use these id in any mail mentioning an issue about a reservation
        },
        "hotel": {
            "name": String ,
            "country": {
                "code": String //ISO2 Code,
                "name": String
            }
        },
        "checkin": String  // YYYY-MM-DD Format,
        "checkout": String  // YYYY-MM-DD Format,
        "description": String // Short description - example:"1 room for 1 night at Hilton Athens Hotel",
        "buyer": {
            "id": Number // Unique id of the buyer
        },
        "cancellation": { // IF THE BOOKING IS CANCELED
            "amount": Number //penalty ammount,
            "date": String  // YYYY-MM-DD FormatString  // YYYY-MM-DD Format
        },
        "contractType": String // Possible values B2B or B2C
    }
]
  
                                        

XML