PHPackages                             iivanov/hotel-api-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. iivanov/hotel-api-sdk-php

ActiveLibrary[API Development](/categories/api)

iivanov/hotel-api-sdk-php
=========================

Hotelbeds Hotel-API SDK for PHP

4.1.0(2y ago)0938LGPL-2.1PHP

Since Apr 21Pushed 2y agoCompare

[ Source](https://github.com/ilianiv/hotel-api-sdk-php)[ Packagist](https://packagist.org/packages/iivanov/hotel-api-sdk-php)[ RSS](/packages/iivanov-hotel-api-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (22)Used By (0)

hotel-api-sdk-php
=================

[](#hotel-api-sdk-php)

Introduction
------------

[](#introduction)

Hotelbeds SDK for PHP is a set of utilities whose main goal is to help in the development of PHP applications that use APItude, the Hotelbeds API. This is a composer library available on packagist.org repository.

Step by Step Guide
------------------

[](#step-by-step-guide)

License
-------

[](#license)

This softwared is licensed under the LGPL v2.1 license. Please refer to the file LICENSE for specific details and more license and copyright information.

API Documentation
-----------------

[](#api-documentation)

Install
-------

[](#install)

Install from console with Composer utility:

```
composer require hotelbeds/hotel-api-sdk-php
```

Using Composer Dependency Manager with PHPStorm:

Important!!! This version is in dev-master@dev version and you need install with:

```
composer require "hotelbeds/hotel-api-sdk-php:dev-master@dev"
```

Testing
-------

[](#testing)

In the directory unit tests can find different tests that can be run with phpunit. There are different sets of tests: Availability and bookings.

```
.\vendor\bin\phpunit --testsuite availability
```

This testsuite execute: status of API, make availability on PMI destination, select one room and do checkrate and booking.

Using SDK
---------

[](#using-sdk)

### Overview

[](#overview)

The HotelApiClient class has different methods that implement the various calls HotelAPI:

- Availability
- CheckRate
- BookingConfirm
- BookingCancellation
- BookingList
- Status

Each method has a parameter that is ApiHelper type, there are four possible types:

- Availability
- CheckRate
- Booking
- BookingList

All responses each call can either iterate using PHP with objects or arrays. Internally converts the JSON response structure PHP associative arrays.

### Important notes

[](#important-notes)

The SDK uses classes with magic properties and methods to document this feature use the standard @property which is used is explained here: [http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial\_tags.property.pkg.html](http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.property.pkg.html)The different calls made SDK are magical methods also documented by the same method, and depend on the IDE to use if you have visibility of the same when using the auto-complete. The SDK has been tested and certified with the IDE PhpStorm but the user can use the always prefer and when you consider that the auto-complete will work or not depending on whether it supports "@property" or not.

Ensure you have installed openssl and curl extensions to your PHP environment and cacerts paths are set.

### Include library using autoload [PSR-4](http://www.php-fig.org/psr/psr-4/)

[](#include-library-using-autoload-psr-4)

```
