Skip to content

.NET server SDK

Install SeatLayer 0.7.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.7.0 requires .NET 8 or newer and has no package dependencies.

Install and create the client

dotnet add package SeatLayer --version 0.7.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, Inventory, PerformanceGroups, Sessions, Seasons, Templates, Webhooks, and Workspaces.

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 48 frozen 0.7.0 operations. .NET retains the Season prefix and adds Async, for example CreateSeasonAsync, PublishSeasonPlanAsync, BookSeasonHoldAsync, CommitSeasonRenewalOfferAsync, and ExportSeasonSupportSnapshotAsync. The service 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 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);
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 14 methods also retry with one exact key: Charts.CreateAsync, Charts.CopyAsync, Templates.InstantiateTemplateAsync, Events.CreateAsync, Workspaces.CreateAsync, PerformanceGroups.CreateAsync, and Seasons.CreateSeasonAsync, UpdateSeasonAsync, DeleteSeasonAsync, CreateSeasonPlanAsync, DuplicateSeasonToLiveAsync, CreateSeasonHolderImportAsync, CreateSeasonRenewalOffersAsync, and CreateSeasonAmendmentAsync. 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