[proxy] Lead rates & live price

Required configuration

Edit your domain and go to the tab "Proxy Settings" (domain settings - proxy settings)

  • tc_baseUrl

  • tc_chainCode

  • tc_oauth2_ihotelier_clientId

  • tc_oauth2_ihotelier_secret

Calendar rates

GalaxyHelpers include a method to call the proxy easily

Behind the hood, it will build the URL with the domain (galaxyInfo.proxy_url), set the header x-galaxy-key

window.GalaxyHelpers.proxy({
    method: 'GET',
    url: `/tc/shop/v1/hotel/${hotelId}/calendar`,
}).then((response) => {
   console.log(response);
});
  • this only works for iHotelier hotels

  • the hotelId is not the galaxy hotel ID, but the iHotelier ID (booking_engine_hotel_id)

By default, if you don't add additional parameters, it will return to you the values for the 90 next days, starting tomorrow.

Response format will be an array of objects

[
    {
        "date": "2022-08-20",
        "rate": "AUD 699",
        "rate_discounted": "AUD 699",
        "is_available": true,
        "booking_url": "URL_HERE"
    },
    {
        "date": "2022-08-21",
        "rate": "AUD 399",
        "rate_discounted": "AUD 399",
        "is_available": true,
        "booking_url": "URL_HERE"
    }
]

Additional params (daysAhead, datein, etc..)

If you want to specify more information, you can add query parameter, as they are indicated in the official proxy documentation.

The param dateIn is useful in case you want to show the rates for a date after the default 90 days.

You can add them to the URL as query parameters, or if you are using window.GalaxyHelpers.proxy, add searchParams

"dateIn" param
window.GalaxyHelpers.proxy({
    method: 'GET',
    url: `/tc/shop/v1/hotel/${hotelId}/calendar`,
    searchParams: {
      dateIn: '2023-01-01' // specific starting date
    }
}).then((response) => {
   console.log(response);
});

Here, we specified "dateIn" the param, so it will get the results starting this date

===================================

===================================

===================================

===================================

This section is still a work in progress, waiting for this ticket Proxy - Display price with same formatting as on iHotelier

+ checking behavior if no default currency is provided

Prices

module:

  • hotel

  • room

  • suite

{{item.iHotelierConfig}}

Lead Rate

Live price

Currency

The currency can be defined in 2 places:

  • In the proxy settings, you can define a default currency tc_default_currency

  • when doing the call, you can add a parameter currencyCode=EUR

Data caching

Each region (Europe, Asia, America) has its own caching for the response

Once fetched, for lead rates, the data is cached for 24 hours and for the live price 10 minutes

There are no buttons in the backoffice to clear the cache

Last updated