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-10-27 20:08:27 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

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