SeatLayer PHP SDK: seat booking, reserved seating and season ticket API
composer require seatlayer/seatlayer-php gives a Laravel, Symfony or plain PHP app on PHP 8.1 or newer SeatLayer's
official API client for reserved seating. Read a buyer's held seats with their real prices, book
them under your order id, sell at the box office and run season tickets and renewals, without adding
a single Composer dependency.
What SeatLayer is
SeatLayer is reserved-seat ticketing and seating software: organizers sell with hosted checkout,
a box office, door check-in and season tickets, and platforms add the same seat maps, with 3D
seat views, through the SeatLayer SDK and API. One chart drives the 2D map, the 3D venue and the
view from each seat (3D for venues up to 60,000 seats; the 2D map benchmarked at 200,000 seats).
Website · For developers ·
Season tickets · Pricing ·
Live demo
seatlayer/seatlayer-php on Packagist ·
PHP server SDK guide ·
SeatLayer developer platform ·
SeatLayer JavaScript seat map SDK ·
Server API reference
Server-side only. This package authenticates with your secret key. Never expose it to a
browser or anything a ticket buyer can reach. Browser surfaces get short-lived, origin-bound
tokens that you mint here.
How it works: the buyer picks and holds seats in your website or app with your public key. Your server then reads the hold, takes the payment through your own provider, and books the seats with this SDK and your secret key.
Start here: Quickstart · Holds and checkout · PHP server SDK guide · SDK catalog · Pricing: 100 sold seats free every month, then 10¢ down to 5¢ per sold seat. No subscription, and purchased credits never expire. Test mode is free.
Install the PHP seat booking SDK
composer require seatlayer/seatlayer-php
Requires PHP 8.1 or newer with ext-curl, ext-json and ext-hash. No Composer dependencies.
Quick start
use SeatLayer\SeatLayer;
$seatlayer = new SeatLayer(getenv('SEATLAYER_SECRET_KEY'));
// 1. Provision a venue for a new organiser from a public template.
// Replace this placeholder with a template id from your catalog.
$chart = $seatlayer->templates->instantiateTemplate('your-published-template')['meta'];
$seatlayer->charts->publish($chart['id']);
// 2. Create an event on it.
$event = $seatlayer->events->create(
$chart['id'], name: 'Spring Gala',
currency: 'EUR', // omit to inherit the workspace currency
region: \SeatLayer\EventHostingRegion::WESTERN_EUROPE // India: ASIA_PACIFIC
)['meta'];
// 3. Sell four seats over the phone.
$held = $seatlayer->inventory->holdBestAvailable($event['key'], qty: 4);
// … take payment against $held['items'], which carry authoritative prices …
$seatlayer->inventory->book($event['key'], holdId: $held['holdId'], bookingRef: 'order-8842');
Event hosting region
Pass the named region argument to events->create() based on the event venue, not your API
server or office. It controls the initial placement of the Event's live inventory;
an existing Event cannot be moved later. Omit it to inherit the workspace default (western-europe for new accounts).
Pass defaultRegion to workspaces->create() or in the fields sent to
workspaces->update(); changing it affects only future Events.
western-europe, eastern-europe, north-america-east, north-america-west, south-america
asia-pacific, northeast-asia, southeast-asia, oceania, africa, middle-east
The hint is best effort, not a data-residency guarantee. See the
full Event region guide.
Season tickets (Fixed Renewable Seasons)
$seatlayer->seasons has all 90 season operations: seasons and their packages, dates and
package prices (per price type, set with priceTypeKey: adult, child, concession,
senior or student), sales windows, checkout tests, buyer sessions and booking, holder
imports and the holder list, season orders, renewals (offers, quotes, intents, checkouts and
hosted renewal links), date changes and cancellations, season seats, bulk refunds with their
jobs, sales and seat reports, CSV exports, audit and support export. The bulk refund of a
cancelled date is refundSeasonPerformance, the release of every lapsed renewal offer's seats
is releaseSeasonLapsedOffers, and their jobs are read with listSeasonBulkJobs and
retrieveSeasonBulkJob.
Before you open sales, run one test hold, booking and cancellation with their
webhooks, then call validateSeasonBuyerRehearsal($seasonKey). It finds those
test records itself, so it takes no body. With your own checkout, until a test like this or a checkout test has passed, opening sales answers with a checkout_test_missing warning. A
season hold lists each date's seat, category and quantity but no price: when you
run your own checkout, you set the package price and take the payment, and you
issue the tickets.
$checked = $seatlayer->seasons->validateSeason([
'sourcePerformanceGroupKeys' => ['pg_subscription_run'],
]);
$draft = $seatlayer->seasons->createSeason([
'name' => '2027 subscription',
'sourcePerformanceGroupKeys' => ['pg_subscription_run'],
], 'season-create-2027')['season'];
$activation = $seatlayer->seasons->activateSeason($draft['key'], $draft['revision']);
A 202 answer means the work was accepted and is still running: keep the returned
operation id and poll retrieveSeasonLifecycle() until it finishes. Bookings,
cancellations and renewal commits are sent once and never retried by the SDK, so
give each one your own stable id; sending the same id again is safe. A buyer session is sent once too, and repeating it is not safe: if its answer is lost, revoke
what was created and create one new session.
Above 100 contracts, createSeasonRenewalOffers() answers 202 with a renewal_run job
and its batchId instead of offers; above 100 holders, createSeasonHolderImportFromSeason()
answers 202 with a holder_import job. Follow either with retrieveSeasonBulkJob().
listSeasonRenewalOffers() and retrieveSeasonHostedRenewals() read one page at a time: pass
the answer's nextCursor back as $cursor until it is null.
exportSeasonHoldersCsv() and exportSeasonOrdersCsv() return the CSV text as a string,
not decoded JSON. deleteSeasonPlan() returns nothing (the API answers 204).
When SeatLayer takes the season's payments, renew a holder with no hosted page: read the price,
start a checkout, and send the holder to payment.url. For a renewal taken by phone or at the
box office, createSeasonRenewalIntent() records the holder's intent before you commit the
offer. A decline can carry the holder's reason.
$quote = $seatlayer->seasons->retrieveSeasonRenewalQuote($seasonKey, $offerId);
if ($quote['problem'] === null) {
$started = $seatlayer->seasons->createSeasonRenewalCheckout(
$seasonKey,
$offerId,
['returnUrl' => 'https://tickets.yourclub.example/renewed'],
"renew-{$offerId}",
);
header('Location: ' . $started['payment']['url']);
}
$seatlayer->holders->declineHolderRenewalOffer('holder_123', $offerId, 'Moving away');
Season seats
Season seats are the seats a season sets aside on every date before its sales open. A season
buyer's hold then doesn't have to ask each date, and single-ticket buyers see those seats as
unavailable. They are off for every season until you send 'inventoryMode' => 'block' to
createSeason() or updateSeason(). The season needs one package, and its sales must not have
opened.
$seatlayer->seasons->updateSeason($seasonKey, ['expectedRevision' => $revision, 'inventoryMode' => 'block']);
$job = $seatlayer->seasons->setAsideSeasonBlock($seasonKey, [
'expectedRevision' => $revision,
'keepForSingleTickets' => ['sectionIds' => ['sec_family']],
])['job'];
while (in_array($job['state'], ['planning', 'running'], true)) {
sleep(2);
$job = $seatlayer->seasons->retrieveSeasonBulkJob($seasonKey, $job['jobId'])['job'];
}
$block = $seatlayer->seasons->retrieveSeasonBlock($seasonKey)['block'];
// Release unsold season seats to single sale. Leave out 'at' to release now.
$seatlayer->seasons->releaseSeasonBlock($seasonKey, [
'expectedRevision' => $block['revision'],
'scope' => ['all' => true],
'at' => '2026-12-01T09:00:00Z',
]);
- On an active season, block mode turns on by itself once every date has the seats, and
season.block.ready is sent once. On a draft, publishSeason() turns it on.
season.block.released is sent once a release has run.
- In block mode, a date cancel (
createSeasonAmendment(), kind cancel) or
markSeasonPerformancePast() first takes the date off every season seat. Until that finishes the
answer is a 202: check it with SeatLayer\Resources\Seasons::isDateLeavePending($answer), then
send the same request again after Retry-After.
- Refusals come through
SeatLayerException with errorCode, and nothing changes. For example
409 season_block_packages (more than one package), 409 season_block_on_sale (sales have
opened), or 409 block_not_ready from openSeasonSales() before block mode is on.
- A partner's seat on a date (one a sales channel sells there) stays out of the block. It is
listed in
$block['notFreeOnEveryDate'] with reason channel.
The Season seats docs list every refusal.
Orders, holders, event sales, and event series
$seatlayer->orders lists orders across events and seasons, reads one order and its
tickets, and lists, refunds, cancels, or resends one event's orders.
exportEventOrdersCsv() returns the CSV text.
$seatlayer->holders reads and updates season ticket holders, finds customers with
listCustomers(), signs a holder out, lists their seasons and tickets, and sends,
cancels, or accepts ticket transfers.
$seatlayer->events also holds each event's sales settings: buyer checkout, payment
gateway, sales readiness, preflight and transitions, booking fee, and discount codes.
$seatlayer->eventSeries plans a series of dated events from a schedule, adds dates,
and changes every upcoming date at once.
$paid = $seatlayer->orders->listEventOrders($eventKey, status: 'paid');
$seatlayer->orders->refundEventOrder(
$eventKey,
$orderId,
amountMinor: 500,
idempotencyKey: "refund-{$refundId}",
);
$csv = $seatlayer->orders->exportEventOrdersCsv($eventKey); // CSV text
Test vs live
Keys carry their own mode. sk_test_… keys can only touch test-mode events and sk_live_… only
live ones; crossing them returns 403 mode_mismatch, surfaced as AuthException with
isModeMismatch().
$seatlayer = new SeatLayer(getenv('SEATLAYER_SECRET_KEY'));
if (getenv('APP_ENV') === 'production' && $seatlayer->mode !== 'live') {
throw new RuntimeException('Refusing to boot production against test-mode seating data.');
}
Book reserved seats from PHP
Buyer picks seats in the browser. Your frontend holds them; your backend confirms the price and
books. Never price from what the browser sent you: retrieveHold is authoritative.
$hold = $seatlayer->inventory->retrieveHold($eventKey, $holdId);
$currencies = array_values(array_unique(array_column($hold['items'], 'currency')));
if (count($currencies) !== 1) {
throw new RuntimeException('A hold must use one currency.');
}
$currency = $currencies[0];
$total = array_sum(array_map(
static fn (array $item) => $item['unitPrice'] * ($item['quantity'] ?? 1),
$hold['items'],
));
// … charge $total in $currency …
$seatlayer->inventory->book($eventKey, holdId: $holdId, bookingRef: $charge->id);
Your backend picks the seats. Phone orders, box office, comps.
// Payment already taken: book outright, so nothing is stranded if a second call fails.
$seatlayer->inventory->bookBestAvailable($eventKey, qty: 2, bookingRef: 'phone-1183');
// Or name the seats yourself.
$seatlayer->inventory->boxOfficeBook($eventKey, ['A-1', 'A-2'], bookingRef: 'comp-14');
Private and partner sales
Channels reserve inventory for a partner, member group, presale, or other private allocation. A
buyer access session is short-lived and origin-bound, so the browser receives only the allocation
it is allowed to sell; your secret key remains on your server.