konfig/nuitee-lite-php-sdk

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

v1.8.0 2023-04-27 16:57 UTC

This package is auto-updated.

Last update: 2024-04-27 19:09:25 UTC


README

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

Installation & Usage

Requirements

This library requires PHP ^8.0

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/konfig-dev/nuitee-lite-php-sdk.git"
    }
  ],
  "require": {
    "konfig/nuitee-lite-php-sdk": "1.8.0"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/nuitee-lite-php-sdk/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apikeyAuth
$config = Nuitee\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Nuitee\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

// Setting host path is optional and defaults to https://api.liteapi.travel/v1.0
// Nuitee\Configuration::getDefaultConfiguration()->setHost("https://api.liteapi.travel/v1.0");

$apiInstance = new Nuitee\Api\BookApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    // new GuzzleHttp\Client(),
    $config
);

$book_request = new \Nuitee\Model\BookRequest([
        "prebook_id" => "prebook_id_example",
    ]);

try {
    $result = $apiInstance->book(
        book_request: $book_request
    );
    print_r($result->$getData());
    print_r($result->$getGuestLevel());
    print_r($result->$getSandbox());
} catch (\Exception $e) {
    echo 'Exception when calling BookApi->book: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.liteapi.travel/v1.0

Class Method HTTP request Description
BookApi book POST /rates/book hotel rate book
BookApi prebook POST /rates/prebook hotel rate prebook
BookingManagementApi cancel PUT /bookings/{bookingId} Booking cancel
BookingManagementApi listBookings GET /bookings Booking list
BookingManagementApi retrieve GET /bookings/{bookingId} Booking retrieve
GuestAndLoyaltyApi getGuestId GET /guests guests
SearchApi getHotelRates GET /hotels/rates hotel full rates availability
SearchApi getHotels GET /hotels hotel minimum rates availability
StaticDataApi getHotel GET /data/hotel Hotel details
StaticDataApi listCities GET /data/cities City list
StaticDataApi listCountries GET /data/countries Country list
StaticDataApi listCurrencies GET /data/currencies Currency list
StaticDataApi listHotels GET /data/hotels Hotel list
StaticDataApi listIataCodes GET /data/iataCodes IATA code list

Models

Authorization

apikeyAuth

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

About this package

This PHP package is automatically generated by Konfig:

  • API version: 1.0.0
    • Package version: 1.8.0