liteapi-travel
Advanced tools
Comparing version 2.0.0 to 2.0.1-alpha
{ | ||
"name": "liteapi-travel", | ||
"version": "2.0.0", | ||
"description": "The **Lite API** can be used to to do the following Get room rates & availability for a set of hotels Select a specific hotel with room availability and make a booking Manage the bookings - retrieve and cancel existing bookings Get static content for hotels, search hotels by destination", | ||
"version": "2.0.1-alpha", | ||
"description": "The **liteAPI** can be used to to do the following Get room rates & availability for a set of hotels Select a specific hotel with room availability and make a booking Manage the bookings - retrieve and cancel existing bookings Get static content for hotels, search hotels by destination", | ||
"license": "Unlicense", | ||
"main": "dist/index.js", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"build": "babel src -d dist", | ||
"prepare": "npm run build", | ||
"test": "mocha --require @babel/register --recursive" | ||
@@ -20,35 +18,10 @@ }, | ||
"keywords": [ | ||
"liteapi" | ||
], | ||
"dependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"superagent": "^5.3.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-decorators": "^7.0.0", | ||
"@babel/plugin-proposal-do-expressions": "^7.0.0", | ||
"@babel/plugin-proposal-export-default-from": "^7.0.0", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0", | ||
"@babel/plugin-proposal-function-bind": "^7.0.0", | ||
"@babel/plugin-proposal-function-sent": "^7.0.0", | ||
"@babel/plugin-proposal-json-strings": "^7.0.0", | ||
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", | ||
"@babel/plugin-proposal-numeric-separator": "^7.0.0", | ||
"@babel/plugin-proposal-optional-chaining": "^7.0.0", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.0.0", | ||
"@babel/plugin-proposal-throw-expressions": "^7.0.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.0.0", | ||
"@babel/plugin-syntax-import-meta": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"expect.js": "^0.3.1", | ||
"mocha": "^8.0.1", | ||
"sinon": "^7.2.0" | ||
}, | ||
"files": [ | ||
"dist" | ||
"liteapi", | ||
"travel", | ||
"hotels", | ||
"api", | ||
"sdk", | ||
"booking", | ||
"vacation" | ||
] | ||
} |
741
README.md
@@ -1,169 +0,690 @@ | ||
# liteapi-travel | ||
<h1 style="font-weight: 500;">liteAPI SDK</h1> | ||
LiteApi - JavaScript client for liteapi-travel | ||
The **Lite API** can be used to to do the following | ||
# Table of Contents | ||
- [Table of Contents](#table-of-contents) | ||
- [Introduction](#introduction) | ||
- [Installing](#installing) | ||
- [Usage](#usage) | ||
- [Static data](#static-data) | ||
- [List of cities](#list-of-cities) | ||
- [List of Countries](#list-of-countries) | ||
- [List of available currencies](#list-of-available-currencies) | ||
- [List of hotels](#list-of-hotels) | ||
- [Hotel details](#hotel-details) | ||
- [IATA code list](#iata-code-list) | ||
- [Booking flow](#booking-flow) | ||
- [Search](#search) | ||
- [Minimum Rates availability](#minimum-rates-availability) | ||
- [Hotel full rates availability](#hotel-full-rates-availability) | ||
- [Book](#book) | ||
- [Hotel rate prebook](#hotel-rate-prebook) | ||
- [Hotel rate book](#hotel-rate-book) | ||
- [Booking management](#booking-management) | ||
- [Booking list](#booking-list) | ||
- [Booking retrieve](#booking-retrieve) | ||
- [Booking cancel](#booking-cancel) | ||
- [Guest and loyalty](#guest-and-loyalty) | ||
- [Guests](#guests) | ||
Get room rates & availability for a set of hotels | ||
Select a specific hotel with room availability and make a booking | ||
Manage the bookings - retrieve and cancel existing bookings | ||
Get static content for hotels, search hotels by destination | ||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: | ||
# Introduction | ||
[liteAPI](https://www.liteapi.travel/) The fastest way to build travel apps | ||
Launch your hospitality product in minutes. Effortlessly monetize by selling accommodations at over 2 million properties worldwide. | ||
- API version: 2.0.0 | ||
- Package version: 2.0.0 | ||
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen | ||
## Installation | ||
The liteAPI can be used to to do the following: | ||
- Get room rates & availability for a set of hotels. | ||
- Select a specific hotel with room availability and make a booking | ||
- Manage the bookings | ||
- retrieve and cancel existing bookings. | ||
- Get static content for hotels. | ||
- Search hotels by destination. | ||
### For [Node.js](https://nodejs.org/) | ||
Don't have an account yet? Sign Up [Here](https://dashboard.liteapi.travel/register/). | ||
#### npm | ||
To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). | ||
# Installing | ||
Then install it via: | ||
Install the package with: | ||
```shell | ||
npm install liteapi-travel --save | ||
```sh | ||
npm install liteapi-travel | ||
# or | ||
yarn add liteapi-travel | ||
``` | ||
Finally, you need to build the module: | ||
# Usage | ||
The package needs to be configured with your account's apikey, which is | ||
available in the [liteAPI Dashboard](https://dashboard.liteapi.travel/apikeys/). Require it with the key's | ||
value: | ||
```shell | ||
npm run build | ||
```js | ||
const sdk = require('lite-api-sdk')(YOUR_API_KEY); | ||
``` | ||
##### Local development | ||
# Static data | ||
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: | ||
## List of cities | ||
```shell | ||
npm install | ||
The API returns a list of city names from a specific country. The country codes needs be is in ISO-2 format. To get the country codes in ISO-2 for all countries please use the GET Country list endpoint | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const countryCode = "IT"; | ||
const result = await liteApi.getCitiesByCountryCode(countryCode); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: | ||
```shell | ||
npm link | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**countryCode** | **string**| Country code in iso-2 format (example: US) | [required] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array of city objects containing the following properties: | ||
Field | Type | Description | ||
------|------|------------ | ||
**city** | **string** | The name of the city. | ||
<br> | ||
## List of Countries | ||
The API returns the list of countries available along with its ISO-2 code. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const result = await liteApi.getCountries(); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
To use the link you just defined in your project, switch to the directory you want to use your liteapi-travel from, and run: | ||
This endpoint does not need any parameter. | ||
```shell | ||
npm link /path/to/<JAVASCRIPT_CLIENT_DIR> | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array of country objects containing the following properties: | ||
Field | Type | Description | ||
------|------|------------ | ||
**code** | **string** | The country code in iso-2 format. | ||
**name** | **string** | The name of the country. | ||
<br> | ||
## List of available currencies | ||
The API returns all available currency codes along with its name and the list of supported countries that the currency applies to. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const result = await liteApi.getCurrencies(); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Finally, you need to build the module: | ||
This endpoint does not need any parameter. | ||
```shell | ||
npm run build | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array of currency objects containing the following properties: | ||
| Name | Type | Description | | ||
| -------- | ----- | ----------------------------------------------------------- | | ||
| **code** | **string** | The currency code. | | ||
| **currency** | **string** | The name of the currency. | | ||
| **countries** | **Array** | An array of countries where the currency is used. | | ||
<br> | ||
## List of hotels | ||
The API returns a list of hotels available based on different search criterion. The minimum required information is the county code in ISO-2 format. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const countryCode = "IT"; | ||
const cityName = "Rome"; | ||
//Optional values | ||
const offset = 1000; | ||
const limit = 1000; | ||
const longitude = "-115.16988"; | ||
const latitude = "36.12510"; | ||
const distance = 1000; | ||
const result = await liteApi.getHotels(countryCode, cityName); | ||
``` | ||
#### git | ||
To utilize optional values, you can invoke the function as follows: | ||
If the library is hosted at a git repository, e.g.https://github.com/liteapi-travel/javascript-sdk | ||
then install it via: | ||
```js | ||
const result = await liteApi.getHotels(countryCode, cityName, offset, limit, longitude, latitude, distance) | ||
``` | ||
```shell | ||
npm install liteapi-travel/javascript-sdk --save | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**countryCode** | **string**| country code ISO-2 code - example (US) | [required] | ||
**cityName** | **string**| name of the city | [required] | ||
**offset** | **number**| specifies the number of rows to skip before starting to return rows | [optional] | ||
**limit** | **number**| limit number of results (max 1000) | [optional] | ||
**longitude** | **number** | longitude geo coordinates | [optional] | ||
**latitude** | **number** | latitude geo coordinates | [optional] | ||
**distance** | **number** | distance in meters (min 1000m) | [optional] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array of hotel objects containing the following properties: | ||
| Name | Type | Description | | ||
| --------------- | ------ | --------------------------------------------------------------------------------------------------------- | | ||
| **id** | **string** | The unique identifier of the hotel. | | ||
| **name** | **string** | The name of the hotel. | | ||
| **hotelDescription**| **string** | The description of the hotel. | | ||
| **currency** | **string** | The currency used in the hotel. | | ||
| **country** | **string** | The country code of the hotel. | | ||
| **city** | **string** | The city where the hotel is located. | | ||
| **latitude** | **number** | The latitude coordinates of the hotel's location. | | ||
| **longitude** | **number** | The longitude coordinates of the hotel's location. | | ||
| **address** | **string** | The address of the hotel. | | ||
| **zip** | **string** | The postal code of the hotel. | | ||
| **main_photo** | **string** | The URL of the main photo of the hotel. | | ||
| **stars** | **number** | The star rating of the hotel. | | ||
<br> | ||
## Hotel details | ||
The hotel details API returns all the static contents details of a hotel or property if the hotel ID is provided. The static content include name, description, address, amenities, cancellation policies, images and more. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const hotelID = "lp24373"; | ||
const result = await liteApi.getHotelDetails(hotelID); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**hotelId** | **string**| Unique ID of a hotel | [required] | ||
### For browser | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following | ||
the above steps with Node.js and installing browserify with `npm install -g browserify`, | ||
perform the following (assuming *main.js* is your entry file): | ||
| Name | Type | Description | | ||
| --------------- | ------ | --------------------------------------------------------------------------------------------------------- | | ||
| **id** | **string** | The unique identifier of the hotel. | | ||
| **name** | **string** | The name of the hotel. | | ||
| **hotelDescription** | **string** | The description of the hotel. | | ||
| **checkinCheckoutTimes** | **Object** | An object containing the check-in and check-out times of the hotel. | | ||
| **checkout** | **string** | The check-out time of the hotel. | | ||
| **checkin** | **string** | The check-in time of the hotel. | | ||
| **hotelImages** | **Array** | An array of hotel image objects containing the following properties: | | ||
| **url** | **string** | The URL of the hotel image. | | ||
| **thumbnailUrl** | **string** | The thumbnail URL of the hotel image. | | ||
| **caption** | **string** | The caption of the hotel image. | | ||
| **order** | **string** | The order of the hotel image (null if not applicable). | | ||
| **defaultImage** | **boolean** | Indicates whether the hotel image is the default image or not. | | ||
| **currency** | **string** | The currency used in the hotel. | | ||
| **country** | **string** | The country code of the hotel. | | ||
| **city** | **string** | The city where the hotel is located. | | ||
| **starRating** | **number** | The star rating of the hotel. | | ||
| **location** | **Object** | An object containing the latitude and longitude coordinates of the hotel's location. | | ||
| **latitude** | **number** | The latitude coordinate of the hotel's location. | | ||
| **longitude** | **number** | The longitude coordinate of the hotel's location. | | ||
| **address** | **string** | The address of the hotel. | | ||
| **zip** | **string** | The postal code of the hotel. | | ||
| **chainId** | **string** | The unique identifier of the hotel chain. | | ||
| **hotelFacilities** | **Array** | An array of hotel facilities offered by the hotel. | | ||
```shell | ||
browserify main.js > bundle.js | ||
<br> | ||
## IATA code list | ||
The API returns the IATA (International Air Transport Association) codes for all available airports along with the name of the airport, geographical coordinates and country code in ISO-2 format. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const result = await liteApi.getIataCodes(); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Then include *bundle.js* in the HTML pages. | ||
This endpoint does not need any parameter. | ||
### Webpack Configuration | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
Using Webpack you may encounter the following error: "Module not found: Error: | ||
Cannot resolve module", most certainly you should disable AMD loader. Add/merge | ||
the following section to your webpack config: | ||
An array of IATA objects with the following properties: | ||
```javascript | ||
module: { | ||
rules: [ | ||
{ | ||
parser: { | ||
amd: false | ||
} | ||
} | ||
] | ||
} | ||
| Name | Type | Description | | ||
| ----------- | ------ | ------------------------------------------------ | | ||
| **code** | **string** | The IATA code. | | ||
| **name** | **string** | The name of the IATA. | | ||
| **latitude** | **number** | The latitude coordinates of the IATA. | | ||
| **longitude** | **number** | The longitude coordinates of the IATA. | | ||
| **countryCode** | **string** | The country code of the IATA. | | ||
<br> | ||
# Booking flow | ||
liteAPI is a comprehensive and simple to implement Hotel Booking API. The booking flow consists of 3 section: Search, Book, and | ||
booking management. | ||
<br> | ||
## Search | ||
### Minimum Rates availability | ||
------ | ||
Hotel Minimum Rates API is to search and return the minimum room rates that are available for a list of hotel ID's on the specified search dates. | ||
For each hotel ID, the minimum room rate that is available is returned. | ||
The API also has a built in loyalty rewards system. The system rewards return users who have made prior bookings. | ||
If the search is coming from a known guest ID, the guest level is also returned along with the pricing that's appropriate for the guest level. | ||
If it is a new user, the guest ID will be generated at the time of the first confirmed booking. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const checkin = "2023-07-15"; | ||
const checkout = "2023-07-16"; | ||
const currency = "USD"; | ||
const guestNationality = "US"; | ||
const hotelIdsList = ["lp3803c", "lp1f982", "lp19b70", "lp19e75"]; | ||
const adults = 2; | ||
//Optional values | ||
const childrenAges = [2,3]; | ||
const travelerID = "traveler1"; | ||
const result = await liteApi.getMinimumRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults); | ||
``` | ||
## Getting Started | ||
To utilize optional values, you can invoke the function as follows: | ||
```js | ||
const result = await liteApi.getMinimumRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults,childrenAges,travelerID); | ||
``` | ||
Please follow the [installation](#installation) instruction and execute the following JS code: | ||
```javascript | ||
var LiteApi = require('liteapi-travel'); | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
var defaultClient = LiteApi.ApiClient.instance; | ||
// Configure API key authorization: apikeyAuth | ||
var apikeyAuth = defaultClient.authentications['apikeyAuth']; | ||
apikeyAuth.apiKey = "YOUR API KEY" | ||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) | ||
//apikeyAuth.apiKeyPrefix['X-API-Key'] = "Token" | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**hotelIds** | **string**| List of hotelIds | [required] | ||
**checkin** | **string**| Check in data in YYYY-MM-DD format | [required] | ||
**checkout** | **string**| Check out data in YYYY-MM-DD format | [required] | ||
**currency** | **string**| Currency code - example (USD) | [required] | ||
**guestNationality** | **string**| Guest nationality ISO-2 code - example (SG) | [required] | ||
**adults** | **number**| Number of adult guests staying | [required] | ||
**children** | **string**| Number of children staying if any | [optional] | ||
**guestId** | **string**| Unique traveler ID if available | [optional] | ||
var api = new LiteApi.BookApi() | ||
var opts = { | ||
'ratesBookPostRequest': {"prebookId":"UwfMkUWH6","guestInfo":{"guestFirstName":"Kim","guestLastName":"James","guestEmail":"test@nlite.ml"},"payment":{"holderName":"Kim James","number":"4242424242424242","expireDate":"11/29","cvc":"456","method":"CREDIT_CARD"}} // {RatesBookPostRequest} | ||
}; | ||
var callback = function(error, data, response) { | ||
if (error) { | ||
console.error(error); | ||
} else { | ||
console.log('API called successfully. Returned data: ' + data); | ||
} | ||
}; | ||
api.ratesBookPost(opts, callback); | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array of hotel minimum rates objects with the following properties: | ||
| Name | Type | Description | | ||
| ------------ | ------ | ------------------------------------------------ | | ||
| **hotelId** | **string** | The ID of the hotel. | | ||
| **currency** | **string** | The currency code for the price. | | ||
| **price** | **number** | The price of the hotel. | | ||
| **supplierId** | **number** | The ID of the supplier. | | ||
| **supplier** | **string** | The name of the supplier. | | ||
<br> | ||
### Hotel full rates availability | ||
------ | ||
The Full Rates API is to search and return all available rooms along with its rates, cancellation policies for a list of hotel ID's based on the search dates. | ||
For each hotel ID, all available room information is returned. | ||
The API also has a built in loyalty rewards system. The system rewards return users who have made prior bookings. | ||
If the search is coming from a known guest ID, the guest level is also returned along with the pricing that's appropriate for the guest level. | ||
If it is a new user, the guest ID will be generated at the time of the first confirmed booking. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const checkin = "2023-07-15"; | ||
const checkout = "2023-07-16"; | ||
const currency = "USD"; | ||
const guestNationality = "US"; | ||
const hotelIdsList = ["lp3803c", "lp1f982", "lp19b70", "lp19e75"]; | ||
const adults = 2; | ||
//Optional values | ||
const childrenAges = [2,3]; | ||
const travelerID = "traveler1"; | ||
const result = await liteApi.getFullRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults); | ||
``` | ||
## Documentation for API Endpoints | ||
To utilize optional values, you can invoke the function as follows: | ||
```js | ||
const result = await liteApi.getFullRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults,childrenAges,travelerID); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
All URIs are relative to *https://api.liteapi.travel/v2.0* | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**hotelIds** | **string**| List of hotelIds | [required] | ||
**checkin** | **string**| Check in data in YYYY-MM-DD format | [required] | ||
**checkout** | **string**| Check out data in YYYY-MM-DD format | [required] | ||
**currency** | **string**| Currency code - example (USD) | [required] | ||
**guestNationality** | **string**| Guest nationality ISO-2 code - example (SG) | [required] | ||
**adults** | **number**| Number of adult guests staying | [required] | ||
**children** | **string**| Number of children staying if any | [optional] | ||
**guestId** | **string**| Unique traveler ID if available | [optional] | ||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*LiteApi.BookApi* | [**ratesBookPost**](docs/BookApi.md#ratesBookPost) | **POST** /rates/book | hotel rate book | ||
*LiteApi.BookApi* | [**ratesPrebookPost**](docs/BookApi.md#ratesPrebookPost) | **POST** /rates/prebook | hotel rate prebook | ||
*LiteApi.BookingManagementApi* | [**bookingsBookingIdGet**](docs/BookingManagementApi.md#bookingsBookingIdGet) | **GET** /bookings/{bookingId} | Booking retrieve | ||
*LiteApi.BookingManagementApi* | [**bookingsBookingIdPut**](docs/BookingManagementApi.md#bookingsBookingIdPut) | **PUT** /bookings/{bookingId} | Booking cancel | ||
*LiteApi.BookingManagementApi* | [**bookingsGet**](docs/BookingManagementApi.md#bookingsGet) | **GET** /bookings | Booking list | ||
*LiteApi.GuestAndLoyaltyApi* | [**guestsGet**](docs/GuestAndLoyaltyApi.md#guestsGet) | **GET** /guests | guests | ||
*LiteApi.SearchApi* | [**hotelsGet**](docs/SearchApi.md#hotelsGet) | **GET** /hotels | hotel minimum rates availability | ||
*LiteApi.SearchApi* | [**hotelsRatesGet**](docs/SearchApi.md#hotelsRatesGet) | **GET** /hotels/rates | hotel full rates availability | ||
*LiteApi.StaticDataApi* | [**dataCitiesGet**](docs/StaticDataApi.md#dataCitiesGet) | **GET** /data/cities | City list | ||
*LiteApi.StaticDataApi* | [**dataCountriesGet**](docs/StaticDataApi.md#dataCountriesGet) | **GET** /data/countries | Country list | ||
*LiteApi.StaticDataApi* | [**dataCurrenciesGet**](docs/StaticDataApi.md#dataCurrenciesGet) | **GET** /data/currencies | Currency list | ||
*LiteApi.StaticDataApi* | [**dataHotelGet**](docs/StaticDataApi.md#dataHotelGet) | **GET** /data/hotel | Hotel details | ||
*LiteApi.StaticDataApi* | [**dataHotelsGet**](docs/StaticDataApi.md#dataHotelsGet) | **GET** /data/hotels | Hotel list | ||
*LiteApi.StaticDataApi* | [**dataIataCodesGet**](docs/StaticDataApi.md#dataIataCodesGet) | **GET** /data/iataCodes | IATA code list | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array of hotel full rates with the following properties: | ||
## Documentation for Models | ||
| Name | Type | Description | | ||
| ------------ | ------ | ------------------------------------------------ | | ||
| **roomTypeId** | string | The ID of the room type. | | ||
| **supplier** | string | The name of the supplier. | | ||
| **supplierId** | number | The ID of the supplier. | | ||
| **rates** | Array | An array of rate objects containing the pricing and details for each rate within the room type. | | ||
| **rateId** | string | The ID of the rate. | | ||
| **name** | string | The name of the rate. | | ||
| **maxOccupancy** | number | The maximum occupancy of the room. | | ||
| **boardType** | string | The type of board included (e.g., Bed Only). | | ||
| **boardName** | string | The name of the board (e.g., Bed Only). | | ||
| **priceType** | string | The type of pricing (e.g., commission). | | ||
| **commission** | Array | An array of commission objects containing the commission amount and currency. | | ||
| **retailRate** | Object | An object containing the retail rate information, including total price, MSP (Marked Selling Price), and taxes and fees. | | ||
| **total** | Array | An array of total price objects containing the amount and currency. | | ||
| **msp** | Array | An array of MSP (Marked Selling Price) objects containing the amount and currency. | | ||
| **taxesAndFees** | Array | An array of taxes and fees objects containing information about included or additional charges. | | ||
| **cancellationPolicies** | Object | An object containing cancellation policy information. | | ||
| **cancelPolicyInfos** | Array | An array of cancellation policy info objects containing information about cancellation time, amount, currency, and type. | | ||
| **hotelRemarks** | Array | An array of hotel remarks. | | ||
| **refundableTag** | string | The tag indicating if the rate is refundable or non-refundable. | | ||
- [LiteApi.RatesBookPostRequest](docs/RatesBookPostRequest.md) | ||
- [LiteApi.RatesBookPostRequestGuestInfo](docs/RatesBookPostRequestGuestInfo.md) | ||
- [LiteApi.RatesBookPostRequestPayment](docs/RatesBookPostRequestPayment.md) | ||
<br> | ||
## Documentation for Authorization | ||
## Book | ||
### Hotel rate prebook | ||
------ | ||
Authentication schemes defined for the API: | ||
### apikeyAuth | ||
This API is used to confirm if the room and rates for the search criterion. The input to the endpoint is a specific rate Id coming from the GET hotel full rates availability API. | ||
In response, the API generates a prebook Id, a new rate Id and contains information if price, cancellation policy or boarding information has changed. | ||
- **Type**: API key | ||
- **API key parameter name**: X-API-Key | ||
- **Location**: HTTP header | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const rateId = "NRYDCZRZHAZHYMRQGIZS2MBXFUYTK7BSGAZDGLJQG4WTCNT4GJ6HYVKTPRDVSWSEJVMVUV2HIUZUOS2OKJKEOWKZKRCU2QSXJVETGRCTJZKEMR2ZGNMFSTKKIRDUSWKEIVGVUUKHGRMVISZXIJJUOQK2IRDU2QSYI5CTGSCZLJGE6TBVJNLEON2DKZFU4NSGJNKTERKQKFNEKQ2NINCFAUK2IRCU6QSUKBJEWVCFKZJVST2KGZCEGTSSLFEEKWKEINHFUV2HKUZVIUKOJJNE6QSELBHVKQSEI5CVURCTJZBFER2BKJKEOTKKJZDUKWSEKNHEEUSHII3EMRKSKNHVAUK2IRAU2USUI5ATGVCDJVJFCR2FLFCECN2CKRIFCWKUJFHEEVCHLFJFMRKULJCEWSSEIU2ESWSTI5AVURCHJRFFCRZUK5KEGTKRPRKVGRD4PR6DCNRWFYYDC7BSGAZDGLJQG4WTCMT4IJHXYMJSHE2DCMD4GI"; | ||
const result = await liteApi.preBook(rateId) | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**body** | **Object**| | [required] | ||
**rateId** | **string**| rate id retrieved from rates response| [required] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An object containing prebook information and room type details. | ||
| Name | Type | Description | | ||
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------ | | ||
| **prebookId** | **string** | The ID of the prebook. | | ||
| **hotelId** | **string** | The ID of the hotel. | | ||
| **currency** | **string** | The currency used for pricing. | | ||
| **termsAndConditions** | **string** | The terms and conditions (if available). | | ||
| **roomTypes** | **Array** | An array of room type objects containing the following properties: | | ||
| **rates** | **Array** | An array of rate objects containing pricing and details for each rate within the room type. | | ||
| **rateId** | **string** | The ID of the rate. | | ||
| **name** | **string** | The name of the rate. | | ||
| **maxOccupancy** | **number** | The maximum occupancy of the room. | | ||
| **boardType** | **string** | The type of board included (e.g., Bed Only). | | ||
| **boardName** | **string** | The name of the board (e.g., Bed Only). | | ||
| **priceType** | **string** | The type of pricing (e.g., commission). | | ||
| **commission** | **Object** | An array of commission objects containing the commission amount and currency. | | ||
| **retailRate** | **Object** | An object containing the retail rate information, including total price, MSP (Marked Selling Price), and taxes and fees. | | ||
| **total** | **Object** | An array of total price objects containing the amount and currency. | | ||
| **msp** | **Object** | An array of MSP (Marked Selling Price) objects containing the amount and currency. | | ||
| **taxesAndFees** | **Object** | An array of taxes and fees objects containing information about included or additional charges. | | ||
| **cancellationPolicies** | **Object** | An object containing cancellation policy information. | | ||
| **cancelPolicyInfos** | **Object** | An array of cancellation policy info objects containing information about cancellation time, amount, and type. | | ||
| **hotelRemarks** | **Array** | An array of hotel remarks. | | ||
| **refundableTag** | **string** | The tag indicating if the rate is refundable or non-refundable. | | ||
| **msp** | **number** | The Marked Selling Price (MSP) for the prebook. | | ||
| **commission** | **number** | The commission amount for the prebook. | | ||
| **price** | **number** | The price of the prebook. | | ||
| **priceType** | **string** | The type of pricing (e.g., commission). | | ||
| **priceDifferencePercent**| **number** | The percentage difference between the retail rate and the Marked Selling Price (MSP). | | ||
| **cancellationChanged** | **boolean** | Indicates if there were changes to the cancellation policy. | | ||
| **boardChanged** | **boolean** | Indicates if there were changes to the board type. | | ||
| **supplier** | **string** | The name of the supplier. | | ||
| **supplierId** | **number** | The ID of the supplier. | | ||
<br> | ||
### Hotel rate book | ||
------ | ||
This API confirms a booking when the prebook Id and the rate Id from the pre book stage along with the guest and payment information are passed. | ||
The guest information is an object that should include the guest first name, last name and email. | ||
The payment information is an object that should include the name, credit card number, expiry and CVC number. | ||
The response will confirm the booking along with a booking Id and a hotel confirmation code. It will also include the booking details including the dates, price and the cancellation policies. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const prebookID = "8iaO7PXBU"; | ||
const guestInfo = { guestFirstName: 'Kim', guestLastName: 'James', guestEmail: 'test@nlite.ml' }; | ||
const paymentMethod = "CREDIT_CARD"; | ||
const holderName = "Kim James"; | ||
const paymentInfo = { "card_number": "4242424242424242", "exp_month": 11, exp_year: "23", "cvc": 123 } | ||
const result = await liteApi.book(prebookID, guestInfo, paymentMethod, holderName, paymentInfo) | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**body** | **Object**| | [required] | ||
**rateId** | **string**| rate id retrieved from rates response| [required] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An object containing booking information and room details. | ||
| Name | Type | Description | | ||
| ------------------------- | ------- | ------------------------------------ | | ||
| **bookingId** | **string** | The ID of the booking. | | ||
| **clientReference** | **string** | The client reference. | | ||
| **supplierBookingId** | **string** | The supplier booking ID. | | ||
| **supplierBookingName** | **string** | The supplier booking name. | | ||
| **supplier** | **string** | The supplier. | | ||
| **supplierId** | **number** | The ID of the supplier. | | ||
| **status** | **string** | The status of the booking. | | ||
| **hotelConfirmationCode** | **string** | The hotel confirmation code. | | ||
| **checkin** | **string** | The check-in date. | | ||
| **checkout** | **string** | The check-out date. | | ||
| **hotel** | **object** | An object containing hotel details. | | ||
| **bookedRooms** | **array** | An array of booked room objects. | | ||
| **roomType** | **object** | An object containing room type details. | | ||
| **adults** | **number** | The number of adults. | | ||
| **children** | **number** | The number of children. | | ||
| **rate** | **object** | An object containing rate details. | | ||
| **maxOccupancy** | **number** | The maximum occupancy. | | ||
| **retailRate** | **object** | An object containing the retail rate information, including total price. | | ||
| **guestInfo** | **object** | An object containing guest details. | | ||
| **createdAt** | **string** | The creation date of the booking. | | ||
| **cancellationPolicies** | **object** | An object containing cancellation policies information. | ||
| **cancelPolicyInfos** | **Object** | An array of cancellation policy info objects containing information about cancellation time, amount, and type. | | ||
| **hotelRemarks** | **Array** | An array of hotel remarks. | | ||
| **refundableTag** | **string** | The tag indicating if the rate is refundable or non-refundable. | ||
| **price** | **number** | The price of the booking. | | ||
| **msp** | **number** | The MSP (Merchant Service Provider) price. | | ||
| **commission** | **number** | The commission amount. | | ||
| **currency** | **string** | The currency of the booking. | | ||
<br> | ||
## Booking management | ||
### Booking list | ||
------ | ||
The API returns the list of booking Id's for a given guest Id. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const guestId = "FrT56hfty"; | ||
const result = await liteApi.getBookingListByGuestId(guestId) | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**guestId** | **string** | The Guest Id of the user | [required] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array containing objects with the following properties: | ||
| Name | Type | Description | | ||
| ----------- | ------ | ------------------ | | ||
| **bookingId** | **string** | The booking ID. | | ||
<br> | ||
### Booking retrieve | ||
------ | ||
The API returns the status and the details for the a specific booking Id. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const bookingId = "uSQ6Zsc5R"; | ||
const result = await liteApi.cancelBooking(bookingId); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**bookingId** | **string** | The Booking Id that needs to be retrieved | [required] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An object containing booking information and room details. | ||
| Name | Type | Description | | ||
| --------------------- | ------ | -------------------------------- | | ||
| **bookingId** | **string** | The booking ID. | | ||
| **clientReference** | **string** | The client reference. | | ||
| **status** | **string** | The booking status. | | ||
| **hotelConfirmationCode** | **string** | The hotel confirmation code. | | ||
| **checkin** | **string** | The check-in date. | | ||
| **checkout** | **string** | The check-out date. | | ||
| **hotel** | **object** | An object containing hotel details. | | ||
| **bookedRooms** | **array** | An array of booked room objects. | | ||
| **roomType** | **object** | An object containing room type details. | | ||
| **adults** | **number** | The number of adults. | | ||
| **children** | **number** | The number of children. | | ||
| **rate** | **object** | An object containing rate details. | | ||
| **maxOccupancy** | **number** | The maximum occupancy. | | ||
| **boardType** | **string** | The board type. | | ||
| **boardName** | **string** | The board name. | | ||
| **retailRate** | **object** | An object containing the retail rate information, including total price. | | ||
| **guestInfo** | **object** | An object containing guest information. | | ||
| **createdAt** | **string** | The creation date of the booking. | | ||
| **cancellationPolicies** | **object** | An object containing cancellation policy details. | | ||
| **cancelPolicyInfos** | **Object** | An array of cancellation policy info objects containing information about cancellation time, amount, and type. | | ||
| **hotelRemarks** | **Array** | An array of hotel remarks. | | ||
| **refundableTag** | **string** | The tag indicating if the rate is refundable or non-refundable. | ||
| **currency** | **string** | The currency code. | | ||
| **price** | **number** | The price of the booking. | | ||
<br> | ||
### Booking cancel | ||
------ | ||
This API is used to request a cancellation of an existing confirmed booking. Cancellation policies and conditions will be used to determine the success of the cancellation. For example a booking with non-refundable (NRFN) tag or a booking with a cancellation policy that was requested past the cancellation date will not be able to cancel the confirmed booking. | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const bookingId = "K8Hvb-85O"; | ||
const result = await liteApi.cancelBooking(bookingId); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**bookingId** | **string** | The unique identifier of the booking you would like to update. | [required] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
| Name | Type | Description | | ||
| ---------------- | ------ | --------------------------- | | ||
| **bookingId** | **string** | The booking ID. | | ||
| **status** | **string** | The booking status. | | ||
| **cancellation_fee** | **number** | The cancellation fee. | | ||
| **refund_amount** | **number** | The refund amount. | | ||
| **currency** | **string** | The currency of the booking. | | ||
<br> | ||
# Guest and loyalty | ||
## Guests | ||
The guests API returns the unique guest IDs | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Example :</h4> | ||
```js | ||
const result = await liteApi.getGuestsIds(); | ||
``` | ||
If you want to retrieve the guest IDs of a specific user based on their email, you can provide the email as an optional parameter: | ||
```js | ||
const email = "johndoe@nlite.ml"; //Optional | ||
const result = await liteApi.getGuestsIds(email); | ||
``` | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Parameters :</h4> | ||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**email** | **string**| Email ID of the guest | [optional] | ||
* <h4 style="color:#9155fd; font-weight: 800;"> Return type :</h4> | ||
An array containing objects with the following properties: | ||
| Name | Type | Description | | ||
| ---------- | ------ | ---------------- | | ||
| **guestId** | **string** | The guest ID. | |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
0
691
0
71285
3
701
2
15
- Removed@babel/cli@^7.0.0
- Removedsuperagent@^5.3.0
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/cli@7.26.4(transitive)
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/compat-data@7.26.8(transitive)
- Removed@babel/core@7.26.9(transitive)
- Removed@babel/generator@7.26.9(transitive)
- Removed@babel/helper-compilation-targets@7.26.5(transitive)
- Removed@babel/helper-module-imports@7.25.9(transitive)
- Removed@babel/helper-module-transforms@7.26.0(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/helper-validator-option@7.25.9(transitive)
- Removed@babel/helpers@7.26.9(transitive)
- Removed@babel/parser@7.26.9(transitive)
- Removed@babel/template@7.26.9(transitive)
- Removed@babel/traverse@7.26.9(transitive)
- Removed@babel/types@7.26.9(transitive)
- Removed@jridgewell/gen-mapping@0.3.8(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removed@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3(transitive)
- Removedanymatch@3.1.3(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbinary-extensions@2.3.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedbrowserslist@4.24.4(transitive)
- Removedcall-bind-apply-helpers@1.0.2(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedcaniuse-lite@1.0.30001699(transitive)
- Removedchokidar@3.6.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcommander@6.2.1(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removedcookiejar@2.1.4(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedelectron-to-chromium@1.5.101(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedes-set-tostringtag@2.1.0(transitive)
- Removedescalade@3.2.0(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedform-data@3.0.3(transitive)
- Removedformidable@1.2.6(transitive)
- Removedfs-readdir-recursive@1.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedglobals@11.12.0(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-binary-path@2.1.0(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@3.1.0(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedmake-dir@2.1.0(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@2.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedms@2.1.3(transitive)
- Removednode-releases@2.0.19(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removedobject-inspect@1.13.4(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpify@4.0.1(transitive)
- Removedqs@6.14.0(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedreaddirp@3.6.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@5.7.26.3.17.7.1(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedslash@2.0.0(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedsuperagent@5.3.1(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedupdate-browserslist-db@1.1.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyallist@3.1.1(transitive)