---
title: ".NET server SDK"
description: "Install SeatLayer 0.7.0 from NuGet, inspect an authoritative hold, book with a stable reference, and use the exact .NET service namespaces."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.seatlayer.io/llms.txt
> Use this file to discover all available pages before exploring further.

# .NET server SDK

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

```bash
dotnet add package SeatLayer --version 0.7.0
```

```csharp
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](/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

```csharp
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`:

```csharp
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](/server-sdk/reliability/) for the shared
contract.

## Verify and continue

- [NuGet package `0.7.0`](https://www.nuget.org/packages/SeatLayer/0.7.0)
- [tagged source and package README](https://github.com/seatlayer/seatlayer-dotnet/tree/v0.7.0)
- [`PerformanceGroups` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-dotnet/blob/v0.7.0/src/SeatLayer/PerformanceGroupServices.cs)
- [all `Seasons` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-dotnet/blob/v0.7.0/src/SeatLayer/SeasonServices.cs)
- [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/).

Source: https://docs.seatlayer.io/server-sdk/dotnet/index.mdx
