Skip to content

Python server SDK

Install seatlayer 0.7.0, inspect an authoritative hold, book with a stable reference, and use the exact Python resource namespaces.

Updated View as Markdown

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

pip install seatlayer==0.7.0
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 for flexible_dates; the other typed create fields and all 13 operations remain available.

Inspect and book an Event hold

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:

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 for the shared contract.

Verify and continue

Verify the flow with a test key, a test Event, and a real test hold. Then add webhook verification, choose the correct inventory model, and complete the going-live checklist.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close