PHPackages                             inshore/bookwhen - 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. inshore/bookwhen

ActiveLibrary[API Development](/categories/api)

inshore/bookwhen
================

Bookwhen API SDK providing plug &amp; play access to the Bookwhen booking platform inside your PHP application.

v0.10.0(2y ago)5872[2 PRs](https://github.com/inshore/bookwhen/pulls)1MITPHPPHP ^8.1 || ^8.2CI failing

Since Jul 27Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/inshore/bookwhen)[ Packagist](https://packagist.org/packages/inshore/bookwhen)[ Docs](https://github.com/inshore/bookwhen)[ RSS](/packages/inshore-bookwhen/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (10)Dependencies (10)Versions (109)Used By (1)

inShore.je - Bookwhen PHP API SDK
=================================

[](#inshoreje---bookwhen-php-api-sdk)

[![Latest Version](https://camo.githubusercontent.com/94ebdfe52a75d2962783f39c172b243f93f2ee66fb88ab3b100ae4c9af265bb6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696e73686f72652f626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/inshore/bookwhen/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Coverage Status](https://camo.githubusercontent.com/2b9827a27e87cff562f274df0154781c9525910f9e355c037f7946a92b38a380/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696e73686f72652f626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/inshore/bookwhen/code-structure)[![Quality Score](https://camo.githubusercontent.com/d719f3e302b3fbcfc35ebcceff992c9382c8f02b7b4e9d4b3d8bab0797b0c518/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e73686f72652f626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/inshore/bookwhen)[![Total Downloads](https://camo.githubusercontent.com/f914118f7c581d4fdda2d959256438cdb3b42f8b6bff7d066a9a04bfb0650714/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e73686f72652f626f6f6b7768656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inshore/bookwhen)

SDK for the [Bookwhen API](https://api.bookwhen.com/v2). Requires PHP 8.3+.

- [Bookwhen](https://www.bookwhen.com) · [API v2](https://api.bookwhen.com/v2)
- **[Changelog](CHANGELOG.md)** — upgrade notes and breaking changes (e.g. v1.0.0)

Install
-------

[](#install)

### Requirements

[](#requirements)

PHP 8.3 and later.

**Composer**

```
$ composer require inshore/bookwhen
```

Usage
-----

[](#usage)

Simply expose your Bookwhen API key as the environment property

INSHORE\_BOOKWHEN\_API\_KEY

via .env or how you prefer.

```
$bookwhen = new Bookwhen();
```

### Attachments

[](#attachments)

implements

Attachments

```
// Fetch attachments accessible by the API token.

$attachments = $bookwhen->attachments();
```

**Filters**

The filter parameters can be passed in as function parameters.

**title** - Filter on the file title text.

**fileName** - Filter on the file name.

**fileType** - Filter on the file type.

```
// Fetch attachments accessible by the API token.

$attachments = $bookwhen->attachments(fileName: 'CV'));

$attachments = $bookwhen->attachments(fileType: 'pdf'));

$attachments = $bookwhen->attachments(title: 'Title to filter by'));

$attachments = $bookwhen->attachments(fileName: 'CV', fileType: 'pdf', title: 'Title to filter by'));
```

Attachment

[https://api.bookwhen.com/v2#tag/Attachment/paths/1attachments1%7Battachment\_id%7D/g](https://api.bookwhen.com/v2#tag/Attachment/paths/~1attachments~1%7Battachment_id%7D/get)

```
// Returns the attachment for the provided attachment ID.

$attachment = $bookwhen->attachment('ev-smij-20200530100000' );

```

\###Class Passes

implements

ClassPasses

[https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class\_passes/get](https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class_passes/get)

```
// Fetch class passes accessible by the API token.

$classPasses = $bookwhen->classPasses();
```

**Filters**

The filter parameters can be passed in as function parameters

**title** - Filter on the title text of the pass.

**detail** - Filter on the details text.

**usageType** - Filter on the type of the pass: personal or any.

**cost** - Filter on the cost with an exact value or use a comparison operator. e.g. filter\[cost\]\[gte\]=2000

**gt** - greater than

**gte** - greater than or equal

**lt** - less than

**lte** - less than or equal

**eq** - equal to

**usageAllowance** - Filter on pass usage allowance. This also accepts a comparison operator like cost.

**useRestrictedForDays** - Filter on pass days restriction. This also accepts a comparison operator like cost.

```
// Fetch class passes accessible by the API token.

$classPasses = $bookwhen->classPasses();

$classPasses = $bookwhen->classPasses(title: 'Title to filter by'));
```

ClassPass

[https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class\_passes~1%7Bclass\_pass\_id%7D/get](https://api.bookwhen.com/v2#tag/ClassPass/paths/~1class_passes~1%7Bclass_pass_id%7D/get)

```
// Returns the class pass for the provided class pass ID.

$classPass = $bookwhen->classPass('ev-smij-20200530100000');
```

### Events

[](#events)

Events

```
// Returns the event for the provided event ID.

$event = $bookwhen->events();
```

**Filters**

**calendar** - Restrict to events on the given calendars (schedule pages).

**entry** - Restrict to given entries.

**location** - Array of location slugs to include.

**tag** - Array of tag words to include.

**title** - Array of entry titles to search for.

**detail** - Array of entry details to search for.

**from** - Inclusive time to fetch events from in format YYYYMMDD or YYYYMMDDHHMISS. Defaults to today.

**to** - Non-inclusive time to fetch events until in format YYYYMMDD or YYYYMMDDHHMISS

**compact** - Boolean: Combine events in a course into a single virtual event.

**Includes**

By default the event will NOT have its attachments, location and tickets populated.

To retrieve an event with the included relationships, simply pass boolean true for the relationship that is required.

includeAttachments includeLocation includeTickets includeTickets.class\_passes includeTickets.events

for example to retrieve the event with its location and tickets.

```
// Returns the event for the provided event ID.

$event = $bookwhen->events(title: ['Title to filter by']);
```

Event

[https://api.bookwhen.com/v2#tag/Event/paths/1events1%7Bevent\_id%7D/get](https://api.bookwhen.com/v2#tag/Event/paths/~1events~1%7Bevent_id%7D/get)

```
// Returns the event for the provided event ID.

$event = $bookwhen->event('ev-smij-20200530100000');
```

```
// Returns the event for the provided event ID.

$event = $bookwhen->event(eventId: 'ev-smij-20200530100000', includeLocation: true, includeTickets: true);
```

\###Events###

```
// Fetch events accessible by the API token.

$events = $bookwhen->events();
```

**Filters**

The event list can be filtered as per the api documentation

**Includes**

By default the event will NOT have its attachments, location and tickets populated.

To retrieve an event withg the included relationships, simply pass boolean true for the relationship that is required.

**includeAttachments****includeLocation****includeTickets.class\_passes****includeTickets.events**

for example to retrieve the event with its location and tickets.

```
// Fetch events accessible by the API token.

$events = $bookwhen->events(includeLocation: true, includeTickets: true);
```

### Locations

[](#locations)

Implements

Locations

```
// Fetch events accessible by the API token.

$locations = $bookwhen->locations();

// Returns the location for the provided location ID.
```

**Filters**

**addressText** - Restrict to locations containing the address text filter.

**additionalInfo** - Filter by the text contained in the additional info.

```
// Fetch events accessible by the API token.

$locations = $bookwhen->locations(addressText: 'Remote'));

// Returns the location for the provided location ID.
```

Location

[https://api.bookwhen.com/v2#tag/Location/paths/1locations1%7Blocation\_id%7D/get](https://api.bookwhen.com/v2#tag/Location/paths/~1locations~1%7Blocation_id%7D/get)

```
// Returns the location for the provided location ID.

$location = $bookwhen->location('ev-smij-20200530100000');
```

### Tickets

[](#tickets)

Implements

Tickets

```
// Fetch tickets for the given event.

$eventId = 'ev-smij-20200530100000';

$client->tickets($eventId);
```

**Includes**

By default the tickets will NOT have its attachments, evetns and location populated.

To retrieve an event withg the included relationships, simply pass boolean true for the relationship that is required.

**includeAttachments****includeLocation****includeTickets.class\_passes****includeTickets.events**

```
// Fetch tickets for the given event.

$eventId = 'ev-smij-20200530100000';

$client->tickets($eventId, includeAttachments: true);
```

Ticket

[https://api.bookwhen.com/v2#tag/Ticket/paths/1tickets1%7Bticket\_id%7D/get](https://api.bookwhen.com/v2#tag/Ticket/paths/~1tickets~1%7Bticket_id%7D/get)

```
// Retrieve a single ticket.

$ticketId = 'ti-sboe-20200320100000-tk1m';

$client->ticket($ticketId);
```

**Includes**

By default the tickets will NOT have its attachments, evetns and location populated.

To retrieve an event withg the included relationships, simply pass boolean true for the relationship that is required.

**includeAttachments****includeLocation****includeTickets.class\_passes****includeTickets.events**

```
// Retrieve a single ticket.

$client->ticket('ti-sboe-20200320100000-tk1m', includeEventsAttachments: true);
```

Logging
-------

[](#logging)

Full syslog level logging is available and can be enabled by passing a level in when instatiating the Client. As illustrated in RFC 5424 which describes the syslog protocol, the following levels of intensity are applied.

DEBUG: Detailed debugging information. INFO: Handles normal events. Example: SQL logs NOTICE: Handles normal events, but with more important events WARNING: Warning status, where you should take an action before it will become an error. ERROR: Error status, where something is wrong and needs your immediate action CRITICAL: Critical status. Example: System component is not available ALERT: Immediate action should be exercised. This should trigger some alerts and wake you up during night time. EMERGENCY: It is used when the system is unusable.

$bookwhen = new Bookwhen()-&gt;debug('Debug');

Testing
-------

[](#testing)

WIP

```
$ composer phpunit
```

Contributing
------------

[](#contributing)

Please see  for details.

Support
-------

[](#support)

If you require assistance with this package or implementing in your own project or business...

&lt;script type="text/javascript" src="" data-name="bmc-button" data-slug="danielmullin" data-color="#FFDD00" data-emoji="" data-font="Cookie" data-text="Buy me a coffee" data-outline-color="#000000" data-font-color="#000000" data-coffee-color="#ffffff" &gt;&lt;/script&gt;

Credits
-------

[](#credits)

- Daniel Mullin
- Brandon Lubbehusen

This package was heavily influenced by Nuno Maduro and the  package.

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance55

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 66.3% 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 ~22 days

Recently: every ~4 days

Total

48

Last Release

1092d ago

PHP version history (4 changes)v0.0.1PHP &gt;=7.2

0.2.2PHP &gt;=7.3

0.5.0PHP &gt;=8.1

0.9.2PHP ^8.1 || ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/202db53ddb1a96b03c7e616979d2471db2ccee110afd161f0cd7115336a975c4?d=identicon)[inshore](/maintainers/inshore)

---

Top Contributors

[![danielmullin](https://avatars.githubusercontent.com/u/1116873?v=4)](https://github.com/danielmullin "danielmullin (350 commits)")[![inshore](https://avatars.githubusercontent.com/u/68851391?v=4)](https://github.com/inshore "inshore (165 commits)")[![blubbehusen](https://avatars.githubusercontent.com/u/55593324?v=4)](https://github.com/blubbehusen "blubbehusen (13 commits)")

---

Tags

apibookwhenpackagistphpsdksdk-phpapipackageinshorebookwhen

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/inshore-bookwhen/health.svg)

```
[![Health](https://phpackages.com/badges/inshore-bookwhen/health.svg)](https://phpackages.com/packages/inshore-bookwhen)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35636.1k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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