PHPackages                             oberonamsterdam/travelbase-api-client - 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. oberonamsterdam/travelbase-api-client

ActiveLibrary[API Development](/categories/api)

oberonamsterdam/travelbase-api-client
=====================================

API library to communicate with Travelbase

1.7.0(2y ago)11.7k↓50%MITPHPPHP ^7.1|^8.0

Since Jul 7Pushed 2y agoCompare

[ Source](https://github.com/oberonamsterdam/travelbase-api-client)[ Packagist](https://packagist.org/packages/oberonamsterdam/travelbase-api-client)[ RSS](/packages/oberonamsterdam-travelbase-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (29)Used By (0)

Travelbase Management API v2 - Client library
=============================================

[](#travelbase-management-api-v2---client-library)

This is a client library to communicate with the Travelbase Management API. You can use the client to manage your assets in Travelbase.

Usage of the Travelbase Management API is limited to registered users only. If you would like to use Travelbase, please visit [travelbase.nl](https://www.travelbase.nl).

---

Installation
============

[](#installation)

Run the following command to install the package using composer:

```
$ composer require oberonamsterdam/travelbase-api-client

```

---

Usage
=====

[](#usage)

To use this client you need to provide the API key and endpoint when initiating the client class.

```
$client = new \Oberon\TravelbaseClient\ApiClient("https://example.com", "APIKEY");
```

---

Example calls
=============

[](#example-calls)

### Queries

[](#queries)

Retrieve a collection of all partners:

```
/** @var \Oberon\TravelbaseClient\Model\Partner[] $partners */
$partners = $client->getPartners();
```

Retrieve a single partner:

```
/** @var \Oberon\TravelbaseClient\Model\Partner $partner */
$partners = $client->getPartner($yourPartnerId);
```

Retrieve a single accommodation:

```
/** @var \Oberon\TravelbaseClient\Model\Accommodation $accommodation */
$accommodation = $client->getAccommodation($yourAccommodationId);
```

Retrieve a single rentalUnit:

```
/** @var \Oberon\TravelbaseClient\Model\RentalUnit $rentalUnit */
$rentalUnit = $client->getRentalUnit($yourRentalUnitId);
```

Retrieve all bookings:

```
$cursor = null;
$hasMoreBookings = true;
/** @var \Oberon\TravelbaseClient\Model\Booking[] $bookings */
$bookings = [];
while ($hasMoreBookings) {
    $bookingConnection =  $client->getAllBookings($yourPartnerId, 10, $cursor);
    $bookings = array_merge($bookings, $bookingConnection->getNodes());
    $cursor = $bookingConnection->getPageInfo()->getEndCursor();
    $hasMoreBookings = $bookingConnection->getPageInfo()->isHasNextPage();
}
```

Retrieve a single booking:

```
/** @var \Oberon\TravelbaseClient\Model\Booking $booking */
$booking = $client->getBooking($yourBookingId);
```

Retrieve the first 100 updated bookings after a specific date:

```
/** @var \Oberon\TravelbaseClient\Model\Booking[] $bookings */
$bookings = $client->getUpdatedBookings($yourPartnerId, new \DateTime('2022-01-01'));
```

Retrieve a single company:

```
/** @var \Oberon\TravelbaseClient\Model\Company $company */
$company = $client->getCompany($yourCompanyId);
```

Retrieve a single activity:

```
/** @var \Oberon\TravelbaseClient\Model\Activity $activity */
$activity = $client->getActivity($yourActivityId);
```

Retrieve a single ticket:

```
/** @var \Oberon\TravelbaseClient\Model\Ticket $ticket */
$ticket = $client->getTicket($yourTicketId);
```

Retrieve all tickets:

```
$cursor = null;
$hasMoreTickets = true;
/** @var \Oberon\TravelbaseClient\Model\Ticket[] $tickets */
$tickets = [];
while ($hasMoreTickets) {
    $ticketConnection =  $client->getAllTickets($yourPartnerId, 10, $cursor);
    $tickets = array_merge($tickets, $ticketConnection->getNodes());
    $cursor = $ticketConnection->getPageInfo()->getEndCursor();
    $hasMoreTickets = $ticketConnection->getPageInfo()->isHasNextPage();
}
```

---

### Mutations

[](#mutations)

Create or replace allotments through models or array:

```
//Send as a model
$allotment = new \Oberon\TravelbaseClient\Model\Allotment();
$allotment->setAmount(1); // required
$allotment->setDate(new \DateTime('2022-01-02')); // required
$allotmentCollection[] = $allotment;

//send as array
$allotmentCollection[] = [
    'amount' => 1, // required
    'date' => '2022-01-02', // required
];

$client->createOrReplaceAllotments($yourRentalUnitId, $allotmentCollection);
```

Create or replace trip pricings through models or array:

```
//Send as a model
$tripPricing = new \Oberon\TravelbaseClient\Model\TripPricing();
$tripPricing->setDuration(1);
$tripPricing->setDate(new \DateTime('2022-01-01'));
$tripPricing->setPrice(100.50); // required
$tripPricing->setExtraPersonPrice(10); // required
$tripPricing->setMinimumStayPrice(40); // required
$tripPricingCollection[] = $tripPricing;

//send as array
$tripPricingCollection[] = [
    'duration' => 1, // required
    'date' => '2022-01-02', // required
    'price' => 105.00, // required
    'extraPersonPrice' => 10, // required
    'minimumStayPrice' => 40, // required
];

$client->createOrReplaceTripPricings($yourRentalUnitId, $tripPricingCollection);
```

Delete trip pricings:

```
// To delete all trip pricings for a specific rentalunit, only supply the first parameter.
// To delete all trips for a specific datetime supply first and second parameter.
// To delete all trips for a specific duration supply first and third parameter
// To delete a specific trip pricing supply all paramters

$client->deleteTrips($yourRentalUnitId, new \DateTime(), 1);
```

Create or replace date pricings through models or array:

```
//Send as a model
$datePricing = new \Oberon\TravelbaseClient\Model\DatePricing();
$datePricing->setDate(new \DateTime('2022-01-01'));
$datePricing->setNightPrice(100.50); // required
$datePricing->setWeekPrice(25.75); // required
$datePricing->setExtraPersonPrice(10); // required
$datePricing->setBaseStayPrice(20); // required
$datePricing->setMinimumStayPrice(40); // required
$datePricing->setMinimumStayDuration(2); // required
$datePricing->setArrivalAllowed(true); // required
$datePricing->setDepartureAllowed(false); // required
$datePricingCollection[] = $datePricing;

//send as array
$datePricingCollection[] = [
    'date' => '2022-01-02', // required
    'nightPrice' => 105.00, // required
    'weekPrice' => 25.75 // required
    'extraPersonPrice' => 10, // required
    'baseStayPrice' => 20 // required
    'minimumStayPrice' => 40, // required
    'minimumStayDuration' => 2 // required
    'arrivalAllowed' => true // required
    'departureAllowed' => false // required
];

$client->createOrReplaceDatePricings($yourRentalUnitId, $datePricingCollection);
```

Delete date pricings:

```
// Delete pricings starting from a specific datetime
$client->deleteDatePricings($yourRentalUnitId, new \DateTime('2022-01-01'));

// Delete pricings within a specific datetime range
$client->deleteDatePricings($yourRentalUnitId, new \DateTime('2022-01-01 12:00:00'), new \DateTime('2022-01-01 18:00:00'));
```

Create date pricing modifiers:

```
//Send as a model
$datePricingModifier = new \Oberon\TravelbaseClient\Model\DatePricingModifier();
$datePricingModifier->setStartDate(new \DateTime('2022-01-01')); // required
$datePricingModifier->setEndDate(new \DateTime('2022-02-01')); // required
$datePricingModifier->setMinDuration(3); // required
$datePricingModifier->setMaxDuration(7); // required
$datePricingModifier->setValue(10); // required
$datePricingModifier->setValueType('percentage'); // required
$datePricingModifier->setType('deduction'); // required

//send as array
$datePricingModifier = [
    'startDate' => '2022-01-01', // required
    'endDate' => '2022-01-01', // required
    'minDuration' => 3, // required
    'maxDuration' => 7, // required
    'value' => 10 // required
    'valueType' => 'percentage' // required
    'type' => 'deduction' // required
];

$client->createDatePricingModifier($yourRentalUnitId, $datePricingModifier);
```

Edit date pricing modifiers:

```
//Send as a model
$datePricingModifier = new \Oberon\TravelbaseClient\Model\DatePricingModifier();
$datePricingModifier->setStartDate(new \DateTime('2023-01-01')); // required
$datePricingModifier->setEndDate(new \DateTime('2023-02-01')); // required
$datePricingModifier->setMinDuration(2); // required
$datePricingModifier->setMaxDuration(6); // required
$datePricingModifier->setValue(30); // required
$datePricingModifier->setValueType('amount'); // required
$datePricingModifier->setType('addition'); // required

//send as array
$datePricingModifier = [
    'startDate' => '2023-01-01', // required
    'endDate' => '2023-02-01', // required
    'minDuration' => 2, // required
    'maxDuration' => 6, // required
    'value' => 30 // required
    'valueType' => 'amount' // required
    'type' => 'addition' // required
];

$client->editDatePricingModifier($yourDatePricingModifierId, $datePricingModifier);
```

Delete date pricing modifiers:

```
$client->deleteDatePricingModifier($yourDatePricingModifierId);
```

Complete pending booking

```
// To delete all trip pricings for a specific rentalunit, only supply the first parameter.
// To delete all trips for a specific datetime supply first and second parameter.
// To delete all trips for a specific duration supply first and third parameter
// To delete a specific trip pricing supply all paramters

$client->completePendingBooking($yourBookingId, true);
```

Create or replace activity timeslots through models or array:

```
// Send as a model
$timeslot = new \Oberon\TravelbaseClient\Model\TimeslotInput(
    $yourRateGroupId, // required
    new \DateTime('2022-01-01 10:00'), // required
    new \DateTime('2022-01-01 12:00'), // required
    1, // required (must be int)
    'id1' // required (must be string)
);

$timeslotCollection[] = $timeslot;

// send as array
$timeslotCollection[] = [
    'rateGroupId' => $yourRateGroupId,  // required
    'startDateTime' => '2022-01-02 14:00', // required
    'endDateTime' => '2022-01-02 16:00', // required
    'allotment' => 1, // required (must be int)
    'externalId' => 'id1', // required (must me string)
];

$client->createOrReplaceActivityTimeslots($yourActivityId, $timeslotCollection);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 61.4% 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 ~44 days

Recently: every ~105 days

Total

27

Last Release

971d ago

Major Versions

0.6.5 → 1.0.0-rc.12021-05-21

PHP version history (2 changes)0.1.0PHP ^7.1

1.1.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a151375d973541067ec16f2d39124e3c1902cabd5d2875d173926908c3773031?d=identicon)[Oberon](/maintainers/Oberon)

---

Top Contributors

[![ray-001](https://avatars.githubusercontent.com/u/26871054?v=4)](https://github.com/ray-001 "ray-001 (43 commits)")[![Boefjim](https://avatars.githubusercontent.com/u/16748131?v=4)](https://github.com/Boefjim "Boefjim (15 commits)")[![redboer](https://avatars.githubusercontent.com/u/8983472?v=4)](https://github.com/redboer "redboer (8 commits)")[![OberonDevs](https://avatars.githubusercontent.com/u/58808943?v=4)](https://github.com/OberonDevs "OberonDevs (2 commits)")[![jordihendrix](https://avatars.githubusercontent.com/u/5775173?v=4)](https://github.com/jordihendrix "jordihendrix (1 commits)")[![KellydeHaan](https://avatars.githubusercontent.com/u/18033603?v=4)](https://github.com/KellydeHaan "KellydeHaan (1 commits)")

### Embed Badge

![Health badge](/badges/oberonamsterdam-travelbase-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/oberonamsterdam-travelbase-api-client/health.svg)](https://phpackages.com/packages/oberonamsterdam-travelbase-api-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1195.3M72](/packages/web-auth-webauthn-lib)[api-platform/symfony

Symfony API Platform integration

323.2M67](/packages/api-platform-symfony)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[api-platform/serializer

API Platform core Serializer

223.4M31](/packages/api-platform-serializer)

PHPackages © 2026

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