# nuitee

> ## Table of Contents

Latest version **1.1.6** (published 2021-11-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install nuitee
pnpm add nuitee
yarn add nuitee
bun add nuitee
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2021-11-04 |
| First published | 2021-11-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 2 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Nuitée Travel LTD |
| Maintainers | nuitee |
| Keywords | Nuitee, SDK, API, Travel, Nodejs, npm |

## Links

- npm: https://www.npmjs.com/package/nuitee
- Repository: https://github.com/hfadili-berkeley-systems/nuitee-nodejs-sdk
- Homepage: https://github.com/hfadili-berkeley-systems/nuitee-nodejs-sdk#readme
- Issues: https://github.com/hfadili-berkeley-systems/nuitee-nodejs-sdk/issues
- npm.io page: https://npm.io/package/nuitee

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0

## Recent versions

- 1.1.6 (latest) — 2021-11-04
- 1.1.5 — 2021-11-04
- 1.1.4 — 2021-11-04
- 1.1.3 — 2021-11-04

## README

# Nuitée SDK

## Table of Contents

- [Installing](#installing)
- [Static data](#static-data)
  - [All destinations](#all-destinations)
  - [Get hotels by city](#get-hotels-by-city)
  - [Get hotel By ID](#get-hotel-by-id)
  - [Boards list](#boards-list)
- [Booking flow](#booking-flow)
  - [Search](#search)
  - [Pre-book](#pre-book)
  - [Confirm booking](#confirm-booking)
  - [Get booking details](#get-booking-details)
  - [Cancel booking](#cancel-booking)

## Installing

Using npm:

```bash
$ npm install nuitee
```

## Example

### note: CommonJS usage

Using CommonJS imports with `require()` use the following approach:

```js
const NuiteeSDK = require("nuitee");
const API_KEY = "";
const SHARED_SECRET = "";
const MODE = "sandbox"; //live - sandbox
const nuitee = new NuiteeSDK(API_KEY, SHARED_SECRET, MODE);
```

## Static data

### All destinations

Fetch all destinations

```js
const response = await nuitee.allDestinations();
```

### Get hotels by city

Gte list of hotels by city ID

```js
const cityID = 2734;
const response = await nuitee.getHotelsByCityID(cityID);
```

### Get hotel By ID

Get hotel details

```js
const hotelID = 1098;
const response = await nuitee.getHotelById(hotelID);
```

### Boards list

Fetch all board type

```js
const response = await nuitee.getBoards();
```

## Booking flow

Nuitee API is a comprehensive and simple to implement Hotel Booking API. The booking flow consists of 3 steps: Search, preBook, and Confirm. The API also allows booking cancellations as well as static data retrieval.

### Search

This method is used to request room availability. Some filters and special features can be applied before sending an availability request. A flexible date search allows customers to retrieve available rates. The response generated is a list of hotels with the different room types, board types, cancellation policies, and rates available for those hotels. The rates include supplements and discounts and no additional price calculations are required. The cancellation fees are also returned in the availability response.

```js
const searchConfig = {
  checkInDate: "2021-08-29",
  checkOutDate: "2021-08-30",
  hotelCodes: [131880, 4110],
  roomGuests: [
    {
      adultCount: 2,
      childCount: 0,
    },
    {
      adultCount: 1,
      childCount: 1,
      childAges: [3],
    },
  ],
  guestNationality: "US",
  currency: "USD",
  languageCode: "en_US",
  timeout: 20000,
};
let result = await nuitee.search(searchConfig);
```

### Pre-book

```js
const preBookConfig = {
  sessionId:
    "20210829|20210830|en_US|US|USD|2A0C/1A1C3|891|NEZ0Kj|1622885622393xZzi",
  hotelCode: "4110",
  rateDetailCode: "145-4110|RFN|20210821|4|51290",
  confirmedRooms: [
    {
      boardId: "RO",
      roomCode: "661IQjpu4CPNfM8C7ow71b9vz2o2RsMaDiBOLCCH9zE=|1",
    },
    {
      boardId: "RO",
      roomCode: "661IQjpu4CPNfM8C7ow71b9vz2o2RsMaDiBOLCCH9zE=|2",
    },
  ],

  timeout: "20000",
};
let result = await nuitee.preBook(preBookConfig);
```

### Confirm booking

```js
let bookConfig = {
  sessionId:
    "20210829|20210830|en_US|US|USD|2A0C/1A1C3|891|NEZ0Kj|1622885622393xZzi",
  hotelCode: 131880,
  confirmPropertyCode: "145-4110|RFN|20210821|4|51290",
  confirmedBooking: true,
  clientIdentifier: "agency_booking_locator",
  holder: {
    email: "example@example.com",
    firstName: "f-name",
    lastName: "l-name",
    titulation: "Mr",
  },
  reservationInfo: {
    customerRoomInfos: [
      {
        roomCode: "661IQjpu4CPNfM8C7ow71b9vz2o2RsMaDiBOLCCH9zE=|1",
        firstName: "f-name",
        lastName: "l-name",
        titulation: "Mr",
        customerComment: null,
      },
      {
        roomCode: "661IQjpu4CPNfM8C7ow71b9vz2o2RsMaDiBOLCCH9zE=|2",
        firstName: "f-name",
        lastName: "l-name",
        titulation: "Mr",
        customerComment: null,
      },
    ],
  },
  billingInfo: {
    paymentMethodType: "LIMIT",
  },
  timeout: 60000,
};
let result = await nuitee.book(bookConfig);
```

### Get booking details

```js
const bookingId = BOOKING_ID_VAL;
let result = await nuitee.getBookingByID(bookingId);
```

### Cancel booking

```js
const bookingId = BOOKING_ID_VAL;
const reason = "Some text here"; // OPTIONAL
let result = await nuitee.cancelBooking(bookingId, reason);
```

---
_Source: https://npm.io/package/nuitee · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
