Skip to content

.NET server SDK

Install SeatLayer 0.9.0 from NuGet, inspect an authoritative hold, book with a stable reference, and use the exact .NET service namespaces.

Updated View as Markdown

Use the SeatLayer package from a trusted .NET backend. Version 0.9.0 requires .NET 8 or newer and has no package dependencies.

Install and create the client

dotnet add package SeatLayer --version 0.9.0
using SeatLayer;

var client = new SeatLayerClient(
    Environment.GetEnvironmentVariable("SEATLAYER_SECRET_KEY")!
);
if (client.Mode != "test")
{
    throw new InvalidOperationException("Use a test key while integrating.");
}

SeatLayerClient is thread-safe and its HttpClient is designed to be long-lived. Register one singleton instead of constructing a client per request. Keep the secret key in server configuration.

Exact service surface

The client exposes Charts, Channels, Events, EventSeries, Holders, Inventory, Orders, PerformanceGroups, Sessions, Seasons, Templates, Webhooks, and Workspaces.

client.Events also holds event sales setup: buyer checkout, payment gateway, sales readiness, PreflightEventSalesAsync, TransitionEventSalesAsync, booking fee, and discount codes. client.Holders.ListCustomersAsync lists customers.

client.PerformanceGroups contains all 13 released operations: ListAsync, CreateAsync, RetrieveAsync, DeleteAsync, ActivateAsync, CloseAsync, RetrieveLifecycleAsync, CreateBuyerAccessSessionAsync, ListBuyerAccessSessionsAsync, RevokeBuyerAccessSessionAsync, RetrieveHoldAsync, BookHoldAsync, and RetrieveBookingAsync.

client.Seasons contains all 90 Season operations in 0.9.0. .NET retains the Season prefix and adds Async, for example CreateSeasonAsync, PublishSeasonPlanAsync, BookSeasonHoldAsync, CommitSeasonRenewalOfferAsync, and ExportSeasonSupportSnapshotAsync. The service covers catalogue, lifecycle, performances, Plans and plan edits, package prices, sales, checkout tests, buyer handoff, holder import and the holder list, renewals and hosted renewals, amendments, Season orders, reports and CSV exports, bulk jobs, season seats, recovery, outbox, audit, and support export. ReturnSeasonOccurrenceInventoryAsync returns one Season occurrence allocation to ordinary Event inventory, and ReclaimSeasonOccurrenceInventoryAsync reclaims it while it is still free.

Season seats are SetAsideSeasonBlockAsync, RetrieveSeasonBlockAsync, and ReleaseSeasonBlockAsync on client.Seasons. Turn them on with InventoryMode = "block" on SeasonCreateRequest or SeasonUpdateRequest; every Season answer carries inventoryMode (block or per_hold). Both writes answer 202 with a job to follow with RetrieveSeasonBulkJobAsync. The season seats routes list the rules and refusal codes. A refusal is a SeatLayerException or one of its subclasses; read its Code.

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

The 0.9.0 typed PerformanceGroups.CreateAsync request covers the default fixed policy but does 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

using System.Collections.Generic;
using System.Linq;

var eventKey = Environment.GetEnvironmentVariable("SEATLAYER_EVENT_KEY")!;
var holdId = Environment.GetEnvironmentVariable("SEATLAYER_HOLD_ID")!;
var bookingRef = Environment.GetEnvironmentVariable("ORDER_ID")!;

var hold = await client.Inventory.RetrieveHoldAsync(eventKey, holdId);
// An expired, released or booked hold still answers with its status.
if (hold["status"] as string != "active")
{
    throw new InvalidOperationException("The hold is no longer active");
}
var labels = ((List<object?>)hold["items"]!)
    .OfType<IReadOnlyDictionary<string, object?>>()
    .Select(item => (string)item["label"]!)
    .ToArray();
// Price from hold["items"] and authorize payment in your commerce system here.
var booking = await client.Inventory.BookAsync(eventKey, new BookRequest
{
    HoldId = holdId,
    Labels = labels,
    BookingRef = bookingRef,
});

Do not calculate a charge from browser-submitted totals. bookingRef is your commerce system’s immutable join to SeatLayer inventory. If the response is lost, call client.Inventory.RetrieveBookingAsync(eventKey, bookingRef) before deciding whether to repeat the exact same hold, labels, and reference.

Errors, retries, and pagination

Branch on SeatLayerAuthException, SeatLayerConflictException, and SeatLayerRateLimitException. Use IsModeMismatch, IsSoldOut, and RetryAfterSeconds for those common branches.

Reads retry 408, 429, and 5xx with exponential backoff and full jitter. These 44 methods also retry with one exact key:

  • Charts: CreateAsync, CopyAsync, CopyWithOptionsAsync
  • Templates: InstantiateTemplateAsync
  • Events: CreateAsync
  • EventSeries: CreateEventSeriesAsync, AddEventSeriesDatesAsync, UpdateEventSeriesAsync
  • Workspaces: CreateAsync
  • PerformanceGroups: CreateAsync
  • Holders: UpdateHolderAsync, CreateHolderTransferAsync, CreateHolderReturnAsync, CreateHolderRenewalCheckoutAsync
  • Orders: RefundEventOrderAsync, CancelEventOrderAsync
  • Seasons (28): CreateSeasonAsync, UpdateSeasonAsync, DeleteSeasonAsync, CreateSeasonPlanAsync, UpdateSeasonPlanAsync, DeleteSeasonPlanAsync, PublishSeasonAsync, DuplicateSeasonToLiveAsync, CreateSeasonPerformancesAsync, AttachSeasonPerformancesAsync, DeleteSeasonPerformanceAsync, AttachSeasonPlanPerformanceAsync, DeleteSeasonPlanPerformanceAsync, MarkSeasonPerformancePastAsync, ReplaceSeasonPackagePricesAsync, CreateSeasonCheckoutTestAsync, CreateSeasonHolderImportAsync, CreateSeasonHolderImportFromSeasonAsync, CreateSeasonRenewalOffersAsync, CreateSeasonRenewalCheckoutAsync, ReleaseSeasonLapsedOffersAsync, CreateSeasonAmendmentAsync, RefundSeasonOrderAsync, CancelSeasonOrderAsync, CancelSeasonOrderDateAsync, RefundSeasonPerformanceAsync, SetAsideSeasonBlockAsync, and ReleaseSeasonBlockAsync

Other mutations and raw SendAsync mutations are single-attempt. A cancelled CancellationToken stops retry work immediately.

Large lists use IAsyncEnumerable:

await foreach (var seatEvent in client.Events.ListAllAsync())
{
    await SyncEventAsync(seatEvent);
}

That async stream is Event-specific. Performance Group and top-level Season list methods return one Page; pass its opaque NextCursor into the next list request until it is null.

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