Statistics Aggregated by Time

Base Url

https://ba-dev.seekda.com/hotels/:hotel_id/reservation_summaries/per_day.json

Parameters

ParameterMandatoryDescriptionExample
hotel_idhotel code (part of the URL)
startDatethe start date for the interval returned, defaults to 2 years ago from current date
endDatethe start date for the interval returned, defaults to current date
keythe date which is used as key and filter for start or end date, defaults to timestamp of booking, allowed: dayOfArrival, dayOfDeparture
keyFormatthe format for the aggregated key (intended for easier debugging), defaults to milliseconds since 1970, allowed: date (date object)
basethe time interval to be aggregated, defaults to aggregation per day, allowed: w (per week), m (per month), q (per quarter), y (per year), t (total, only one value for the complete period request, note that in this case the timestamp returned is meaningless)
channelsA comma separated list of channel(prefixes) for which separate values are calculated, a reservation matches if <channelId>_<subChannelId> start with a string in the list. This parameter is case insensitive and special characters are removed. If the parameter is not present the result contains only one value in each array (e.g. amounts:[11037]). If e.g. channels=bookingcom,ibe results is given the array will be extended (e.g. amount:[11037, 10000, 20]) The first value is always the total.

Result

if channels parameter is given, each array will be extended with information for each requested channel e.g. when channels=ibe,hotelde are requested this would result in 3 values instead of only one as in the example below. amounts: [11037, 10000, 20] would mean 11037 total of which 10000 from ibe and 20 from hotelde

{
  success: true,
  result: [
    {
      _id: 1298934000000,       //timestamp (milliseconds from 1970)
      value: { 
        amounts: [11037.36],    //total amount of all bookings
        counts: [13],           //number of bookings
        rooms: [14],            //total number of rooms
        roomNights: [35],       //total number of nights
        adults: [26],           //number of adults
        children: [1]           //number of children
      },
    },
    {
      [...]
    }
  ]
},