---
title: "Go server SDK"
description: "Install seatlayer-go v0.7.0, inspect an authoritative hold, book with a stable reference, and use the exact Go service namespaces."
---

Use `github.com/seatlayer/seatlayer-go` from a trusted Go backend. Version
`v0.7.0` requires Go 1.23 or newer and uses only the standard library.

## Install and create the client

```bash
go get github.com/seatlayer/seatlayer-go@v0.7.0
```

```go title="inside application startup"
import (
    "errors"
    "os"

    seatlayer "github.com/seatlayer/seatlayer-go"
)

client, err := seatlayer.New(os.Getenv("SEATLAYER_SECRET_KEY"))
if err != nil {
    return err
}
if client.Mode() != "test" {
    return errors.New("use a test key while integrating")
}
```

Import the module as `seatlayer`; the package name intentionally differs from
the final repository segment. Keep the secret key in the server environment.

## Exact service surface

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

`client.PerformanceGroups` contains all 13 released operations: `List`,
`Create`, `Retrieve`, `Delete`, `Activate`, `Close`, `RetrieveLifecycle`,
`CreateBuyerAccessSession`, `ListBuyerAccessSessions`,
`RevokeBuyerAccessSession`, `RetrieveHold`, `BookHold`, and `RetrieveBooking`.

`client.Seasons` contains all 48 frozen `v0.7.0` operations. Go drops the
redundant Season prefix inside the service, for example `Create`, `PublishPlan`,
`BookHold`, `CommitRenewalOffer`, and `ExportSupportSnapshot`. 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 `v0.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 `v0.7.0` typed `PerformanceGroups.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

Every API method accepts a `context.Context`. Cancelling it stops retry work
immediately.

```go
eventKey := os.Getenv("SEATLAYER_EVENT_KEY")
holdID := os.Getenv("SEATLAYER_HOLD_ID")
bookingRef := os.Getenv("ORDER_ID")

hold, err := client.Inventory.RetrieveHold(ctx, eventKey, holdID)
if err != nil {
    return err
}
if len(hold.Items) == 0 {
    return errors.New("the hold contains no inventory")
}
labels := make([]string, 0, len(hold.Items))
for _, item := range hold.Items {
    labels = append(labels, item.Label)
}
// Price from hold.Items and authorize payment in your commerce system here.
_, err = client.Inventory.Book(ctx, eventKey, seatlayer.BookParams{
    HoldID:     holdID,
    Labels:     labels,
    BookingRef: bookingRef,
})
return err
```

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.RetrieveBooking(ctx, eventKey, bookingRef)` before
deciding whether to repeat the exact same hold, labels, and reference.

## Errors, retries, and iteration

Errors are values. Use `errors.As` with `*seatlayer.AuthError`,
`*seatlayer.ConflictError`, and `*seatlayer.RateLimitError`; `SoldOut()` is the
explicit sold-out business branch.

Reads retry `408`, `429`, and `5xx` with exponential backoff and full jitter.
These 14 methods also retry with one exact key: `Charts.Create`, `Charts.Copy`,
`Templates.InstantiateTemplate`, `Events.Create`, `Workspaces.Create`,
`PerformanceGroups.Create`, and `Seasons.Create`, `Update`, `Delete`,
`CreatePlan`, `DuplicateToLive`, `CreateHolderImport`, `CreateRenewalOffers`,
and `CreateAmendment`. Other mutations and raw `Do` mutations are
single-attempt. `Retry-After` takes precedence when present.

Large lists use Go 1.23 range-over-function iteration:

```go
for event, err := range client.Events.All(ctx, nil) {
    if err != nil {
        return err
    }
    syncEvent(event)
}
```

That iterator is Event-specific. Performance Group and top-level Season list
methods return one cursor page; pass the response's opaque `NextCursor` in the
next list options until it is empty.

See [errors, retries, and idempotency](/server-sdk/reliability/) for the shared
contract.

## Verify and continue

- [Go package reference `v0.7.0`](https://pkg.go.dev/github.com/seatlayer/seatlayer-go@v0.7.0)
- [tagged source and package README](https://github.com/seatlayer/seatlayer-go/tree/v0.7.0)
- [`PerformanceGroups` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-go/blob/v0.7.0/performance_groups.go)
- [all `Seasons` methods at `v0.7.0`](https://github.com/seatlayer/seatlayer-go/blob/v0.7.0/seasons.go)
- [current 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/).