PHPackages                             adventureres/php-sdk-v1 - 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. adventureres/php-sdk-v1

ActiveLibrary

adventureres/php-sdk-v1
=======================

AdventureRes SDK for PHP

v1.1(9y ago)053GPL-3.0+PHPPHP &gt;=5.4.0

Since Apr 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/paramoredigital/adventureres-php-sdk)[ Packagist](https://packagist.org/packages/adventureres/php-sdk-v1)[ Docs](https://github.com/paramoredigital)[ RSS](/packages/adventureres-php-sdk-v1/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (4)Versions (20)Used By (0)

AdventureRes SDK for PHP
========================

[](#adventureres-sdk-for-php)

This repository contains the open source PHP Software Development Kit that provides an easy way for PHP developers to communicate with the AdventureRes API. Full class reference is available [here](http://paramoredigital.github.io/adventureres-php-sdk/docs/).

> **Important Note**

This is NOT a plug-and-play store integration with the AdventureRes API. It cannot be used directly with WordPress for instance. To make use of this repository, a developer will be needed to create the store interface and manage the user's path through the checkout experience. There are no design assets, HTML, styles or javascript included in this repository.

Our aim instead is to lay the ground work for accomplishing these things by providing a simple and consistent way to pass data back and forth from your website/application to the AdventureRes system. What we do provide in this repository is a cohesive PHP class that can be used in a wide variety of PHP-based content management systems and PHP platforms. It handles input validation, API endpoint requests, response formatting, error handling, and browser sessions. This allieviates most of the potential errors and addresses many common needs involved with working with the AdventureRes API directly, while preserving the full functionality.

Put simply, this repository is not an ecommerce store -- it's the halfway mark. We built all the pieces to fit, but there is some assembly required.

Installation
------------

[](#installation)

```
composer require adventureres/php-sdk-v1
```

Usage
-----

[](#usage)

> **Note:** This SDK requires PHP version 5.4 or greater.

### Setting up the SDK

[](#setting-up-the-sdk)

To set up the SDK, pass in the required configuration parameters:

```
$advRes = new AdventureRes\AdventureRes(
    $baseDomain = 'http://reservations.domain.com',
    $apiKey     = '12345abcde', //  2,
    'YouthQty'   => 0,
    'Units'      => 0,
    'StartDate'  => '06/01/2016',
    'Display'    => 'ITEM'
]);

// Class declaration with attributes passed via the constructor:
$input = new ServiceAvailabilityModel([
    'AdultQty'   => 2,
    'YouthQty'   => 0,
    'Units'      => 0,
    'StartDate'  => '06/01/2016',
    'Display'    => 'ITEM'
]);
```

Attributes can also be set after the model has been instantiated by using the `setAttribute` method:

```
$input->setAttribute('AdultQty', 5);
```

#### Validating models and getting errors

[](#validating-models-and-getting-errors)

To validate a model, use the `isValid` method. You can also retrive errors from the model if it's invalid by using the `getErrors` method.

> **Note:** `isValid` must be run before `getErrors`.

```
if (! $model->isValid()) {
    // Get errors as an array
    $errors = $model->getErrors();

    // Get errors as a concatenated string
    $errorString = $model->getErrorsAsString();
}
```

#### Getting values from model attributes

[](#getting-values-from-model-attributes)

Model attributes can be accessed in a few different ways:

```
// Gets an array of all attributes and their values
$attributes = $model->getAttributes();

// Gets the value of one attribute
$attribute = $model->getAttribute('AdultPrice');

// Gets the value of one attribute using magic method
$attribute = $model->AdultPrice;
```

### Talking to API Endpoints

[](#talking-to-api-endpoints)

The SDK is segmented in the same way as the API - by service methods, package methods, reservation methods and customer methods:

```
$serviceAvailability = $advRes->service()->getServiceAvailability($inputModel);
$package = $advRes->package()->getPackage($inputModel);
$costSummary = $advRes->reservation()->getCostSummary($inputModel);
$newCustomer = $advRes->customer()->createCustomer($inputModel);
```

Full example
------------

[](#full-example)

```
use AdventureRes\AdventureRes;
use AdventureRes\Models\Input\ServiceAvailabilityInputModel;

$advRes = new AdventureRes($config['baseDomain'], $config['apiKey'], $config['username'], $config['password'], $config['location']);

try {
    $input = ServiceAvailabilityInputModel::populateModel([
        'ServiceId' => 123,
        'AdultQty'  => 2,
        'YouthQty'  => 0,
        'Units'     => 0,
        'StartDate' => '06/01/2016',
        'Display'   => 'ITEM'
    ]);

    $serviceAvailability = $advRes->service()->getServiceAvailability($input);

    if (! $serviceAvailability->isValid()) {
        throw new \Exception($serviceAvailability->getErrorsAsString());
    }

} catch (AdventureRes\Exceptions\AdventureResSDKException $ex) {
    return $ex->getMessage();
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 95% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Total

5

Last Release

3290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40f2ddd47d4ab1aa505b768bfc78d5e34f981c0aff4be6f0550c7669f9bf76c6?d=identicon)[paramoredigital](/maintainers/paramoredigital)

---

Top Contributors

[![benwilkins](https://avatars.githubusercontent.com/u/1360229?v=4)](https://github.com/benwilkins "benwilkins (19 commits)")[![cameronwest](https://avatars.githubusercontent.com/u/5316867?v=4)](https://github.com/cameronwest "cameronwest (1 commits)")

---

Tags

sdkAdventureRes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adventureres-php-sdk-v1/health.svg)

```
[![Health](https://phpackages.com/badges/adventureres-php-sdk-v1/health.svg)](https://phpackages.com/packages/adventureres-php-sdk-v1)
```

###  Alternatives

[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
