PHPackages                             seatsio/seatsio-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. seatsio/seatsio-php

ActiveLibrary[API Development](/categories/api)

seatsio/seatsio-php
===================

A PHP client for the seats.io API

v98.5.0(3mo ago)17724.2k↓14.1%10MITPHPPHP &gt;=8.3.0CI passing

Since Dec 22Pushed 2mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (191)Used By (0)

seatsio-php, the official Seats.io PHP SDK
==========================================

[](#seatsio-php-the-official-seatsio-php-sdk)

[![Build](https://github.com/seatsio/seatsio-php/workflows/Build/badge.svg)](https://github.com/seatsio/seatsio-php/actions/workflows/build.yml)[![Latest Stable Version](https://camo.githubusercontent.com/b7f1db0f22b7afd68037ac6206ce259349bf0b10dc541826f55360a65979e08a/68747470733a2f2f706f7365722e707567782e6f72672f7365617473696f2f7365617473696f2d7068702f762f737461626c65)](https://packagist.org/packages/seatsio/seatsio-php)

This is the official PHP client library for the [Seats.io V2 REST API](https://docs.seats.io/docs/api-overview).

Installing seatsio-php
----------------------

[](#installing-seatsio-php)

The recommended way to install seatsio-php is through [Composer](http://getcomposer.org).

```
composer require seatsio/seatsio-php
```

The minimum required PHP version is 8.1.

Versioning
----------

[](#versioning)

seatsio-php follows semver since v62.3.0.

Usage
-----

[](#usage)

### General instructions

[](#general-instructions)

To use this library, you'll need to create a `SeatsioClient`:

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
...
```

You can find your *workspace secret key* in the [settings section of the workspace](https://app.seats.io/workspace-settings).

The region should correspond to the region of your account:

- `Region::EU()`: Europe
- `Region::NA()`: North-America
- `Region::SA()`: South-America
- `Region::OC()`: Oceania

If you're unsure about your region, have a look at your [company settings page](https://app.seats.io/company-settings).

### Creating a chart and an event

[](#creating-a-chart-and-an-event)

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$chart = $seatsio->charts->create();
$event = $seatsio->events->create($chart->key);
echo 'Created event with key ' . $event->key;
```

### Booking objects

[](#booking-objects)

Changes the object status to ‘booked’. Booked seats are not selectable on a rendered chart.

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->events->book(, ["A-1", "A-2"]);
```

### Booking objects that have been held

[](#booking-objects-that-have-been-held)

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->events->book(, ["A-1", "A-2"], );
```

### Booking general admission areas

[](#booking-general-admission-areas)

Either

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->events->book(, ["GA1", "GA1", "GA1"]);
```

Or

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->events->book(, [["objectId" => "GA1", "quantity" => 3]]);
```

### Releasing objects

[](#releasing-objects)

Changes the object status to ‘free’. Free seats are selectable on a rendered chart.

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->events->release(, ["A-1", "A-2"]);
```

### Changing object status

[](#changing-object-status)

Changes the object status to a custom status of your choice. If you need more statuses than just booked and free, you can use this to change the status of a seat, table or booth to your own custom status.

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->events->changeObjectStatus(, ["A-1", "A-2"], "unavailable");
```

### Retrieving object category and status (and other information)

[](#retrieving-object-category-and-status-and-other-information)

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$objectInfos = $seatsio->events->retrieveObjectInfos($event->key, ["A-1", "A-2"]);

print_r($objectInfos["A-1"]->categoryKey)
print_r($objectInfos["A-1"]->categoryLabel)
print_r($objectInfos["A-1"]->status)

print_r($objectInfos["A-2"]->categoryKey)
print_r($objectInfos["A-2"]->categoryLabel)
print_r($objectInfos["A-2"]->status)
```

### Event reports

[](#event-reports)

Want to know which seats of an event are booked, and which ones are free? That’s where reporting comes in handy.

The report types you can choose from are:

- byStatus
- byCategoryLabel
- byCategoryKey
- byLabel
- byOrderId

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->eventReports->byStatus(, );
```

### Listing all charts

[](#listing-all-charts)

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), );

$charts = $seatsio->charts->listAll();
foreach($charts as $chart) {
    echo 'Chart ' . $chart->key;
}
```

Note: `listAll()` returns an iterator, which under the hood calls the seats.io API to fetch charts page by page. So multiple API calls may be done underneath to fetch all charts.

### Listing charts page by page

[](#listing-charts-page-by-page)

E.g. to show charts in a paginated list on a dashboard.

Each page contains an `items` array of charts, and `nextPageStartsAfter` and `previousPageEndsBefore` properties. Those properties are the chart IDs after which the next page starts or the previous page ends.

```
// ... user initially opens the screen ...

$firstPage = $seatsio->charts->listFirstPage();
foreach($firstPage->items as $chart) {
    echo 'Chart ' . $chart->key;
}
```

```
// ... user clicks on 'next page' button ...

$nextPage = $seatsio->charts->listPageAfter($firstPage->nextPageStartsAfter);
foreach($nextPage->items as $chart) {
    echo 'Chart ' . $chart->key;
}
```

```
// ... user clicks on 'previous page' button ...

$previousPage = $seatsio->charts->listPageBefore($nextPage->previousPageEndsBefore);
foreach($page->items as $chart) {
    echo 'Chart ' . $chart->key;
}
```

### Creating a workspace

[](#creating-a-workspace)

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

// company admin key can be found on https://app.seats.io/company-settings
$seatsio = new SeatsioClient(Region::EU(), );
$seatsio->workspaces->create("a workspace");
```

### Creating a chart and an event with the company admin key

[](#creating-a-chart-and-an-event-with-the-company-admin-key)

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

// company admin key can be found on https://app.seats.io/company-settings
// workspace public key can be found on https://app.seats.io/workspace-settings
$seatsio = new SeatsioClient(Region::EU(), , );
$chart = $seatsio->charts->create();
$event = $seatsio->events->create($chart->key);
echo 'Created event with key ' . $event->key;
```

Error handling
--------------

[](#error-handling)

When an API call results in a 4xx or 5xx error (e.g. when a chart could not be found), a SeatsioException is thrown.

This exception contains a message string describing what went wrong, and also two other properties:

- `messages`: an array of error messages that the server returned. In most cases, this array will contain only one element.
- `requestId`: the identifier of the request you made. Please mention this to us when you have questions, as it will make debugging easier.

Rate limiting - exponential backoff
-----------------------------------

[](#rate-limiting---exponential-backoff)

This library supports [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff).

When you send too many concurrent requests, the server returns an error `429 - Too Many Requests`. The client reacts to this by waiting for a while, and then retrying the request. If the request still fails with an error `429`, it waits a little longer, and try again. By default this happens 5 times, before giving up (after approximately 15 seconds).

We throw a `RateLimitExceededException` (which is a subclass of `SeatsioException`) when exponential backoff eventually fails.

To change the maximum number of retries, create the `SeatsioClient` as follows:

```
require 'vendor/autoload.php';

use Seatsio\Region;
use Seatsio\SeatsioClient;

$seatsio = new SeatsioClient(Region::EU(), , null, 3);
```

Passing in 0 disables exponential backoff completely. In that case, the client will never retry a failed request.

Upgrading
---------

[](#upgrading)

### v93 -&gt; v94

[](#v93---v94)

- An event's chart key can no longer be changed

### v92 -&gt; v93

[](#v92---v93)

- Removed StatusChangeRequest constructor. Use setters instead.

### v91 -&gt; v92

[](#v91---v92)

- No breaking changes.

### v90 -&gt; v91

[](#v90---v91)

- Only PHP 8.1 and newer are supported (older versions have reached end of life).

### v89 -&gt; v90

[](#v89---v90)

- `$client->usageReports->summaryForAllMonths()` now returns a `UsageSummaryForAllMonths` object

### v88 -&gt; v89

[](#v88---v89)

- if you're using `$seatsioClient->subaccounts`, you should switch to `$seatsioClient->workspaces`

### v87 -&gt; v88

[](#v87---v88)

- social distancing got removed. There is no alternative for those API calls.

### v86 -&gt; v87

[](#v86---v87)

- `$seatsioClient->events->create()` now takes a `CreateEventParams` object
- `$seatsioClient->events->update()` now takes an `UpdateEventParams` object

### v85 -&gt; v86

[](#v85---v86)

- `$seatsioClient->events->channels->replace()` now takes a normal array instead of an associative array. If you want to just replace the channel metadata but keep the objects (like replace() used to do), you have to explicitly pass in the objects.
- Removed `$seatsioClient->events->channels->setObjects()` in favor of `$seatsioClient->events->channels->replace()`

### v84 -&gt; v85

[](#v84---v85)

- Usage report format changed

### v83 -&gt; v84

[](#v83---v84)

- Fields returned by usage reports have changed

### v82 -&gt; v83

[](#v82---v83)

- signature of `$seatsioClient->events->markAsForSale()` and `$seatsioClient->events->markAsNotForSale()` changed. Added new parameter `$areaPlaces`, between `$objects` and `$categories`.
- added `$seatsioClient->charts->listCategories(string $chartKey)` to retrieve an array of `Category` instances for a specified chart.

### v81 -&gt; v82

[](#v81---v82)

- removed fields from usage report by month: `$numFirstBookingsOrSelections`, `$numGASelectionsWithoutBooking`, `$numNonGASelectionsWithoutBooking`. Instead of `$numFirstBookingsOrSelections`, use `$numUsedObjects`.

### v80 -&gt; v81

[](#v80---v81)

- oldest supported PHP version is now PHP 7.4

### v79 -&gt; v80

[](#v79---v80)

- `$seatsioClient->seasons->createEvents()` returns an array of Event objects now, instead of the Season object

### v76 -&gt; v77

[](#v76---v77)

- Renamed `$seatsioClient->events->retrieveObjectStatus()` to `$seatsioClient->events->retrieveObjectInfo()`
- Renamed `\Seatsio\Reports\Events\EventReportItem` to `\Seatsio\Events\EventObjectInfo`
- Renamed `\Seatsio\Events\ObjectStatus` to `\Seatsio\Events\EventObjectInfo`
- Renamed `\Seatsio\Reports\Charts\ChartReportItem` to `\Seatsio\Charts\ChartObjectInfo`
- Renamed `ObjectStatus->quantity` to `EventObjectInfo->numBooked`

### v72 -&gt; v73

[](#v72---v73)

The `SeatsioClient` now takes a region as first parameter. This is the region of your account.

### v69 -&gt; v70

[](#v69---v70)

Switched to builder pattern for creating social distancing rulesets. Removed constructor of `SocialDistancingRuleset` class.

Rule-based rulesets:

```
$ruleset = SocialDistancingRuleset::ruleBased("My first ruleset")
    ->setIndex(0)
    ->setNumberOfDisabledSeatsToTheSides(1)
    ->setDisableSeatsInFrontAndBehind(true)
    ->setDisableDiagonalSeatsInFrontAndBehind(true)
    ->setNumberOfDisabledAisleSeats(2)
    ->setMaxGroupSize(1)
    ->setMaxOccupancyAbsolute(10)
    ->setOneGroupPerTable(true)
    ->setDisabledSeats(["A-1"])
    ->setEnabledSeats(["A-2"])
    ->build();
```

Fixed rulesets:

```
$ruleset = SocialDistancingRuleset::fixed("My second ruleset")
    ->setIndex(1)
    ->setDisabledSeats(["A-1"])
    ->build();
```

### v68 -&gt; v69

[](#v68---v69)

Replaced `SeatsioException->$messages` by `SeatsioException->$errors`. An error contains both a `$code` and a `$message`.

To implement logic based on the exception type, use the techincal `$code` instead of the human-readable `$message`.

### v67 -&gt; v68

[](#v67---v68)

#### Retrieving an event

[](#retrieving-an-event)

The `Event` class does not have `$bookWholeTables` and `$tableBookingModes` properties anymore. Those are replaced by a single `$tableBookingConfig` property:

- `$bookWholeTables` equal to `true` corresponds to a `$tableBookingConfig` with `$mode` equal to `ALL_BY_TABLE`
- `$bookWholeTables` equal to `false` corresponds to a `$tableBookingConfig` with `$mode` either `ALL_BY_SEAT`, `INHERIT` or `CUSTOM`
- The list of tables in `$tableBookingModes` is now `$tableBookingConfig->tables` (but only if `$mode` equals `CUSTOM`)

#### Creating an event

[](#creating-an-event)

When creating an event, you now pass in an (optional) `$tableBookingConfig` instead of `$bookWholeTablesOrTableBookingModes`:

```
$seatsioClient->events->create(
  "4250fffc-e41f-c7cb-986a-2c5e728b8c28", null,
  TableBookingConfig::custom(["T1" => "BY_TABLE", "T2" => "BY_SEAT"])
);
```

#### Creating multiple events

[](#creating-multiple-events)

When creating multiple events, you now pass in an (optional) `$tableBookingConfig` instead of `$bookWholeTables` and `$tableBookingModes`:

```
$params = [
    CreateEventParams::create()
    ->setEventKey("event34")
    ->setTableBookingConfig(TableBookingConfig::allByTable(),
    CreateEventParams::create()
    ->setEventKey("event35")
    ->setTableBookingConfig(TableBookingConfig::allBySeat()
];

$events = $seatsioClient->events->createMultiple("4250fffc-e41f-c7cb-986a-2c5e728b8c28", $params);
```

### v66 -&gt; v67

[](#v66---v67)

No migration needed

### v65 -&gt; v66

[](#v65---v66)

You now need to be on PHP 7.1 or newer to use this library.

### v64 -&gt; v65

[](#v64---v65)

Added boolean parameter `$oneGroupPerTable` to the constructor of `SocialDistancingRuleset`. Pass in `false` to not force only one group to sit at a table.

Also added this parameter to `SocialDistancingRuleset::ruleBased()`

### v63 -&gt; v64

[](#v63---v64)

Added `$maxOccupancyAbsolute`, `$maxOccupancyPercentage` and `$fixedGroupLayout` to the constructor of `SocialDistancingRuleset`.

To keep the default behaviour, pass in the following:

- `$maxOccupancyAbsolute = 0`
- `$maxOccupancyPercentage = 0`
- `$fixedGroupLayout = false`

### v62 -&gt; v63

[](#v62---v63)

`events->bookBestAvailable()`, `events->holdBestAvailable()` and `events->changeBestAvailableObjectStatus()` take optional `$extraData` and `$ticketTypes` parameters. Pass in `null` to keep the default behaviour.

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance83

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity97

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 73% 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 ~16 days

Recently: every ~9 days

Total

187

Last Release

101d ago

Major Versions

v93.1.0 → v94.0.02024-11-12

v94.5.0 → v95.0.02025-02-12

v95.1.0 → v96.0.02025-03-07

v96.10.0 → v97.0.02025-11-10

v97.0.0 → v98.0.02025-12-31

PHP version history (6 changes)1PHP &gt;=5.5.0

v66.0.0PHP &gt;=7.1.0

v75.0.0PHP &gt;=7.2.0

v81.0.0PHP &gt;=7.4.0

v91.0.0PHP &gt;=8.1.0

v98.0.0PHP &gt;=8.3.0

### Community

Maintainers

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

---

Top Contributors

[![mroloux](https://avatars.githubusercontent.com/u/1332102?v=4)](https://github.com/mroloux "mroloux (384 commits)")[![bverbeken](https://avatars.githubusercontent.com/u/686092?v=4)](https://github.com/bverbeken "bverbeken (62 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (39 commits)")[![namfal](https://avatars.githubusercontent.com/u/10213761?v=4)](https://github.com/namfal "namfal (21 commits)")[![schaloner](https://avatars.githubusercontent.com/u/456058?v=4)](https://github.com/schaloner "schaloner (14 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![sdivelbiss](https://avatars.githubusercontent.com/u/11833769?v=4)](https://github.com/sdivelbiss "sdivelbiss (1 commits)")[![mortendevold](https://avatars.githubusercontent.com/u/2213243?v=4)](https://github.com/mortendevold "mortendevold (1 commits)")[![nahue](https://avatars.githubusercontent.com/u/96837?v=4)](https://github.com/nahue "nahue (1 commits)")[![raphaelPONS](https://avatars.githubusercontent.com/u/710527?v=4)](https://github.com/raphaelPONS "raphaelPONS (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seatsio-seatsio-php/health.svg)

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

###  Alternatives

[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[nkl-kst/the-sports-db

PHP library to get sports data from TheSportsDB (https://www.thesportsdb.com)

271.2k](/packages/nkl-kst-the-sports-db)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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