---
title: "Python server SDK"
description: "Install seatlayer 0.7.0, inspect an authoritative hold, book with a stable reference, and use the exact Python resource namespaces."
---

Use the `seatlayer` package from a trusted Python backend. Version `0.7.0`
requires Python 3.10 or newer and has no runtime dependencies.

## Install and create the client

```bash
pip install seatlayer==0.7.0
```

```python
import os
from seatlayer import SeatLayer

seatlayer = SeatLayer(os.environ["SEATLAYER_SECRET_KEY"])
if seatlayer.mode != "test":
    raise RuntimeError("Use a test key while integrating.")
```

Keep `SEATLAYER_SECRET_KEY` in the server environment. Never expose the client
or its `sk_…` credential to browser or mobile code.

## Exact resource surface

The client exposes `charts`, `channels`, `events`, `inventory`,
`performance_groups`, `sessions`, `seasons`, `templates`, `webhooks`, and
`workspaces`.

`seatlayer.performance_groups` contains all 13 released operations: `list`,
`create`, `retrieve`, `delete`, `activate`, `close`, `retrieve_lifecycle`,
`create_buyer_access_session`, `list_buyer_access_sessions`,
`revoke_buyer_access_session`, `retrieve_hold`, `book_hold`, and
`retrieve_booking`.

`seatlayer.seasons` contains all 48 frozen `0.7.0` operations. Python keeps the
Season prefix and uses snake case, for example `create_season`,
`publish_season_plan`, `book_season_hold`, `commit_season_renewal_offer`, and
`export_season_support_snapshot`. The resource covers catalogue, lifecycle,
Plans and sales, buyer handoff, holder import, renewals, amendments, reports,
recovery, outbox, audit, and support export. Source-only occurrence
return/reclaim operations are not part of `0.7.0`.

The same 13 Performance Group and 48 Season wire operations are released in all
seven official server SDKs; only language naming differs.

The `0.7.0` typed `performance_groups.create` parameters cover the default
`fixed` policy but do not expose the newer REST `inclusionMode` field. Use the
[REST/raw-request path](/server-api/performance-groups/#create-a-run) for
`flexible_dates`; the other typed create fields and all 13 operations remain
available.

## Inspect and book an Event hold

```python
event_key = os.environ["SEATLAYER_EVENT_KEY"]
hold_id = os.environ["SEATLAYER_HOLD_ID"]
booking_ref = os.environ["ORDER_ID"]

hold = seatlayer.inventory.retrieve_hold(event_key, hold_id)
labels = [item["label"] for item in hold["items"]]
# Price from hold["items"] and authorize payment in your commerce system here.
booking = seatlayer.inventory.book(
    event_key,
    hold_id=hold_id,
    labels=labels,
    booking_ref=booking_ref,
)
```

Do not calculate a charge from browser-submitted totals. A `booking_ref` is
your commerce system's immutable join to SeatLayer inventory. If the booking
response is lost, call
`seatlayer.inventory.retrieve_booking(event_key, booking_ref)` before deciding
whether to repeat the exact same hold, labels, and reference.

## Errors, retries, and pagination

Branch on `SeatLayerAuthError`, `SeatLayerConflictError`, and
`SeatLayerRateLimitError`. Mode mismatch is `is_mode_mismatch`; sold out is
`is_sold_out`; rate-limit timing is `retry_after_seconds`.

Reads retry `408`, `429`, and `5xx` responses with backoff. These 14 methods
also retry with one exact idempotency key: `charts.create`, `charts.copy`,
`templates.instantiate_template`, `events.create`, `workspaces.create`,
`performance_groups.create`, and the Season methods `create_season`,
`update_season`, `delete_season`, `create_season_plan`,
`duplicate_season_to_live`, `create_season_holder_import`,
`create_season_renewal_offers`, and `create_season_amendment`. Holds, bookings,
lifecycle changes, show-once credentials, and raw mutations are single-attempt.

Large lists use an iterator rather than an unbounded array:

```python
for event in seatlayer.events.list_all():
    sync_event(event)
```

That helper is Event-specific. Performance Group and top-level Season list
methods return one cursor page; pass the opaque `nextCursor` value back through
the method's `cursor` argument until it is absent.

Nullable Event fields distinguish omission from explicit `None`; consult the
package README before sending a reset. See [errors, retries, and
idempotency](/server-sdk/reliability/) for the shared contract.

## Verify and continue

- [PyPI package `0.7.0`](https://pypi.org/project/seatlayer/0.7.0/)
- [tagged source and package README](https://github.com/seatlayer/seatlayer-python/tree/v0.7.0)
- [`performance_groups` and `seasons` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-python/blob/v0.7.0/src/seatlayer/resources.py)
- [server API operation support](/server-api/operation-support/)
- [OpenAPI 3.1 reference](/openapi.json)

Verify the flow with a test key, a test Event, and a real test hold. Then add
[webhook verification](/server-sdk/webhooks/), choose the correct [inventory
model](/start/inventory-models/), and complete the [going-live
checklist](/start/going-live/).