seatlayer

package module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

SeatLayer Go Server SDK for Reserved Seating

CI Go Reference

The official Go client for the SeatLayer API. This module lets a Go backend inspect seat holds, price orders from server data, book reserved seats and verify webhooks, with no dependencies beyond the standard library. SeatLayer is seating chart and reserved-seat ticketing software built for venues up to stadium scale.

SeatLayer's official Go server SDK is the trusted side of its reserved seating and seat booking API: inspect the holds a buyer created, price from server data, and book with a stable BookingRef. From Go you manage seating charts, events, sales channels, and live seat inventory through one typed ticketing API client.

SeatLayer module on pkg.go.dev · Go server SDK guide · SeatLayer developer platform · SeatLayer JavaScript seat map SDK · Server API reference

Server-side only. This package authenticates with your secret key. Never embed it in anything a ticket buyer can reach. Browser surfaces get short-lived, origin-bound tokens that you mint here.

Two-step shape: the buyer picks and holds seats in the client with your public key, then this SDK confirms the booking from your server with your secret key while your platform keeps checkout and its own payment provider.

Start here: Quickstart · Holds and checkout · Go server SDK guide · SDK catalog · Pricing: $0 entry, 100 free confirmed-sold-seat credits per organization each month, then $0.10 down to $0.05 a credit, and credits never expire.

Scale evidence

Benchmarked on public 100,000-, 150,000- and 200,000-seat venue fixtures on 15 September 2026: 200,000 seats chart-ready in 1.95 s, desktop, local production build. Fixtures, method and run logs: https://github.com/seatlayer/seatlayer-performance. Live 200,000-seat stadium demo: https://app.seatlayer.io/demo/play/century-stadium-200k. This is renderer evidence, not a concurrent-buyer claim.

Install the Go seat booking SDK

go get github.com/seatlayer/seatlayer-go@v0.9.0

The module resolves straight from this repository through the Go module proxy, so there is no registry account to create; v0.9.0 is the current release and the API reference is published on pkg.go.dev. Requires Go 1.23 or newer (for range-over-func iterators). No dependencies: standard library only.

Quick start

import (
    "context"
    "os"

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

client, err := seatlayer.New(os.Getenv("SEATLAYER_SECRET_KEY"))
if err != nil {
    return err
}
ctx := context.Background()

// 1. Materialize a published catalog template as the organiser's draft chart.
// Replace this placeholder with a template id from your catalog.
chart, err := client.Templates.InstantiateTemplate(ctx, "your-published-template")
if err != nil {
    return err
}
chartID := chart["meta"].(map[string]any)["id"].(string)
if _, err := client.Charts.Publish(ctx, chartID); err != nil {
    return err
}

// 2. Create an event on it.
event, err := client.Events.Create(ctx, seatlayer.EventCreateParams{
    ChartID: chartID,
    Name:    "Spring Gala",
    Currency: "EUR",  // leave empty to inherit the workspace currency
    Region:  seatlayer.RegionWesternEurope, // India: RegionAsiaPacific
})
if err != nil {
    return err
}
eventKey := event["meta"].(map[string]any)["key"].(string)

// 3. Sell four seats over the phone.
held, err := client.Inventory.HoldBestAvailable(ctx, eventKey, seatlayer.BestAvailableParams{Qty: 4})
if err != nil {
    return err
}
// … take payment against held["items"], which carry authoritative prices …
_, err = client.Inventory.Book(ctx, eventKey, seatlayer.BookParams{
    HoldID:     held["holdId"].(string),
    BookingRef: "order-8842",
})

Event hosting region

Set EventCreateParams.Region based on the event venue, not your API server or office. It controls the initial placement of the Event's live inventory; an existing Event cannot be moved later. Leave it empty to inherit the workspace default (western-europe for new accounts). Set the default through WorkspaceCreateParams.DefaultRegion or UpdateWithParams(..., WorkspaceUpdateParams{DefaultRegion: ...}); updates affect only future Events.

  • western-europe, eastern-europe, north-america-east, north-america-west, south-america
  • asia-pacific, northeast-asia, southeast-asia, oceania, africa, middle-east

The hint is best effort, not a data-residency guarantee. See the full Event region guide.

For nullable event-create fields, ordinary scalar fields cover the common value-or-omit case. Use the Nullable overlay when the wire call must contain an explicit JSON null, for example Nullable: seatlayer.EventCreateNullableFields{Venue: seatlayer.FieldNull[string]()}.

Every method takes a context.Context. Cancelling it stops retries immediately rather than being treated as a transient fault to back off through.

Fixed Renewable Seasons

client.Seasons exposes 87 trusted organizer operations: the 48 added in v0.7.0, plus performances, package prices (per price type, with the SeasonPriceType… constants), one-call publishing, checkout tests, the holder list, Season order refunds and cancellations, hosted renewals, renewal quotes, intents and checkouts, sales and seat reports, CSV exports, and the bulk refund of a cancelled date (RefundPerformance) and release of lapsed offers (ReleaseLapsedOffers) with their jobs (ListBulkJobs, RetrieveBulkJob). Above 100 contracts CreateRenewalOffers answers 202 with a renewal_run job and its batchId, and above 100 holders CreateHolderImportFromSeason answers 202 with a holder_import job; follow either with RetrieveBulkJob. ListRenewalOffers and RetrieveHostedRenewals read one page at a time: pass SeasonOfferPageParams{Cursor: nextCursor}. ExportHoldersCSV and ExportOrdersCSV return the CSV text unchanged; DeletePlan answers 204 and returns only an error.

After the test hold/book/cancel journey and matching webhook deliveries, client.Seasons.ValidateBuyerRehearsal(ctx, seasonKey) sends no evidence body; SeatLayer discovers the retained chain automatically. Retrieved Season holds contain inventory identity, not an authoritative amount. Your platform owns package price, payment, order, tax, refunds, benefits, and ticket or pass delivery.

checked, err := client.Seasons.Validate(ctx, seatlayer.SeasonSelectionParams{
    SourcePerformanceGroupKeys: []string{"pg_subscription_run"},
})
created, err := client.Seasons.Create(ctx, seatlayer.SeasonCreateParams{
    Name: "2027 subscription",
    SourcePerformanceGroupKeys: []string{"pg_subscription_run"},
    IdempotencyKey: "season-create-2027",
})

Treat 202 as accepted work and poll RetrieveLifecycle with the returned operation identity. Buyer-session minting and domain-exact booking, cancellation, and renewal actions remain single-attempt; only declared header-replay catalogue mutations retry automatically.

When SeatLayer takes the Season's payments, renew a holder with no hosted page: read the price, start a checkout, and send the holder to payment.url. For a renewal taken by phone or at the box office, CreateRenewalIntent records the holder's intent before you commit the offer. A decline can carry the holder's reason.

quote, err := client.Seasons.RetrieveRenewalQuote(ctx, seasonKey, offerID)
if err != nil {
    return err
}
if quote["problem"] == nil {
    started, err := client.Seasons.CreateRenewalCheckout(ctx, seasonKey, offerID,
        seatlayer.SeasonRenewalCheckoutParams{
            ReturnURL:      "https://tickets.yourclub.example/renewed",
            IdempotencyKey: "renew-" + offerID,
        })
    if err != nil {
        return err
    }
    redirect(started["payment"].(map[string]any)["url"].(string))
}

// For one holder's offer:
_, err = client.Holders.DeclineRenewalOffer(ctx, "holder_123", offerID,
    &seatlayer.SeasonRenewalDeclineParams{Reason: "Moving away"})
Season seats

Season seats are the seats a season sets aside on every date before its sales open. A season buyer's hold then doesn't have to ask each date, and single-ticket buyers see those seats as unavailable. They are off for every season until you set InventoryMode to seatlayer.SeasonInventoryModeBlock on Create or Update. The season needs one package, and its sales must not have opened. Turning them on keeps the season's revision.

_, err := client.Seasons.Update(ctx, seasonKey, seatlayer.SeasonUpdateParams{
    ExpectedRevision: revision, InventoryMode: seatlayer.SeasonInventoryModeBlock,
})
answer, err := client.Seasons.SetAsideBlock(ctx, seasonKey, seatlayer.SeasonBlockSetAsideParams{
    ExpectedRevision:     revision,
    KeepForSingleTickets: &seatlayer.SeasonSeatSelection{SectionIDs: []string{"sec_family"}},
})
job := answer["job"].(map[string]any)
for job["state"] == "planning" || job["state"] == "running" {
    time.Sleep(2 * time.Second)
    read, err := client.Seasons.RetrieveBulkJob(ctx, seasonKey, job["jobId"].(string))
    if err != nil {
        return err
    }
    job = read["job"].(map[string]any)
}
block, err := client.Seasons.RetrieveBlock(ctx, seasonKey)
rev := int(block["block"].(map[string]any)["revision"].(float64))

// Release unsold season seats to single sale. Leave At empty to release now.
_, err = client.Seasons.ReleaseBlock(ctx, seasonKey, seatlayer.SeasonBlockReleaseParams{
    ExpectedRevision: rev,
    Scope:            seatlayer.SeasonBlockReleaseScope{All: true},
    At:               "2026-12-01T09:00:00Z",
})
  • On an active season, block mode turns on by itself once every date has the seats, and WebhookEventSeasonBlockReady (season.block.ready) is sent once. On a draft, Publish turns it on. WebhookEventSeasonBlockReleased (season.block.released) is sent once a release has run.
  • In block mode, a date cancel (CreateAmendment, kind cancel) or MarkPerformancePast first takes the date off every season seat. Until that finishes the answer is a 202: check it with seatlayer.IsSeasonDateLeavePending(answer), then send the same request again after Retry-After.
  • Refusals come through *APIError and its typed wrappers with Code, and nothing changes. For example 409 season_block_packages (more than one package), 409 season_block_on_sale (sales have opened), or 409 block_not_ready from OpenSales before block mode is on.
  • A partner's seat on a date (one a sales channel sells there) stays out of the block. It is listed in the block's notFreeOnEveryDate with reason channel.

The Season seats docs list every refusal.

Test vs live

Keys carry their own mode. sk_test_… keys can only touch test-mode events and sk_live_… only live ones; crossing them returns 403 mode_mismatch.

client, err := seatlayer.New(os.Getenv("SEATLAYER_SECRET_KEY"))
if err != nil {
    return err
}
if os.Getenv("ENV") == "production" && client.Mode() != "live" {
    return errors.New("refusing to boot production against test-mode seating data")
}

A publishable pk_ key is rejected by New with a message naming the mistake, rather than failing as a 401 three round-trips later.

Book reserved seats from Go

Buyer picks seats in the browser. Your frontend holds them; your backend confirms the price and books. Never price from what the browser sent you: RetrieveHold is authoritative.

import "errors"

hold, err := client.Inventory.RetrieveHold(ctx, eventKey, holdID)
if err != nil {
    return err
}
if len(hold.Items) == 0 {
    return errors.New("hold has no items")
}
currency := hold.Items[0].Currency
total := 0.0
for _, item := range hold.Items {
    if item.Currency != currency {
        return errors.New("a hold must use one currency")
    }
    quantity := 1
    if item.Quantity != nil {
        quantity = *item.Quantity
    }
    total += item.UnitPrice * float64(quantity)
}
// … charge `total` in `currency` …
_, err = client.Inventory.Book(ctx, eventKey, seatlayer.BookParams{
    HoldID: holdID, BookingRef: charge.ID,
})

Your backend picks the seats. Phone orders, box office, comps.

// Payment already taken: book outright, so nothing is stranded if a second call fails.
_, err := client.Inventory.BookBestAvailable(ctx, eventKey, seatlayer.BestAvailableParams{
    Qty: 2, BookingRef: "phone-1183",
})

// Or name the seats yourself.
_, err = client.Inventory.BoxOfficeBook(ctx, eventKey, []string{"A-1", "A-2"}, "comp-14")

Private and partner sales

Channels reserve inventory for a partner, member group, presale, or other private allocation. A buyer access session is short-lived and origin-bound, so the browser receives only the allocation it is allowed to sell; your secret key remains on your server.

_, err := client.Channels.CreateChannel(ctx, eventKey, seatlayer.ChannelCreateParams{
	Name:         "Venue members",
	AccessIntent: "private",
})

_, err = client.Channels.UpdateAssignments(ctx, eventKey, seatlayer.ChannelAssignmentParams{
	Labels:            []string{"A-1", "A-2"},
	AssignmentVersion: 1,
	TargetChannelID:   "ch_members",
})

access, err := client.Channels.CreateBuyerAccessSession(ctx, eventKey,
	seatlayer.BuyerAccessSessionParams{
		ChannelIDs:    []string{"ch_members"},
		IncludePublic: false,
		AllowedOrigin: "https://members.example",
		MaxQuantity:   2,
	})

Pass the returned token to the buyer SDK. Trusted backend sale params accept ChannelIDs, an explicit privileged IgnoreChannelRestrictions flag, and an audit Reason.

Listing and pagination

List returns one Page plus a cursor. All is a range-over-func iterator that pages as you consume it. It is deliberately not a slice, because the point of paginating is to not hold an unbounded result set in memory.

// One page, your own paging.
page, err := client.Events.List(ctx, &seatlayer.EventListParams{Limit: 50})
page.Items
page.NextCursor   // "" once exhausted

// Or let the SDK walk it.
for event, err := range client.Events.All(ctx, nil) {
    if err != nil {
        return err
    }
    sync(event)
}

The error rides alongside each item so a failed page reaches you. An iterator that silently ended on error would look identical to a list that finished.

Listing events includes live availability counts by default, which costs the server one round-trip per event. All drops them automatically, since walking a whole catalogue is exactly when you don't want that, and you can control it explicitly:

client.Events.List(ctx, &seatlayer.EventListParams{Limit: 50, NoCounts: true})

Set SeriesKey to list only the dates of one event series.

Keeping a hold alive

When an order takes longer than the checkout window (an invoice, a phone sale), extend rather than release and re-hold. Releasing first hands the seats to whoever is racing for them in between.

_, err := client.Inventory.ExtendHold(ctx, eventKey, holdID, 10*60*1000)

var conflict *seatlayer.ConflictError
if errors.As(err, &conflict) {
    // Gone, expired, or at its renewal cap: the buyer has to re-pick.
}

Embedding the control room

Your secret key never reaches a browser. Mint a scoped token instead.

session, err := client.Sessions.CreateManageSession(ctx, eventKey, seatlayer.ManageSessionParams{
    AllowedOrigin:    "https://box-office.yourplatform.com",
    Capabilities:     []seatlayer.ManageCapability{
        seatlayer.CapabilityView,
        seatlayer.CapabilityBlock,
    },
    ExpiresInSeconds: 3600,
})

Capabilities is required by this SDK even though the raw API safely defaults an omitted list to view-only (event:view). Keeping the field required makes browser authority visible at every call site. Grant the smallest set the page needs. For Platform/SDK events, event:cancel returns a booking's inventory to sale but does not move gateway money. The Managed commerce constants cover eligible Managed Ticketing orders, refunds, ticket delivery, door, and box-office capabilities.

Designer minting returns a DesignerSessionEnvelope; the token and the effective safe-mode and feature policy live under result.Session. Pass SafeModeOptions only with Mode: "safe".

Webhooks

Webhook methods expose the wire envelopes directly: List returns WebhookList.Subs, Create returns WebhookCreateEnvelope with the show-once Secret, and Update returns WebhookEnvelope.Sub. Use the WebhookEvent… constants for the 56 accepted event names and WebhookDeliveryListParams for limit, status, and before filters.

Verify every delivery against the raw body. Decoding and re-encoding changes the bytes. In Go specifically, encoding/json marshals map keys in sorted order while a real delivery arrives in the order we serialised it, so a round trip reorders it and verification fails.

func handleWebhook(w http.ResponseWriter, r *http.Request) {
    payload, err := io.ReadAll(r.Body)   // raw bytes, before any decoding
    if err != nil {
        w.WriteHeader(http.StatusBadRequest)
        return
    }

    event, err := seatlayer.VerifyWebhook(
        payload,
        r.Header.Get("X-SeatLayer-Signature"),
        os.Getenv("SEATLAYER_WEBHOOK_SECRET"),
    )
    if errors.Is(err, seatlayer.ErrWebhookVerification) {
        w.WriteHeader(http.StatusBadRequest)
        return
    }

    // The signed body carries "at", but nothing enforces a freshness window, so a
    // captured delivery stays valid indefinitely. Deduplicate on occurrenceId:
    // this is your replay protection, not an optimisation.
    if alreadyProcessed(event["occurrenceId"].(string)) {
        w.WriteHeader(http.StatusOK)
        return
    }

    process(event)
    w.WriteHeader(http.StatusOK)
}

Errors

Errors are values here, not exceptions, so reach for errors.As:

_, err := client.Inventory.HoldBestAvailable(ctx, eventKey, seatlayer.BestAvailableParams{Qty: 6})

var conflict *seatlayer.ConflictError
var rateLimit *seatlayer.RateLimitError
var auth *seatlayer.AuthError

switch {
case errors.As(err, &conflict) && conflict.SoldOut():
    return offerAlternativeDates()          // a business outcome, not a bug
case errors.As(err, &rateLimit):
    return retryAfter(rateLimit.RetryAfter)
case errors.As(err, &auth) && auth.ModeMismatch():
    return errors.New("test key pointed at a live event, or the reverse")
case err != nil:
    return err
}
Type Status Means
AuthError 401, 403 Bad, revoked, or wrong-mode key
NotFoundError 404 No such resource for this organisation
ConflictError 409 Inventory moved, or a guard rejected the change
ValidationError 422 Understood and rejected
RateLimitError 429 Over budget; carries RetryAfter
ConnectionError none No answer: DNS, TLS, socket, context deadline (unwraps)

Every API error carries Status, Code, Body, and RequestID. Quote the request id in support requests.

Reliability

Retries. Reads (GET/HEAD) retry 429, 408 and 5xx with exponential backoff and full jitter; Retry-After wins when the server sends it. Forty-one mutations use exact header replay: Charts.Create, Charts.Copy, Templates.InstantiateTemplate, Events.Create, Workspaces.Create, PerformanceGroups.Create, Seasons.Create, Seasons.Update, Seasons.Delete, Seasons.CreatePlan, Seasons.UpdatePlan, Seasons.DeletePlan, Seasons.Publish, Seasons.DuplicateToLive, Seasons.CreateHolderImport, Seasons.CreateHolderImportFromSeason, Seasons.CreateRenewalOffers, Seasons.CreateAmendment, Seasons.CreatePerformances, Seasons.AttachPerformances, Seasons.DeletePerformance, Seasons.MarkPerformancePast, Seasons.CreateCheckoutTest, Seasons.ReplacePackagePrices, Seasons.AttachPlanPerformance, Seasons.DeletePlanPerformance, Seasons.RefundOrder, Seasons.CancelOrder, Seasons.CancelOrderDate, Seasons.RefundPerformance, Seasons.ReleaseLapsedOffers, Seasons.CreateRenewalCheckout, Holders.Update, Holders.CreateTransfer, Holders.CreateReturn, Holders.CreateRenewalCheckout, Orders.RefundEventOrder, Orders.CancelEventOrder, EventSeries.Create, EventSeries.AddDates, and EventSeries.Update. Other 4xx responses are never retried.

Idempotency. Those 41 replay-backed operations carry an Idempotency-Key, generated when you do not supply one and reused across attempts. All remaining SDK mutations are single-attempt. Some have a server-side domain idempotency contract, but the SDK does not retry them automatically. This includes inventory holds and bookings, show-once credential or secret creation, unsupported operations, and raw Do mutations. Keep BookingRef in the booking body for reconciliation, but handle an unknown network outcome explicitly instead of automatically repeating the sale.

client.Events.Create(ctx, seatlayer.EventCreateParams{
    ChartID: chartID, IdempotencyKey: "provision-event-" + eventID,
})
client, err := seatlayer.New(
    os.Getenv("SEATLAYER_SECRET_KEY"),
    seatlayer.WithMaxRetries(3),
    seatlayer.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
)

Client is safe for concurrent use.

Escape hatch

For surface this SDK does not wrap yet, Do keeps auth and error mapping. Raw reads retain the read retry policy; raw mutations are always single-attempt because their replay contract is unknown:

client.Do(ctx, http.MethodPost, "/v1/events/ev_1/some-new-route", nil, map[string]any{"qty": 2}, "")

API surface

The client exposes these services. Performance Groups cover runs, sessions, holds, and bookings; Seasons cover catalogue, plan, sales, buyer-session, booking, renewal, occurrence, reporting, outbox, and support operations. Event sales settings (checkout choice, payment gateway, sales readiness and transitions, booking fee, discount codes) live on Events. The three CSV exports return the CSV text as a string.

Service Methods
Charts List All Create Retrieve Update Delete Copy Archive Unarchive Publish
Templates InstantiateTemplate
Events List All Create Retrieve RetrieveConfigurationBinding UpdateConfigurationBinding Update Delete UpdatePoster DeletePoster UpdateChart Close Reopen Archive ListTicketReleases UpdateTicketReleases CloseTicketRelease RetrieveHoldTTL UpdateHoldTTL RetrieveReport RetrieveLog RetrieveBuyerCheckout ReplaceBuyerCheckout RetrievePaymentGateway ReplacePaymentGateway RetrieveSalesReadiness PreflightSales TransitionSales RetrieveBookingFee ReplaceBookingFee ListDiscountCodes CreateDiscountCode UpdateDiscountCode EndDiscountCode DeleteDiscountCode
EventSeries Create List Retrieve AddDates Update
Orders List Retrieve ListTickets ListEventOrders RetrieveEventOrder ExportEventOrdersCSV RefundEventOrder CancelEventOrder ResendEventOrderTickets
Holders ListCustomers Retrieve Update RevokeSessions ListSeasons ListTickets RetrieveTicket CreateTransfer ListTransfers CancelTransfer AcceptTransfer CreateReturn CreateRenewalCheckout DeclineRenewalOffer
Channels ListChannels CreateChannel UpdateChannel UpdateAssignments ListAllocation RetrieveAccessPreview RetrieveReport Pause Unpause Archive CreateBuyerAccessSession ListBuyerAccessSessions RevokeBuyerAccessSession CreateAccessLink ListAccessLinks RotateAccessLink RevokeAccessLink
Inventory Hold HoldBestAvailable BookBestAvailable ExtendHold RetrieveHold Release Book BoxOfficeBook Unbook Block Unblock UnblockAll RetrieveAvailability UpdateAvailability ListBookings RetrieveBooking
Sessions CreateManageSession RevokeManageSession CreateDesignerSession RevokeDesignerSession
Webhooks List Create Update Delete ListDeliveries
Workspaces List Create Retrieve Update
PerformanceGroups List Create Retrieve Delete Activate Close RetrieveLifecycle CreateBuyerAccessSession ListBuyerAccessSessions RevokeBuyerAccessSession RetrieveHold BookHold RetrieveBooking
Seasons 87 operations for catalogue and Plan lifecycle, performances, package prices, publishing, checkout tests, sales windows, buyer access and booking, holder imports and the holder list, Season orders, renewals, hosted renewals and renewal checkouts, occurrence amendments and inventory returns, bulk refunds, lapsed-offer releases and their jobs, reports and CSV exports, audit, outbox, and support export

Full reference: SeatLayer Go server SDK guide

Frequently asked questions

How do I book seats from Go?

Add the github.com/seatlayer/seatlayer-go module, construct a client with seatlayer.New and your secret key, and call client.Inventory.Book with the hold id and a stable BookingRef. When your own backend picks the seats (phone orders, box office, comps), Inventory.BookBestAvailable and Inventory.BoxOfficeBook book outright with no prior hold. A booking reference is required on every booking call, so each sale is tied to an immutable order id you can reconcile against later.

What does the server SDK do that the buyer SDK does not?

The buyer SDK runs in the browser or mobile app and only selects and holds seats. This Go SDK runs on your trusted server and inspects and books them. Your secret key never reaches a buyer surface: browsers receive short-lived, origin-bound tokens minted here through Sessions.CreateManageSession or Channels.CreateBuyerAccessSession. Always price a sale from Inventory.RetrieveHold, never from values the browser sent you.

How do temporary seat holds work server-side?

A hold reserves seats against concurrent buyers for a limited checkout window. From Go you retrieve it with Inventory.RetrieveHold, whose item-level price, quantity, and currency are authoritative, and confirm it with Inventory.Book. Use Inventory.ExtendHold for a long checkout instead of releasing and re-holding, which would hand the seats to whoever is racing for them. Booking is a single automatic attempt: after an unknown network outcome you may reconcile and repeat the exact same event, hold, and BookingRef; seats already booked under that reference are not sold again.

Can I use my own payment provider?

Yes. This server SDK does not process payment in a Platform/SDK integration. Charge through the provider you already use, calculating the total from each server-inspected hold item's UnitPrice, Quantity, and Currency, then call Inventory.Book with your charge or order id as the BookingRef. Managed Ticketing is a separate product path with organizer-connected payments. The holds and checkout guide walks through the full handoff.

Continue your Go integration

SeatLayer SDK ecosystem

Surface Package or source
JavaScript @seatlayer/js
React @seatlayer/react
React Native @seatlayer/react-native
iOS seatlayer-ios
Flutter seatlayer
Android seatlayer-android
Server SDKs Node.js, Python, PHP, Ruby, .NET, Java, and Go
Node.js (server) @seatlayer/server
Python (server) seatlayer
PHP (server) seatlayer/seatlayer-php
Ruby (server) seatlayer
.NET (server) SeatLayer
Java (server) io.seatlayer:seatlayer-java
Go (server) github.com/seatlayer/seatlayer-go (this module)

Development

gofmt -l .          # must be empty
go vet ./...
go test -race ./...

License

MIT

Documentation

Overview

Package seatlayer is the official Go server SDK for the SeatLayer reserved-seating ticketing API: seating charts, seat maps, events, sales channels, seat holds, seat booking, and live inventory.

This is the trusted side of a reserved-seating integration. The buyer surface selects and holds seats; this package inspects the hold, prices it from server data, and books it with a stable booking reference.

SeatLayer is interactive seating chart software built for stadium scale. Platforms embed the white-label seat picker with their own checkout; organizers sell seated events on their own website with their own payment gateway.

Server-side only: this package authenticates with your secret key. Never embed it in anything a ticket buyer can reach. Browser surfaces get short-lived, origin-bound tokens that you mint with Sessions.

Start here:

A minimal server-side hold:

client, err := seatlayer.New(os.Getenv("SEATLAYER_SECRET_KEY"))
if err != nil {
	return err
}
held, err := client.Inventory.HoldBestAvailable(ctx, "summer-gala",
	seatlayer.BestAvailableParams{Qty: 4})

Index

Constants

View Source
const (
	// DefaultBaseURL is the public API.
	DefaultBaseURL = "https://api.seatlayer.io"
	// DefaultMaxRetries counts total attempts, not extra ones.
	DefaultMaxRetries = 3
	// DefaultTimeout applies per attempt.
	DefaultTimeout = 30 * time.Second
)
View Source
const (
	SeasonPriceTypeAdult      = "adult"
	SeasonPriceTypeChild      = "child"
	SeasonPriceTypeConcession = "concession"
	SeasonPriceTypeSenior     = "senior"
	SeasonPriceTypeStudent    = "student"
)

The price types a package can price a category for.

Variables

View Source
var ErrWebhookVerification = errors.New("seatlayer: webhook verification failed")

ErrWebhookVerification means the delivery did not come from SeatLayer. Respond 400 and do not process it.

Functions

func IsSeasonDateLeavePending added in v0.9.0

func IsSeasonDateLeavePending(answer map[string]any) bool

IsSeasonDateLeavePending reports whether an answer is the 202 a season-seats season's date cancel (CreateAmendment) or past date (MarkPerformancePast) sends while the date is still leaving every season seat: "state" "finishing", "code" "block_date_leave_pending", with "eventKey", "shardsLeft" and "shardCount". It finishes by itself: send the same request again after Retry-After to read how it ended.

func SeasonDateCancelVoidJobID added in v0.9.0

func SeasonDateCancelVoidJobID(amendmentID string) string

SeasonDateCancelVoidJobID names the job voiding a cancelled date's tickets: "sbj_void_" and the cancel's amendmentId. Cancelling a date starts it (a repeated cancel joins it); follow it with RetrieveBulkJob. Each Season ticket it voids is told by season.ticket.voided with reason date_cancelled.

func SeasonHolderImportRowsPerCall added in v0.9.0

func SeasonHolderImportRowsPerCall(dates int) int

SeasonHolderImportRowsPerCall is the most rows one CreateHolderImport call takes for a package of dates dates. Each row is fenced on every date: 100 up to 20 dates, then 2300 / (dates + 3) rounded down, 43 at 50. A call with more answers 422 invalid_rows with maxRows in the error's Body.

func VerifyWebhook

func VerifyWebhook(payload []byte, signature, secret string) (map[string]any, error)

VerifyWebhook checks a delivery's signature and returns its decoded payload.

payload must be the RAW request body — in net/http that is io.ReadAll(r.Body) before any decoding. Re-serialising a decoded body reorders keys and changes whitespace, so verification fails; the usual "fix" for that is to disable verification, which is why this takes bytes and does the work for you.

Errors wrap ErrWebhookVerification, so callers can test with errors.Is.

NOTE ON REPLAY: deliveries are signed over the body, which carries an "at" timestamp — but nothing enforces a freshness window, so a captured delivery stays valid indefinitely. Replay protection is yours: every event carries an occurrenceId, and the correct pattern is to record processed ids and ignore repeats. Do not skip this.

Types

type APIError

type APIError struct {
	// Status is the HTTP status the API answered with.
	Status int
	// Code is the machine-readable slug: body "code", falling back to "error".
	Code string
	// Message is the human-readable message, when the API sent one.
	Message string
	// Body is the decoded error body, for fields this SDK does not model.
	Body map[string]any
	// RequestID comes from X-Request-ID. Quote it in support requests.
	RequestID string
}

APIError is the base error returned for any non-2xx response.

Go has no exception hierarchy, so the pattern here is errors.As against the specific types below rather than catch blocks. A sold-out seat is a business outcome that belongs in an if, not lumped in with a bad key:

var conflict *ConflictError
if errors.As(err, &conflict) && conflict.SoldOut() {
	return offerAlternativeDates()
}

func (*APIError) Error

func (e *APIError) Error() string
type AccessLink struct {
	ID                string           `json:"id"`
	ChannelID         string           `json:"channelId"`
	Label             *string          `json:"label"`
	IncludePublic     bool             `json:"includePublic"`
	ExpiresAt         int64            `json:"expiresAt"`
	MaxRedemptions    int              `json:"maxRedemptions"`
	Redemptions       int              `json:"redemptions"`
	MaxQuantity       int              `json:"maxQuantity"`
	SessionTTLSeconds int              `json:"sessionTtlSeconds"`
	State             AccessLinkState  `json:"state"`
	Status            AccessLinkStatus `json:"status"`
	CreatedAt         int64            `json:"createdAt"`
	CreatedBy         *string          `json:"createdBy"`
	RevokedAt         *int64           `json:"revokedAt"`
	LastRedeemedAt    *int64           `json:"lastRedeemedAt"`
	RotatedFrom       *string          `json:"rotatedFrom"`
	RotatedTo         *string          `json:"rotatedTo"`
}

AccessLink is the status projection. It never contains the one-time capability returned by create and rotate.

type AccessLinkCreateParams added in v0.3.0

type AccessLinkCreateParams struct {
	Label             NullableField[string]
	ExpiresAt         int64
	MaxRedemptions    int
	MaxQuantity       int
	SessionTTLSeconds int
	IncludePublic     *bool
	Reason            string
	IdempotencyKey    string
}

AccessLinkCreateParams configures a hosted link. The response capability is revealed once and the operation is never automatically retried.

type AccessLinkList struct {
	Links []AccessLinkListItem `json:"links"`
}

type AccessLinkListItem added in v0.3.0

type AccessLinkListItem struct {
	AccessLink
	ActiveSessions int `json:"activeSessions"`
}

type AccessLinkReveal added in v0.3.0

type AccessLinkReveal struct {
	Link          AccessLink  `json:"link"`
	URL           string      `json:"url"`
	Capability    string      `json:"capability"`
	RevealedOnce  bool        `json:"revealedOnce"`
	Previous      *AccessLink `json:"previous,omitempty"`
	EndedSessions *int        `json:"endedSessions,omitempty"`
}

AccessLinkReveal contains a capability that the API will never return again.

type AccessLinkRevokeParams added in v0.3.0

type AccessLinkRevokeParams struct {
	EndActiveSessions bool
	Reason            string
}

AccessLinkRevokeParams controls optional session cascade and audit reason.

type AccessLinkRevokeResult added in v0.3.0

type AccessLinkRevokeResult struct {
	OK            bool       `json:"ok"`
	Link          AccessLink `json:"link"`
	EndedSessions int        `json:"endedSessions"`
}

type AccessLinkRotateParams added in v0.3.0

type AccessLinkRotateParams struct {
	EndActiveSessions bool
	Reason            string
}

AccessLinkRotateParams requires the caller to choose whether old sessions end.

type AccessLinkState added in v0.3.0

type AccessLinkState string

AccessLinkState is the stored lifecycle state of a hosted link.

const (
	AccessLinkActive  AccessLinkState = "active"
	AccessLinkRevoked AccessLinkState = "revoked"
	AccessLinkRotated AccessLinkState = "rotated"
)

type AccessLinkStatus added in v0.3.0

type AccessLinkStatus string

AccessLinkStatus includes derived expiry and redemption-exhaustion states.

const (
	AccessLinkStatusActive    AccessLinkStatus = "active"
	AccessLinkStatusRevoked   AccessLinkStatus = "revoked"
	AccessLinkStatusRotated   AccessLinkStatus = "rotated"
	AccessLinkStatusExpired   AccessLinkStatus = "expired"
	AccessLinkStatusExhausted AccessLinkStatus = "exhausted"
)

type AuthError

type AuthError struct{ APIError }

AuthError is a 401 or 403 — bad key, revoked key, or a live key used against a test event.

func (*AuthError) ModeMismatch

func (e *AuthError) ModeMismatch() bool

ModeMismatch reports whether the key's mode and the event's mode disagree. This is the most common cause of a "works locally, 403s in production" report.

type BestAvailableParams

type BestAvailableParams struct {
	// Qty is clamped to the server maximum rather than rejected.
	Qty         int
	CategoryKey string
	ZoneID      string
	// TTLMs overrides the event's checkout window. Ignored by BookBestAvailable.
	TTLMs int64
	// BookingRef is required by BookBestAvailable and ignored by HoldBestAvailable.
	BookingRef     string
	IdempotencyKey string
	ChannelIDs     []string
	// IgnoreChannelRestrictions is a privileged backend override.
	IgnoreChannelRestrictions bool
	// Reason is written to the audit trail for channel use or an override.
	Reason string
}

BestAvailableParams asks us to choose the objects.

type BookParams

type BookParams struct {
	// HoldID books a previously held selection…
	HoldID string
	// …or Labels books outright, with no prior hold.
	Labels         []string
	BookingRef     string
	IdempotencyKey string
	ChannelIDs     []string
	// IgnoreChannelRestrictions is a privileged backend override.
	IgnoreChannelRestrictions bool
	// Reason is written to the audit trail for channel use or an override.
	Reason string
}

BookParams books either a held selection or labels outright.

type BookingListParams added in v0.2.0

type BookingListParams struct {
	Query  string
	State  string
	Limit  int
	Cursor string
}

BookingListParams filters and pages booking lifecycle records.

type BuyerAccessSessionListParams added in v0.2.0

type BuyerAccessSessionListParams struct {
	Limit int
}

BuyerAccessSessionListParams limits the buyer access-session projection.

type BuyerAccessSessionNullableFields added in v0.3.0

type BuyerAccessSessionNullableFields struct {
	MaxQuantity     NullableField[int]
	BuyerRef        NullableField[string]
	PartnerRef      NullableField[string]
	ClientRequestID NullableField[string]
}

BuyerAccessSessionNullableFields sends an explicit null for optional buyer metadata instead of silently applying the API default.

type BuyerAccessSessionParams added in v0.2.0

type BuyerAccessSessionParams struct {
	ChannelIDs       []string
	IncludePublic    bool
	AllowedOrigin    string
	ExpiresInSeconds int
	MaxQuantity      int
	BuyerRef         string
	PartnerRef       string
	ClientRequestID  string
	IdempotencyKey   string
	// Nullable overrides fields when explicit JSON null is different from omission.
	Nullable BuyerAccessSessionNullableFields
}

BuyerAccessSessionParams defines the security boundary of a buyer token.

type ChannelArchiveParams added in v0.3.0

type ChannelArchiveParams struct {
	Destination NullableField[string]
	Reason      string
}

ChannelArchiveParams permits the contract's explicit null destination.

type ChannelAssignmentParams added in v0.2.0

type ChannelAssignmentParams struct {
	Labels            []string
	AssignmentVersion int64
	TargetChannelID   string
	Reason            string
	IdempotencyKey    string
}

ChannelAssignmentParams moves inventory between public and private allocation.

type ChannelCreateParams added in v0.2.0

type ChannelCreateParams struct {
	Name           string
	Color          string
	Marker         string
	ExternalRef    string
	AccessIntent   string
	Reason         string
	IdempotencyKey string
}

ChannelCreateParams defines a private allocation channel.

type ChannelUpdateParams added in v0.2.0

type ChannelUpdateParams struct {
	Name                  string
	AccessIntent          string
	AcknowledgeLiveAccess *bool
	Reason                string
}

ChannelUpdateParams defines mutable channel fields.

type ChannelsService added in v0.2.0

type ChannelsService struct {
	// contains filtered or unexported fields
}

ChannelsService manages private allocations, reporting, and buyer access.

func (*ChannelsService) Archive added in v0.2.0

func (s *ChannelsService) Archive(
	ctx context.Context, eventKey, channelID string, p ChannelArchiveParams,
) (map[string]any, error)

Archive retires a channel with an explicit destination value.

func (s *ChannelsService) CreateAccessLink(
	ctx context.Context, eventKey, channelID string, p AccessLinkCreateParams,
) (AccessLinkReveal, error)

CreateAccessLink mints a hosted link and its one-time capability.

func (*ChannelsService) CreateBuyerAccessSession added in v0.2.0

func (s *ChannelsService) CreateBuyerAccessSession(
	ctx context.Context, eventKey string, p BuyerAccessSessionParams,
) (map[string]any, error)

CreateBuyerAccessSession mints a short-lived, origin-bound buyer token.

func (*ChannelsService) CreateChannel added in v0.2.0

func (s *ChannelsService) CreateChannel(
	ctx context.Context, eventKey string, p ChannelCreateParams,
) (map[string]any, error)

CreateChannel creates a private allocation channel.

func (s *ChannelsService) ListAccessLinks(
	ctx context.Context, eventKey, channelID string,
) (AccessLinkList, error)

ListAccessLinks returns status only, never a stored capability.

func (*ChannelsService) ListAllocation added in v0.2.0

func (s *ChannelsService) ListAllocation(
	ctx context.Context, eventKey, afterLabel string, limit int,
) (map[string]any, error)

ListAllocation returns the current allocation ledger.

func (*ChannelsService) ListBuyerAccessSessions added in v0.2.0

func (s *ChannelsService) ListBuyerAccessSessions(
	ctx context.Context, eventKey string, p BuyerAccessSessionListParams,
) (map[string]any, error)

ListBuyerAccessSessions returns one page of buyer access sessions.

func (*ChannelsService) ListChannels added in v0.2.0

func (s *ChannelsService) ListChannels(
	ctx context.Context, eventKey string, includeArchived bool,
) (map[string]any, error)

ListChannels lists an event's allocation channels.

func (*ChannelsService) Pause added in v0.2.0

func (s *ChannelsService) Pause(
	ctx context.Context, eventKey, channelID, reason string,
) (map[string]any, error)

Pause temporarily disables a channel.

func (*ChannelsService) RetrieveAccessPreview added in v0.2.0

func (s *ChannelsService) RetrieveAccessPreview(
	ctx context.Context, eventKey string, channelIDs []string, includePublic *bool,
) (map[string]any, error)

RetrieveAccessPreview shows the inventory visible to a buyer access scope.

func (*ChannelsService) RetrieveReport added in v0.2.0

func (s *ChannelsService) RetrieveReport(
	ctx context.Context, eventKey string,
) (map[string]any, error)

RetrieveReport returns channel allocation totals.

func (s *ChannelsService) RevokeAccessLink(
	ctx context.Context, eventKey, channelID, linkID string,
	options ...AccessLinkRevokeParams,
) (AccessLinkRevokeResult, error)

RevokeAccessLink stops a hosted link from admitting new buyers.

func (*ChannelsService) RevokeBuyerAccessSession added in v0.2.0

func (s *ChannelsService) RevokeBuyerAccessSession(
	ctx context.Context, eventKey, sessionID string,
) (map[string]any, error)

RevokeBuyerAccessSession revokes a buyer token before it expires.

func (s *ChannelsService) RotateAccessLink(
	ctx context.Context, eventKey, channelID, linkID string, p AccessLinkRotateParams,
) (AccessLinkReveal, error)

RotateAccessLink replaces a hosted link and reveals the successor once.

func (*ChannelsService) Unpause added in v0.2.0

func (s *ChannelsService) Unpause(
	ctx context.Context, eventKey, channelID, reason string,
) (map[string]any, error)

Unpause restores a paused channel.

func (*ChannelsService) UpdateAssignments added in v0.2.0

func (s *ChannelsService) UpdateAssignments(
	ctx context.Context, eventKey string, p ChannelAssignmentParams,
) (map[string]any, error)

UpdateAssignments changes the allocation owner of inventory labels.

func (*ChannelsService) UpdateChannel added in v0.2.0

func (s *ChannelsService) UpdateChannel(
	ctx context.Context, eventKey, channelID string, p ChannelUpdateParams,
) (map[string]any, error)

UpdateChannel updates a private allocation channel.

type ChartCopyParams added in v0.3.0

type ChartCopyParams struct {
	Name           string
	ExternalRef    NullableField[string]
	WorkspaceID    string
	IdempotencyKey string
}

ChartCopyParams overrides fields inherited from the source chart.

type ChartCreateParams

type ChartCreateParams struct {
	Name        string
	Doc         map[string]any
	ExternalRef string
	WorkspaceID string
	// IdempotencyKey makes a retried create collapse into the original.
	IdempotencyKey string
}

ChartCreateParams describes a new chart.

type ChartListParams

type ChartListParams struct {
	WorkspaceID string
	ExternalRef string
	Archived    bool
	// Limit is the page size. Clamped server-side; asking for more is not an error.
	Limit int
	// Cursor continues a previous page. Leave empty to start.
	Cursor string
}

ChartListParams filters and pages a chart listing.

type ChartUpdateParams added in v0.3.0

type ChartUpdateParams struct {
	Doc               map[string]any
	ExpectedUpdatedAt int64
	Name              string
	Issues            *float64
	ExternalRef       NullableField[string]
}

ChartUpdateParams supports both the optimistic document-replacement branch and the metadata-only branch of the chart update contract.

type ChartsService

type ChartsService struct {
	// contains filtered or unexported fields
}

ChartsService covers seat-map definitions that events are created from.

Even when organisers draw their own venues in the embedded Designer you need this: CreateDesignerSession requires a chart id that already exists, so the usual platform flow is copy a template here, then hand over a session.

func (*ChartsService) All

All walks every chart, paging transparently.

for chart, err := range client.Charts.All(ctx, nil) { ... }

func (*ChartsService) Archive

func (s *ChartsService) Archive(ctx context.Context, chartID string) (map[string]any, error)

Archive moves a chart to the archive.

func (*ChartsService) Copy

func (s *ChartsService) Copy(
	ctx context.Context, chartID string, options ...ChartCopyParams,
) (map[string]any, error)

Copy duplicates a chart — the usual way to provision a venue from a template.

func (*ChartsService) Create

func (s *ChartsService) Create(ctx context.Context, p ChartCreateParams) (map[string]any, error)

Create makes a chart. Pass Doc to import an existing document.

func (*ChartsService) Delete

func (s *ChartsService) Delete(ctx context.Context, chartID string) error

Delete removes a chart.

func (*ChartsService) List

func (s *ChartsService) List(ctx context.Context, p *ChartListParams) (Page, error)

List returns one page of charts.

func (*ChartsService) Publish

func (s *ChartsService) Publish(ctx context.Context, chartID string) (map[string]any, error)

Publish publishes the draft. Events can only be created from a published chart.

func (*ChartsService) Retrieve

func (s *ChartsService) Retrieve(ctx context.Context, chartID string) (map[string]any, error)

Retrieve fetches a chart and its document.

func (*ChartsService) Unarchive

func (s *ChartsService) Unarchive(ctx context.Context, chartID string) (map[string]any, error)

Unarchive restores a chart from the archive.

func (*ChartsService) Update

func (s *ChartsService) Update(
	ctx context.Context, chartID string, p ChartUpdateParams,
) (map[string]any, error)

Update changes a document and/or chart metadata. ExpectedUpdatedAt is required whenever Doc is supplied so concurrent writers cannot silently overwrite each other. ExternalRef can be FieldNull[string]() to clear it.

type Client

type Client struct {
	Charts            *ChartsService
	Channels          *ChannelsService
	Events            *EventsService
	EventSeries       *EventSeriesService
	Holders           *HoldersService
	Inventory         *InventoryService
	Orders            *OrdersService
	PerformanceGroups *PerformanceGroupsService
	Seasons           *SeasonsService
	Sessions          *SessionsService
	Templates         *TemplatesService
	Webhooks          *WebhooksService
	Workspaces        *WorkspacesService
	// contains filtered or unexported fields
}

Client talks to the SeatLayer server API.

It is safe for concurrent use: the underlying http.Client is, and Client holds no mutable state of its own.

func New

func New(secretKey string, options ...Option) (*Client, error)

New builds a Client from a secret key.

It returns an error rather than panicking on a bad key, so a misconfigured deployment fails at startup with a message that names the problem.

func (*Client) Do

func (c *Client) Do(
	ctx context.Context,
	method, path string,
	query url.Values,
	body any,
	idempotencyKey string,
) (map[string]any, error)

Do is the escape hatch for surface this SDK does not wrap yet. Reads retain retries; raw mutations are single-attempt because their replay contract is unknown.

func (*Client) Mode

func (c *Client) Mode() string

Mode reports "live" or "test", derived from the key prefix.

func (*Client) Ready

func (c *Client) Ready(ctx context.Context) (map[string]any, error)

Ready runs the dependency-aware readiness probe.

type ConflictError

type ConflictError struct{ APIError }

ConflictError is a 409 — the seats moved under you.

Normal in ticketing, not exceptional: two buyers wanted the same seat and one lost.

func (*ConflictError) Conflicts

func (e *ConflictError) Conflicts() []map[string]any

Conflicts returns the per-object conflicts, when the endpoint reports them.

func (*ConflictError) SoldOut

func (e *ConflictError) SoldOut() bool

SoldOut reports whether best-available could not find enough free inventory.

type ConnectionError

type ConnectionError struct {
	Op  string
	Err error
}

ConnectionError means the request never got an answer: DNS, TLS, socket, or a context deadline.

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

func (*ConnectionError) Unwrap

func (e *ConnectionError) Unwrap() error

Unwrap lets errors.Is reach the underlying cause, so a caller can still test for context.DeadlineExceeded or a net error.

type CustomerListParams added in v0.9.0

type CustomerListParams struct {
	Email     string
	HolderRef string
	Cursor    string
	Limit     int
}

CustomerListParams filters and pages the organization's customers.

type DesignerSafeModeOptions added in v0.3.0

type DesignerSafeModeOptions struct {
	AllowDeletingObjects     bool `json:"allowDeletingObjects"`
	AllowEditingAreaCapacity bool `json:"allowEditingAreaCapacity"`
}

type DesignerSafeModeOptionsParams added in v0.3.0

type DesignerSafeModeOptionsParams struct {
	AllowDeletingObjects     *bool `json:"allowDeletingObjects,omitempty"`
	AllowEditingAreaCapacity *bool `json:"allowEditingAreaCapacity,omitempty"`
}

DesignerSafeModeOptionsParams is partial request input. Pointers preserve explicit false values without overriding an omitted server default.

type DesignerSession added in v0.3.0

type DesignerSession struct {
	ID              string                  `json:"id"`
	Token           string                  `json:"token"`
	WorkspaceID     string                  `json:"workspaceId"`
	ChartID         string                  `json:"chartId"`
	AllowedOrigin   string                  `json:"allowedOrigin"`
	Authority       string                  `json:"authority"`
	CanEdit         bool                    `json:"canEdit"`
	CanPublish      bool                    `json:"canPublish"`
	Mode            string                  `json:"mode"`
	SafeModeOptions DesignerSafeModeOptions `json:"safeModeOptions"`
	FeaturePolicy   map[string]any          `json:"featurePolicy"`
	ExpiresAt       int64                   `json:"expiresAt"`
	DesignerURL     string                  `json:"designerUrl"`
}

type DesignerSessionEnvelope added in v0.3.0

type DesignerSessionEnvelope struct {
	Session DesignerSession `json:"session"`
}

type DesignerSessionParams

type DesignerSessionParams struct {
	WorkspaceID string
	// ChartID must already exist — create or copy a chart first.
	ChartID       string
	AllowedOrigin string
	// Authority is "read-only", "edit", or "publish".
	Authority string
	// CanPublish is the legacy authority flag; when supplied it must agree with
	// Authority. A pointer preserves an explicit false value.
	CanPublish *bool
	// Mode is "normal" or "safe".
	Mode string
	// SafeModeOptions is accepted only when Mode is "safe".
	SafeModeOptions *DesignerSafeModeOptionsParams
	// Features carries the Designer feature-policy object.
	Features         map[string]any
	ExpiresInSeconds int
}

DesignerSessionParams scopes an embedded-Designer token.

type EventBuyerCheckoutParams added in v0.9.0

type EventBuyerCheckoutParams struct {
	// BuyerCheckout is "seatlayer" or "integrator".
	BuyerCheckout    string
	ExpectedRevision int
}

EventBuyerCheckoutParams chooses who takes payment for an event.

type EventChartUpdateParams added in v0.3.0

type EventChartUpdateParams struct {
	AcknowledgeDroppedAssignments *bool
	Reason                        string
}

EventChartUpdateParams acknowledges assignment changes caused by a new chart.

type EventConfigurationBinding added in v0.6.0

type EventConfigurationBinding struct {
	Configuration *EventConfigurationRef           `json:"configuration"`
	Revision      int64                            `json:"revision"`
	ChangedBy     *string                          `json:"changedBy"`
	ChangedAt     *int64                           `json:"changedAt"`
	Audit         []EventConfigurationBindingAudit `json:"audit"`
}

EventConfigurationBinding is the Event's current immutable configuration selection plus its compare-and-set revision and audit trail.

type EventConfigurationBindingAudit added in v0.6.0

type EventConfigurationBindingAudit struct {
	ID        string                 `json:"id"`
	From      *EventConfigurationRef `json:"from"`
	To        *EventConfigurationRef `json:"to"`
	Revision  int64                  `json:"revision"`
	Actor     string                 `json:"actor"`
	CreatedAt int64                  `json:"createdAt"`
}

EventConfigurationBindingAudit records one binding revision.

type EventConfigurationBindingUpdateParams added in v0.6.0

type EventConfigurationBindingUpdateParams struct {
	ExpectedRevision int64
	Configuration    *EventConfigurationRef
}

EventConfigurationBindingUpdateParams attaches an exact published version. A nil Configuration explicitly detaches the current selection.

type EventConfigurationRef added in v0.6.0

type EventConfigurationRef struct {
	ID      string `json:"id"`
	Version int64  `json:"version"`
}

EventConfigurationRef selects one immutable published configuration version. Configuration identity remains separate from the chart's venue geometry.

type EventCreateNullableFields added in v0.3.0

type EventCreateNullableFields struct {
	StartsAt      NullableField[int64]
	Venue         NullableField[string]
	ExternalRef   NullableField[string]
	Currency      NullableField[string]
	Description   NullableField[string]
	EndsAt        NullableField[int64]
	Timezone      NullableField[string]
	Locale        NullableField[string]
	PosterAssetID NullableField[string]
}

EventCreateNullableFields optionally overrides the convenience scalar fields on EventCreateParams when a caller must send explicit JSON null.

type EventCreateParams

type EventCreateParams struct {
	// ChartID must reference a published chart.
	ChartID string
	Name    string
	Slug    string
	// StartsAt is epoch milliseconds.
	StartsAt    int64
	Venue       string
	ExternalRef string
	// Currency overrides the organisation currency for this event.
	Currency    string
	Description string
	// EndsAt is epoch milliseconds.
	EndsAt        int64
	Timezone      string
	Locale        string
	PosterAssetID string
	// Region places live inventory near the venue. Empty defaults to Western Europe.
	Region EventHostingRegion
	// Mode is normally inferred from the secret key; when supplied it must match.
	Mode           string
	IdempotencyKey string
	// Nullable overrides convenience scalar fields when explicit JSON null is
	// semantically different from omission.
	Nullable EventCreateNullableFields
}

EventCreateParams describes a new event.

type EventDiscountCodeCreateParams added in v0.9.0

type EventDiscountCodeCreateParams struct {
	Code string
	// Kind is "percent" or "amount".
	Kind        string
	Percent     int
	AmountMinor int64
	// StartsAt and EndsAt are epoch milliseconds.
	StartsAt int64
	EndsAt   int64
	MaxUses  int
	// Active is sent only when set, so an explicit false is possible.
	Active *bool
}

EventDiscountCodeCreateParams creates a discount code. Zero values are left out, except Code and Kind, which are always sent.

type EventDiscountCodeUpdateParams added in v0.9.0

type EventDiscountCodeUpdateParams struct {
	Code string
	// Kind is "percent" or "amount".
	Kind        string
	Percent     int
	AmountMinor int64
	// StartsAt and EndsAt are epoch milliseconds.
	StartsAt NullableField[int64]
	EndsAt   NullableField[int64]
	MaxUses  NullableField[int]
	// Active is sent only when set, so an explicit false is possible.
	Active *bool
	// State is "active" or "paused".
	State string
}

EventDiscountCodeUpdateParams changes or pauses a discount code. Zero values are left out; use FieldNull to clear StartsAt, EndsAt or MaxUses.

type EventHostingRegion added in v0.8.0

type EventHostingRegion string

EventHostingRegion is a provider-neutral Event inventory placement preference.

const (
	RegionWesternEurope    EventHostingRegion = "western-europe"
	RegionEasternEurope    EventHostingRegion = "eastern-europe"
	RegionNorthAmericaEast EventHostingRegion = "north-america-east"
	RegionNorthAmericaWest EventHostingRegion = "north-america-west"
	RegionSouthAmerica     EventHostingRegion = "south-america"
	RegionAsiaPacific      EventHostingRegion = "asia-pacific"
	RegionNortheastAsia    EventHostingRegion = "northeast-asia"
	RegionSoutheastAsia    EventHostingRegion = "southeast-asia"
	RegionOceania          EventHostingRegion = "oceania"
	RegionAfrica           EventHostingRegion = "africa"
	RegionMiddleEast       EventHostingRegion = "middle-east"
)

type EventListParams

type EventListParams struct {
	WorkspaceID string
	ExternalRef string
	// Limit is the page size. Clamped server-side; asking for more is not an error.
	Limit int
	// Cursor continues a previous page. Leave empty to start.
	Cursor string
	// NoCounts drops live availability counts, which cost the server one
	// round-trip per event. All sets this automatically.
	NoCounts bool
	// SeriesKey lists only the dates of this event series.
	SeriesKey string
}

EventListParams filters and pages an event listing.

type EventLogEntry added in v0.3.0

type EventLogEntry struct {
	ID     int64    `json:"id"`
	At     int64    `json:"at"`
	Action string   `json:"action"`
	Labels []string `json:"labels"`
	Ref    *string  `json:"ref"`
}

type EventLogListParams added in v0.3.0

type EventLogListParams struct {
	Limit  int
	Before int64
}

EventLogListParams pages an event audit log newest first.

type EventLogPage added in v0.3.0

type EventLogPage struct {
	Entries    []EventLogEntry `json:"entries"`
	NextBefore *int64          `json:"nextBefore"`
}

type EventOrderExportParams added in v0.9.0

type EventOrderExportParams struct {
	// Q searches buyer name, email, order number or seat.
	Q      string
	Status string
	PaidBy string
	// From and To bound the payment time, in epoch milliseconds.
	From int64
	To   int64
}

EventOrderExportParams filters the event orders CSV export.

type EventOrderListParams added in v0.9.0

type EventOrderListParams struct {
	// Q searches buyer name, email, order number or seat.
	Q      string
	Status string
	PaidBy string
	// From and To bound the payment time, in epoch milliseconds.
	From   int64
	To     int64
	Cursor string
	Limit  int
}

EventOrderListParams filters and pages one event's orders.

type EventPaymentGatewayParams added in v0.9.0

type EventPaymentGatewayParams struct {
	ConnectionID NullableField[string]
	Provider     NullableField[string]
}

EventPaymentGatewayParams assigns a connected gateway to an event. Use FieldNull to send an explicit null.

type EventSalesTransitionParams added in v0.9.0

type EventSalesTransitionParams struct {
	// To is one of setup, testable, live, paused or ended.
	To               string
	ExpectedRevision int
	// Reason is optional. Empty leaves it out.
	Reason string
}

EventSalesTransitionParams moves an event's sales to another state.

type EventSeriesCreateParams added in v0.9.0

type EventSeriesCreateParams struct {
	// Name is the series name; every date carries it as its name. Leave it
	// empty with FromEventKey, which takes the event's own name.
	Name string
	// ChartKey is a published floor plan of this organization. Leave it empty
	// with FromEventKey.
	ChartKey string
	Schedule EventSeriesSchedule
	// Timezone is the IANA zone the schedule is read in. Empty leaves it out.
	Timezone string
	Venue    string
	// DurationMinutes sets each date's end. Zero leaves it out.
	DurationMinutes int
	// DryRun answers the dates the schedule makes and creates nothing.
	DryRun         bool
	IdempotencyKey string
	// FromEventKey makes the series from an event you already set up: it
	// becomes the first date under its own key, and every other date is a copy
	// of it (floor plan, prices, checkout, poster and its own seat blocks, none
	// of its orders, holds or sales). The series takes the event's name, zone
	// and floor plan, so leave Name, ChartKey, Venue and DurationMinutes empty.
	FromEventKey string
}

EventSeriesCreateParams plans an event series from a schedule.

type EventSeriesDatesParams added in v0.9.0

type EventSeriesDatesParams struct {
	Schedule *EventSeriesSchedule
	Dates    []string
	// RetryFailed makes again every date that failed to be made (up to 100, as
	// in job.failedDates): 422 nothing_to_retry when none did, 409 series_busy
	// while another change runs. Give it alone, without Schedule or Dates.
	RetryFailed    bool
	IdempotencyKey string
}

EventSeriesDatesParams adds dates to a series: set Schedule, or Dates as exact moments (YYYY-MM-DDTHH:MM in the series' zone), not both.

type EventSeriesListParams added in v0.9.0

type EventSeriesListParams struct {
	Limit  int
	Cursor string
}

EventSeriesListParams pages the event series listing.

type EventSeriesPriceCategory added in v0.9.0

type EventSeriesPriceCategory struct {
	Key   string
	Price NullableField[float64]
	Tiers []EventSeriesPriceTier
}

EventSeriesPriceCategory is one floor plan category's price. Use FieldNull to send an explicit null price.

type EventSeriesPriceTier added in v0.9.0

type EventSeriesPriceTier struct {
	ID    string  `json:"id"`
	Price float64 `json:"price"`
}

EventSeriesPriceTier is one tier price inside a category.

type EventSeriesPrices added in v0.9.0

type EventSeriesPrices struct {
	Categories []EventSeriesPriceCategory
}

EventSeriesPrices lists only the categories whose price changes (for a tiered category, only the tiers sent), each as the event pricing route takes it. Every price left out keeps each date's own value. New orders pay these.

type EventSeriesSchedule added in v0.9.0

type EventSeriesSchedule struct {
	Rule string `json:"rule"`
	// From is the first day. Required unless Rule is "dates".
	From string `json:"from,omitempty"`
	// Until is the last day, inclusive. Give Until or Count, not both.
	Until string `json:"until,omitempty"`
	Count int    `json:"count,omitempty"`
	// Times are the start times on each day: one date per day and time.
	Times []string `json:"times"`
	Skip  []string `json:"skip,omitempty"`
	// Dates are the days for Rule "dates".
	Dates []string `json:"dates,omitempty"`
}

EventSeriesSchedule describes the dates of a series. Rule is one of none, daily, weekly, biweekly or dates. Days are YYYY-MM-DD, times are HH:MM and skipped moments are YYYY-MM-DDTHH:MM, all in the series' zone.

type EventSeriesService added in v0.9.0

type EventSeriesService struct {
	// contains filtered or unexported fields
}

EventSeriesService plans and manages event series: runs of dated events made from one floor plan and a schedule.

func (*EventSeriesService) AddDates added in v0.9.0

func (s *EventSeriesService) AddDates(
	ctx context.Context, eventKey string, p EventSeriesDatesParams,
) (map[string]any, error)

AddDates adds dates to an event series, copied from its first date.

func (*EventSeriesService) Create added in v0.9.0

Create plans an event series from a schedule, or makes it as a job. Retried safely with one IdempotencyKey. A series from an event that never started and was given up answers 409 create_abandoned (a *ConflictError) for that key every time: send the request again with a new IdempotencyKey.

func (*EventSeriesService) List added in v0.9.0

List lists event series, one cursor page at a time.

func (*EventSeriesService) Retrieve added in v0.9.0

func (s *EventSeriesService) Retrieve(ctx context.Context, eventKey string) (map[string]any, error)

Retrieve fetches an event series, its dates and its job.

func (*EventSeriesService) Update added in v0.9.0

func (s *EventSeriesService) Update(
	ctx context.Context, eventKey string, p EventSeriesUpdateParams,
) (map[string]any, error)

Update changes the name, prices or sales of every upcoming date. Send only the prices that change: each date keeps its own price for the rest.

type EventSeriesUpdateParams added in v0.9.0

type EventSeriesUpdateParams struct {
	Name   string
	Prices *EventSeriesPrices
	// Sales is "on" or "off". "on" never opens a date its season cancelled:
	// that date is a failed item of the job (season_date_cancelled), counted
	// in job.failed but not in failedDates, which are the dates that could
	// not be made.
	Sales          string
	IdempotencyKey string
}

EventSeriesUpdateParams changes every upcoming date of a series. Empty fields are left out.

type EventsService

type EventsService struct {
	// contains filtered or unexported fields
}

EventsService covers event lifecycle, metadata and reports.

func (*EventsService) All

All walks every event, paging transparently.

Counts are dropped by default here — you are walking the whole list, so per-event availability is rarely what you want and always what it costs.

func (*EventsService) Archive

func (s *EventsService) Archive(ctx context.Context, eventKey string) (map[string]any, error)

Archive moves an event to the archive, preserving reporting.

func (*EventsService) Close

func (s *EventsService) Close(ctx context.Context, eventKey string) (map[string]any, error)

Close stops buyer sales. Existing holds keep their TTL.

func (*EventsService) CloseTicketRelease added in v0.4.0

func (s *EventsService) CloseTicketRelease(
	ctx context.Context, eventKey, releaseID string,
) (TicketReleaseList, error)

CloseTicketRelease closes one release immediately while preserving it for reporting. It remains single-attempt because it has no replay contract.

func (*EventsService) Create

func (s *EventsService) Create(ctx context.Context, p EventCreateParams) (map[string]any, error)

Create makes an event from a published chart.

func (*EventsService) CreateDiscountCode added in v0.9.0

func (s *EventsService) CreateDiscountCode(
	ctx context.Context, eventKey string, p EventDiscountCodeCreateParams,
) (map[string]any, error)

CreateDiscountCode creates a discount code for an event. It has no replay contract, so it is single-attempt.

func (*EventsService) Delete

func (s *EventsService) Delete(ctx context.Context, eventKey string) error

Delete soft-deletes an event.

func (*EventsService) DeleteDiscountCode added in v0.9.0

func (s *EventsService) DeleteDiscountCode(ctx context.Context, eventKey, codeID string) error

DeleteDiscountCode deletes a discount code nobody has used. The API answers 204 with no body, so only an error comes back. It is single-attempt.

func (*EventsService) DeletePoster added in v0.3.0

func (s *EventsService) DeletePoster(
	ctx context.Context, eventKey string,
) (map[string]any, error)

DeletePoster removes the event poster used by share cards.

func (*EventsService) EndDiscountCode added in v0.9.0

func (s *EventsService) EndDiscountCode(
	ctx context.Context, eventKey, codeID string,
) (map[string]any, error)

EndDiscountCode ends a discount code for good. It is single-attempt.

func (*EventsService) List

func (s *EventsService) List(ctx context.Context, p *EventListParams) (Page, error)

List returns one page of events, including live availability counts unless NoCounts is set.

func (*EventsService) ListDiscountCodes added in v0.9.0

func (s *EventsService) ListDiscountCodes(ctx context.Context, eventKey string) (map[string]any, error)

ListDiscountCodes lists an event's discount codes.

func (*EventsService) ListTicketReleases added in v0.4.0

func (s *EventsService) ListTicketReleases(ctx context.Context, eventKey string) (TicketReleaseList, error)

ListTicketReleases returns releases with server-computed quota consumption.

func (*EventsService) PreflightSales added in v0.9.0

func (s *EventsService) PreflightSales(
	ctx context.Context, eventKey, orderID string,
) (map[string]any, error)

PreflightSales records a test order as the event's sales preflight. It has no replay contract, so it is single-attempt.

func (*EventsService) Reopen

func (s *EventsService) Reopen(ctx context.Context, eventKey string) (map[string]any, error)

Reopen resumes buyer sales. A date its season cancelled never opens again: 409 season_date_cancelled.

func (*EventsService) ReplaceBookingFee added in v0.9.0

func (s *EventsService) ReplaceBookingFee(
	ctx context.Context, eventKey string, bookingFeeMinor ...int64,
) (map[string]any, error)

ReplaceBookingFee sets or clears an event's booking fee, in minor units. Omit bookingFeeMinor to send JSON null and clear the fee. It has no replay contract, so it is single-attempt.

func (*EventsService) ReplaceBuyerCheckout added in v0.9.0

func (s *EventsService) ReplaceBuyerCheckout(
	ctx context.Context, eventKey string, p EventBuyerCheckoutParams,
) (map[string]any, error)

ReplaceBuyerCheckout chooses SeatLayer checkout or your own for an event. It is a compare-and-set on ExpectedRevision and is single-attempt.

func (*EventsService) ReplacePaymentGateway added in v0.9.0

func (s *EventsService) ReplacePaymentGateway(
	ctx context.Context, eventKey string, p *EventPaymentGatewayParams,
) (map[string]any, error)

ReplacePaymentGateway assigns one of the organization's connected gateways to an event. It has no replay contract, so it is single-attempt. Pass nil to send no body.

func (*EventsService) Retrieve

func (s *EventsService) Retrieve(ctx context.Context, eventKey string) (map[string]any, error)

Retrieve fetches an event with live counts.

func (*EventsService) RetrieveBookingFee added in v0.9.0

func (s *EventsService) RetrieveBookingFee(ctx context.Context, eventKey string) (map[string]any, error)

RetrieveBookingFee reads an event's booking fee.

func (*EventsService) RetrieveBuyerCheckout added in v0.9.0

func (s *EventsService) RetrieveBuyerCheckout(ctx context.Context, eventKey string) (map[string]any, error)

RetrieveBuyerCheckout reads who takes payment for an event, and what blocks a change.

func (*EventsService) RetrieveConfigurationBinding added in v0.6.0

func (s *EventsService) RetrieveConfigurationBinding(
	ctx context.Context, eventKey string,
) (EventConfigurationBinding, error)

RetrieveConfigurationBinding reads the Event's exact immutable configuration selection and audit history.

func (*EventsService) RetrieveHoldTTL

func (s *EventsService) RetrieveHoldTTL(ctx context.Context, eventKey string) (map[string]any, error)

RetrieveHoldTTL reads the checkout window buyers get for this event.

func (*EventsService) RetrieveLog

func (s *EventsService) RetrieveLog(
	ctx context.Context, eventKey string, options ...EventLogListParams,
) (EventLogPage, error)

RetrieveLog fetches one page of the event audit log.

func (*EventsService) RetrievePaymentGateway added in v0.9.0

func (s *EventsService) RetrievePaymentGateway(
	ctx context.Context, eventKey, currency string,
) (map[string]any, error)

RetrievePaymentGateway reads an event's payment gateway and the ones it could use. A non-empty currency checks the options against it instead of the event's own.

func (*EventsService) RetrieveReport

func (s *EventsService) RetrieveReport(ctx context.Context, eventKey string) (map[string]any, error)

RetrieveReport fetches the event report.

func (*EventsService) RetrieveSalesReadiness added in v0.9.0

func (s *EventsService) RetrieveSalesReadiness(ctx context.Context, eventKey string) (map[string]any, error)

RetrieveSalesReadiness reads what an event still needs before its next sales step.

func (*EventsService) TransitionSales added in v0.9.0

func (s *EventsService) TransitionSales(
	ctx context.Context, eventKey string, p EventSalesTransitionParams,
) (map[string]any, error)

TransitionSales moves an event's sales to testable, live, paused or ended. It is a compare-and-set on ExpectedRevision and is single-attempt. A date its season cancelled never opens again: moving it to testable or live answers 409 season_date_cancelled.

func (*EventsService) Update

func (s *EventsService) Update(ctx context.Context, eventKey string, fields map[string]any) (map[string]any, error)

Update changes event metadata.

func (*EventsService) UpdateChart

func (s *EventsService) UpdateChart(
	ctx context.Context, eventKey string, options ...EventChartUpdateParams,
) (map[string]any, error)

UpdateChart moves a live event onto the latest published version of its chart. The optional params value preserves the original no-argument call shape.

func (*EventsService) UpdateConfigurationBinding added in v0.6.0

func (s *EventsService) UpdateConfigurationBinding(
	ctx context.Context, eventKey string, p EventConfigurationBindingUpdateParams,
) (EventConfigurationBinding, error)

UpdateConfigurationBinding attaches an exact published configuration version, or explicitly detaches it when Configuration is nil. The compare-and-set mutation stays single-attempt because the public operation has no replay contract.

func (*EventsService) UpdateDiscountCode added in v0.9.0

func (s *EventsService) UpdateDiscountCode(
	ctx context.Context, eventKey, codeID string, p EventDiscountCodeUpdateParams,
) (map[string]any, error)

UpdateDiscountCode changes or pauses a discount code. It has no replay contract, so it is single-attempt.

func (*EventsService) UpdateHoldTTL

func (s *EventsService) UpdateHoldTTL(
	ctx context.Context, eventKey string, holdTTLMs ...int64,
) (map[string]any, error)

UpdateHoldTTL sets the checkout window in milliseconds. Omit holdTTLMs to send JSON null and restore the event default.

func (*EventsService) UpdatePoster added in v0.3.0

func (s *EventsService) UpdatePoster(
	ctx context.Context, eventKey string, image []byte, contentType ...string,
) (map[string]any, error)

UpdatePoster uploads raw PNG, JPEG, or WebP bytes. Content type defaults to application/octet-stream; pass one explicit media type when it is known.

func (*EventsService) UpdateTicketReleases added in v0.4.0

func (s *EventsService) UpdateTicketReleases(
	ctx context.Context, eventKey string, releases []TicketReleaseReplaceInput,
) (TicketReleaseList, error)

UpdateTicketReleases replaces the complete ordered release list. The public route has no replay contract, so this is deliberately single-attempt.

type HoldInspection added in v0.3.0

type HoldInspection struct {
	HoldID          string          `json:"holdId"`
	Status          string          `json:"status"`
	ExpiresAt       int64           `json:"expiresAt"`
	BookingRef      *string         `json:"bookingRef"`
	EventKey        *string         `json:"eventKey"`
	Mode            string          `json:"mode"`
	ExternalRef     *string         `json:"externalRef"`
	WorkspaceID     *string         `json:"workspaceId"`
	Items           []InventoryItem `json:"items"`
	AccessSessionID *string         `json:"accessSessionId,omitempty"`
	AccessSource    string          `json:"accessSource,omitempty"`
	BuyerRef        *string         `json:"buyerRef,omitempty"`
	PartnerRef      *string         `json:"partnerRef,omitempty"`
}

HoldInspection is the secret-key projection returned by RetrieveHold.

type HoldParams

type HoldParams struct {
	Labels []string
	// Selections is the alternative to Labels when you need a tier or a
	// quantity, e.g. a shared table or a GA area.
	Selections []map[string]any
	// TTLMs overrides the event's checkout window for this hold.
	TTLMs          int64
	ReplaceHoldID  string
	IdempotencyKey string
	// ChannelIDs grants access to private allocation inventory.
	ChannelIDs []string
	// IgnoreChannelRestrictions is a privileged backend override.
	IgnoreChannelRestrictions bool
	// Reason is written to the audit trail for channel use or an override.
	Reason string
}

HoldParams reserves specific objects by label.

type HolderReturnCreateParams added in v0.9.0

type HolderReturnCreateParams struct {
	TicketIDs      []string
	IdempotencyKey string
}

HolderReturnCreateParams gives back a holder's seat on one date, one per ticket. TicketIDs takes 1 to 20 tickets, all of one Season.

type HolderSessionRevokeParams added in v0.9.0

type HolderSessionRevokeParams struct {
	SessionID string
}

HolderSessionRevokeParams signs out one session instead of all of them.

type HolderTicketListParams added in v0.9.0

type HolderTicketListParams struct {
	SeasonKey string
	// From and To bound the date start time, in epoch milliseconds.
	From   int64
	To     int64
	Cursor string
	Limit  int
}

HolderTicketListParams filters and pages a holder's tickets.

type HolderTransferCreateParams added in v0.9.0

type HolderTransferCreateParams struct {
	TicketIDs      []string
	ToEmail        string
	IdempotencyKey string
}

HolderTransferCreateParams sends some of a holder's Season tickets to an email.

type HolderUpdateParams added in v0.9.0

type HolderUpdateParams struct {
	Email          string
	Name           NullableField[string]
	Phone          NullableField[string]
	IdempotencyKey string
}

HolderUpdateParams changes a holder's contact details. An empty Email is left out; use FieldNull to clear Name or Phone.

type HoldersService added in v0.9.0

type HoldersService struct {
	// contains filtered or unexported fields
}

HoldersService reads and changes ticket holders, their tickets, ticket transfers, returns and renewals, and lists the customers behind them.

func (*HoldersService) AcceptTransfer added in v0.9.0

func (s *HoldersService) AcceptTransfer(
	ctx context.Context, holderRef, transferID string,
) (map[string]any, error)

AcceptTransfer accepts a transfer for the recipient holder. It is single-attempt.

func (*HoldersService) CancelTransfer added in v0.9.0

func (s *HoldersService) CancelTransfer(
	ctx context.Context, holderRef, transferID string,
) (map[string]any, error)

CancelTransfer cancels a transfer that has not been accepted. It is single-attempt.

func (*HoldersService) CreateRenewalCheckout added in v0.9.0

func (s *HoldersService) CreateRenewalCheckout(
	ctx context.Context, holderRef, offerID string, p SeasonRenewalCheckoutParams,
) (map[string]any, error)

CreateRenewalCheckout starts a SeatLayer checkout that renews one of a holder's offers (renewalOffer on ListSeasons). Send the buyer to payment.url. A repeat with the same Idempotency-Key answers the same order.

func (*HoldersService) CreateReturn added in v0.9.0

func (s *HoldersService) CreateReturn(
	ctx context.Context, holderRef string, p HolderReturnCreateParams,
) (map[string]any, error)

CreateReturn gives back a holder's seat on one date, one per ticket. The result is {"return": ...}; a repeat with the same key answers with the same return. Turning give-backs off in Settings › Ticket site doesn't stop your server; cut-offs still apply.

func (*HoldersService) CreateTransfer added in v0.9.0

func (s *HoldersService) CreateTransfer(
	ctx context.Context, holderRef string, p HolderTransferCreateParams,
) (map[string]any, error)

CreateTransfer sends some of a holder's Season tickets to an email. Turning customer sends off in Settings › Ticket site doesn't stop your server; cut-offs still apply.

func (*HoldersService) DeclineRenewalOffer added in v0.9.0

func (s *HoldersService) DeclineRenewalOffer(
	ctx context.Context, holderRef, offerID string, p *SeasonRenewalDeclineParams,
) (map[string]any, error)

DeclineRenewalOffer declines one of a holder's renewal offers and releases its seats. Declining again answers the same offer, with the first reason. It is single-attempt. Pass nil to give no reason and send no body.

func (*HoldersService) ListCustomers added in v0.9.0

func (s *HoldersService) ListCustomers(ctx context.Context, p *CustomerListParams) (map[string]any, error)

ListCustomers lists or finds customers by email or holder reference.

func (*HoldersService) ListSeasons added in v0.9.0

func (s *HoldersService) ListSeasons(ctx context.Context, holderRef string) (map[string]any, error)

ListSeasons lists the Seasons a holder holds seats in.

func (*HoldersService) ListTickets added in v0.9.0

func (s *HoldersService) ListTickets(
	ctx context.Context, holderRef string, p *HolderTicketListParams,
) (map[string]any, error)

ListTickets lists a holder's tickets, date by date.

func (*HoldersService) ListTransfers added in v0.9.0

func (s *HoldersService) ListTransfers(ctx context.Context, holderRef string) (map[string]any, error)

ListTransfers lists transfers a holder sent or was sent.

func (*HoldersService) Retrieve added in v0.9.0

func (s *HoldersService) Retrieve(ctx context.Context, holderRef string) (map[string]any, error)

Retrieve fetches the customer behind a holder reference.

func (*HoldersService) RetrieveTicket added in v0.9.0

func (s *HoldersService) RetrieveTicket(
	ctx context.Context, holderRef, ticketID string,
) (map[string]any, error)

RetrieveTicket fetches one of a holder's tickets with its QR.

func (*HoldersService) RevokeSessions added in v0.9.0

func (s *HoldersService) RevokeSessions(
	ctx context.Context, holderRef string, p *HolderSessionRevokeParams,
) (map[string]any, error)

RevokeSessions signs a holder's customer out of the ticket site. Pass nil to sign out every session and send no body.

func (*HoldersService) Update added in v0.9.0

func (s *HoldersService) Update(
	ctx context.Context, holderRef string, p HolderUpdateParams,
) (map[string]any, error)

Update sets a holder's email, name or phone.

type InventoryItem added in v0.3.0

type InventoryItem struct {
	Label        string  `json:"label"`
	ObjectID     string  `json:"objectId"`
	ObjectType   string  `json:"objectType"`
	CategoryKey  string  `json:"categoryKey"`
	TierID       *string `json:"tierId"`
	UnitPrice    float64 `json:"unitPrice"`
	Currency     string  `json:"currency"`
	Quantity     *int    `json:"quantity,omitempty"`
	BookingMode  string  `json:"bookingMode,omitempty"`
	Capacity     *int    `json:"capacity,omitempty"`
	MinOccupancy *int    `json:"minOccupancy,omitempty"`
	MaxOccupancy *int    `json:"maxOccupancy,omitempty"`
	ChannelID    *string `json:"channelId,omitempty"`
	AccessSource string  `json:"accessSource,omitempty"`
	ReleaseID    *string `json:"releaseId,omitempty"`
}

InventoryItem is the authoritative priced object returned by hold APIs.

type InventoryService

type InventoryService struct {
	// contains filtered or unexported fields
}

InventoryService covers holds, booking, blocking and availability.

Two complete flows, both first-class:

browser holds → RetrieveHold for authoritative pricing → charge → Book(holdId)
backend books labels directly — box office, phone sales, comps

Never price from what the browser tells you. RetrieveHold is the authoritative answer, which is why it is a separate call.

func (*InventoryService) Block

func (s *InventoryService) Block(
	ctx context.Context, eventKey string, labels []string, releaseAt ...int64,
) (map[string]any, error)

Block holds inventory back from sale (house seats, production holds).

func (*InventoryService) Book

func (s *InventoryService) Book(ctx context.Context, eventKey string, p BookParams) (map[string]any, error)

Book confirms a sale.

func (*InventoryService) BookBestAvailable

func (s *InventoryService) BookBestAvailable(
	ctx context.Context, eventKey string, p BestAvailableParams,
) (map[string]any, error)

BookBestAvailable picks and books in one call — the box-office shape.

Prefer this over hold-then-book when payment is already taken: a failure between two calls would strand inventory until the TTL expired.

func (*InventoryService) BoxOfficeBook

func (s *InventoryService) BoxOfficeBook(
	ctx context.Context, eventKey string, labels []string, bookingRef string,
) (map[string]any, error)

BoxOfficeBook books named objects as a box-office sale.

func (*InventoryService) ExtendHold

func (s *InventoryService) ExtendHold(
	ctx context.Context, eventKey, holdID string, ttlMs int64, access ...TrustedInventoryAccess,
) (map[string]any, error)

ExtendHold pushes an active hold's expiry out by a fresh window.

Use this rather than release-and-re-hold when an order takes longer than the checkout window — invoiced sales, a phone order on hold. Releasing first hands the seats to whoever is racing for them in between. A hold that is gone, expired, or at its renewal cap answers 409 cannot_extend.

func (*InventoryService) Hold

func (s *InventoryService) Hold(ctx context.Context, eventKey string, p HoldParams) (map[string]any, error)

Hold reserves the named objects.

func (*InventoryService) HoldBestAvailable

func (s *InventoryService) HoldBestAvailable(
	ctx context.Context, eventKey string, p BestAvailableParams,
) (map[string]any, error)

HoldBestAvailable picks the best free objects and holds them.

The picker is the one the buyer widget uses, so a phone order and a web order get the same answer for the same inventory.

func (*InventoryService) ListBookings added in v0.2.0

func (s *InventoryService) ListBookings(
	ctx context.Context, eventKey string, p BookingListParams,
) (map[string]any, error)

ListBookings returns one page of booking lifecycle records, newest first.

func (*InventoryService) Release

func (s *InventoryService) Release(
	ctx context.Context, eventKey string, labels []string, holdID string,
) (map[string]any, error)

Release frees held objects before the TTL expires.

func (*InventoryService) RetrieveAvailability

func (s *InventoryService) RetrieveAvailability(ctx context.Context, eventKey string) (map[string]any, error)

RetrieveAvailability reads per-object availability rules.

func (*InventoryService) RetrieveBooking added in v0.2.0

func (s *InventoryService) RetrieveBooking(
	ctx context.Context, eventKey, bookingRef string,
) (map[string]any, error)

RetrieveBooking returns a booking lifecycle by its stable reference.

func (*InventoryService) RetrieveHold

func (s *InventoryService) RetrieveHold(
	ctx context.Context, eventKey, holdID string,
) (HoldInspection, error)

RetrieveHold returns authoritative items and prices. Charge from this, not from what the browser sent you.

func (*InventoryService) Unblock

func (s *InventoryService) Unblock(ctx context.Context, eventKey string, labels []string) (map[string]any, error)

Unblock returns blocked objects to sale.

func (*InventoryService) UnblockAll

func (s *InventoryService) UnblockAll(ctx context.Context, eventKey string) (map[string]any, error)

UnblockAll returns every blocked object in an event to sale.

func (*InventoryService) Unbook

func (s *InventoryService) Unbook(
	ctx context.Context, eventKey string, labels []string, bookingRef string,
) (map[string]any, error)

Unbook reverses a booking. Requires a key with cancel authority.

func (*InventoryService) UpdateAvailability

func (s *InventoryService) UpdateAvailability(
	ctx context.Context, eventKey string, fields map[string]any,
) (map[string]any, error)

UpdateAvailability replaces per-object availability rules.

type ManageCapability added in v0.3.0

type ManageCapability string

ManageCapability is browser authority carried by a manage-session token.

const (
	CapabilityView           ManageCapability = "event:view"
	CapabilityBlock          ManageCapability = "event:block"
	CapabilityCancel         ManageCapability = "event:cancel"
	CapabilityReports        ManageCapability = "event:reports"
	CapabilityChannelsView   ManageCapability = "event:channels:view"
	CapabilityChannelsManage ManageCapability = "event:channels:manage"
	CapabilityOrdersRead     ManageCapability = "event:orders:read"
	CapabilityRefund         ManageCapability = "event:refund"
	CapabilityTicketsSend    ManageCapability = "event:tickets:send"
	CapabilityDoorView       ManageCapability = "event:door:view"
	CapabilityDoorCheckin    ManageCapability = "event:door:checkin"
	CapabilityBoxOffice      ManageCapability = "event:boxoffice"
)

type ManageSession added in v0.3.0

type ManageSession struct {
	ID            string             `json:"id"`
	Token         string             `json:"token"`
	ExpiresAt     int64              `json:"expiresAt"`
	EventKey      string             `json:"eventKey"`
	AllowedOrigin string             `json:"allowedOrigin"`
	Capabilities  []ManageCapability `json:"capabilities"`
}

type ManageSessionParams

type ManageSessionParams struct {
	// AllowedOrigin is the https origin the token is bound to.
	AllowedOrigin string
	// Capabilities is required. See CreateManageSession for why.
	Capabilities []ManageCapability
	// ExpiresInSeconds is 300–14400. Defaults to 3600 server-side.
	ExpiresInSeconds int
	// WorkspaceID optionally confirms the event belongs to this workspace.
	WorkspaceID string
}

ManageSessionParams scopes a control-room token.

type NotFoundError

type NotFoundError struct{ APIError }

NotFoundError is a 404, including another organisation's resource.

Asking for something owned by a different organisation answers 404, never 403: a 403 would confirm the resource exists, which is not something one customer should be able to learn about another.

type NullableField added in v0.3.0

type NullableField[T any] struct {
	// contains filtered or unexported fields
}

NullableField distinguishes an omitted request field from an explicit JSON null. Construct one with FieldValue or FieldNull; its internals stay private so the three states cannot be assembled inconsistently.

func FieldNull added in v0.3.0

func FieldNull[T any]() NullableField[T]

FieldNull includes an explicit JSON null in a nullable request field.

func FieldValue added in v0.3.0

func FieldValue[T any](value T) NullableField[T]

FieldValue includes value in a nullable request field.

type Option

type Option func(*Client)

Option configures a Client.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL points the client at a different API host.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient supplies your own http.Client — for a custom transport, a proxy, or a test server. Its Timeout applies per attempt.

func WithMaxRetries

func WithMaxRetries(attempts int) Option

WithMaxRetries sets total attempts for retryable failures.

type OrderCancelParams added in v0.9.0

type OrderCancelParams struct {
	// Reason is one of lost_dispute, refunded_elsewhere or other.
	Reason string
	Note   string
	// RefundConfirmed and UsedTicketsAcknowledged are sent only when true.
	RefundConfirmed         bool
	UsedTicketsAcknowledged bool
	// NotifyBuyer is sent only when set, so an explicit false is possible.
	NotifyBuyer    *bool
	IdempotencyKey string
}

OrderCancelParams cancels an order without moving money.

type OrderListParams added in v0.9.0

type OrderListParams struct {
	// EventKey limits to one event's orders (not Season orders).
	EventKey string
	// SeasonKey limits to one Season's orders, renewals included.
	SeasonKey string
	// HolderRef limits to one holder's orders: the Season order with this id
	// and renewals offered to this reference.
	HolderRef string
	Status    string
	// From and To bound the creation time, in epoch milliseconds.
	From   int64
	To     int64
	Cursor string
	Limit  int
}

OrderListParams filters and pages the organization's orders.

type OrderRefundParams added in v0.9.0

type OrderRefundParams struct {
	// AmountMinor refunds this much, in minor units. Zero leaves it out, which
	// refunds what is left.
	AmountMinor    int64
	IdempotencyKey string
}

OrderRefundParams refunds an order in full or in part.

type OrderResendParams added in v0.9.0

type OrderResendParams struct {
	Email string
}

OrderResendParams sends an order's tickets again, optionally to another email.

type OrdersService added in v0.9.0

type OrdersService struct {
	// contains filtered or unexported fields
}

OrdersService reads orders across the organization and runs refunds, cancellations and ticket resends on event orders. Season order actions live on SeasonsService.

func (*OrdersService) CancelEventOrder added in v0.9.0

func (s *OrdersService) CancelEventOrder(
	ctx context.Context, eventKey, orderID string, p OrderCancelParams,
) (map[string]any, error)

CancelEventOrder cancels an event order without moving money.

func (*OrdersService) ExportEventOrdersCSV added in v0.9.0

func (s *OrdersService) ExportEventOrdersCSV(
	ctx context.Context, eventKey string, p *EventOrderExportParams,
) (string, error)

ExportEventOrdersCSV downloads one event's orders as CSV text with a header row and one price line per row, returned unchanged.

func (*OrdersService) List added in v0.9.0

func (s *OrdersService) List(ctx context.Context, p *OrderListParams) (map[string]any, error)

List lists orders across events and Seasons, one cursor page at a time.

func (*OrdersService) ListEventOrders added in v0.9.0

func (s *OrdersService) ListEventOrders(
	ctx context.Context, eventKey string, p *EventOrderListParams,
) (map[string]any, error)

ListEventOrders lists one event's orders, one cursor page at a time.

func (*OrdersService) ListTickets added in v0.9.0

func (s *OrdersService) ListTickets(ctx context.Context, orderID string) (map[string]any, error)

ListTickets lists an order's tickets with scan links.

func (*OrdersService) RefundEventOrder added in v0.9.0

func (s *OrdersService) RefundEventOrder(
	ctx context.Context, eventKey, orderID string, p *OrderRefundParams,
) (map[string]any, error)

RefundEventOrder refunds an event order through its payment provider. Pass nil to refund what is left.

func (*OrdersService) ResendEventOrderTickets added in v0.9.0

func (s *OrdersService) ResendEventOrderTickets(
	ctx context.Context, eventKey, orderID string, p *OrderResendParams,
) (map[string]any, error)

ResendEventOrderTickets emails an event order's tickets again. It has no replay contract, so it is single-attempt. Pass nil to send no body.

func (*OrdersService) Retrieve added in v0.9.0

func (s *OrdersService) Retrieve(ctx context.Context, orderID string) (map[string]any, error)

Retrieve fetches an order and its lines.

func (*OrdersService) RetrieveEventOrder added in v0.9.0

func (s *OrdersService) RetrieveEventOrder(
	ctx context.Context, eventKey, orderID string,
) (map[string]any, error)

RetrieveEventOrder fetches one event order with its guests and tickets.

type Page

type Page struct {
	// Items are the rows on this page.
	Items []map[string]any
	// NextCursor is empty once the list is exhausted.
	NextCursor string
}

Page is one page of a list endpoint, plus the cursor for the next.

type PerformanceGroupBuyerAccessSessionParams added in v0.5.0

type PerformanceGroupBuyerAccessSessionParams struct {
	AllowedOrigin     string
	IncludePublic     bool
	ChannelIDsByEvent map[string][]string
	ExpiresInSeconds  int
	MaxQuantity       NullableField[int]
	BuyerRef          NullableField[string]
	PartnerRef        NullableField[string]
}

PerformanceGroupBuyerAccessSessionParams scopes one browser bearer.

type PerformanceGroupCreateParams added in v0.5.0

type PerformanceGroupCreateParams struct {
	Name           string
	EventKeys      []string
	ExternalRef    NullableField[string]
	IdempotencyKey string
}

PerformanceGroupCreateParams describes a draft run. It must have two to eight compatible assigned-seat events; the API enforces that compatibility.

type PerformanceGroupListParams added in v0.5.0

type PerformanceGroupListParams struct {
	WorkspaceID string
	ExternalRef string
	State       string
	Limit       int
	Cursor      string
}

PerformanceGroupListParams filters one page of fixed runs.

type PerformanceGroupsService added in v0.5.0

type PerformanceGroupsService struct {
	// contains filtered or unexported fields
}

PerformanceGroupsService manages fixed multi-performance runs. It is a secret-key surface: create a browser session here, then pass the revealed token to PerformanceGroupPicker in the browser SDK.

func (*PerformanceGroupsService) Activate added in v0.5.0

func (s *PerformanceGroupsService) Activate(
	ctx context.Context, performanceGroupKey string, expectedRevision int,
) (map[string]any, error)

Activate starts lifecycle coordination. Poll RetrieveLifecycle when the returned lifecycleOperation is not terminal.

func (*PerformanceGroupsService) BookHold added in v0.5.0

func (s *PerformanceGroupsService) BookHold(
	ctx context.Context, performanceGroupKey, operationID, bookActionID, bookingRef string,
) (map[string]any, error)

BookHold confirms payment on a committed group hold. Keep both IDs stable and poll RetrieveBooking while the returned booking state is book_pending.

func (*PerformanceGroupsService) Close added in v0.5.0

func (s *PerformanceGroupsService) Close(
	ctx context.Context, performanceGroupKey string, expectedRevision int,
) (map[string]any, error)

Close stops new group sales. Poll RetrieveLifecycle until the close is terminal.

func (*PerformanceGroupsService) Create added in v0.5.0

Create makes a draft run with exact header replay.

func (*PerformanceGroupsService) CreateBuyerAccessSession added in v0.5.0

func (s *PerformanceGroupsService) CreateBuyerAccessSession(
	ctx context.Context, performanceGroupKey string, p PerformanceGroupBuyerAccessSessionParams,
) (map[string]any, error)

CreateBuyerAccessSession reveals one origin-bound browser bearer. This one-time-secret operation is deliberately single-attempt.

func (*PerformanceGroupsService) Delete added in v0.5.0

func (s *PerformanceGroupsService) Delete(ctx context.Context, performanceGroupKey string) error

Delete removes a draft run only. Activated runs retain their audit identity.

func (*PerformanceGroupsService) List added in v0.5.0

List returns one page of fixed performance runs.

func (*PerformanceGroupsService) ListBuyerAccessSessions added in v0.5.0

func (s *PerformanceGroupsService) ListBuyerAccessSessions(
	ctx context.Context, performanceGroupKey string, limit int,
) (map[string]any, error)

ListBuyerAccessSessions returns the current token records without their bearer values.

func (*PerformanceGroupsService) Retrieve added in v0.5.0

func (s *PerformanceGroupsService) Retrieve(
	ctx context.Context, performanceGroupKey string,
) (map[string]any, error)

Retrieve returns one run and its ordered performances.

func (*PerformanceGroupsService) RetrieveBooking added in v0.5.0

func (s *PerformanceGroupsService) RetrieveBooking(
	ctx context.Context, performanceGroupKey, actionID string,
) (map[string]any, error)

RetrieveBooking returns a group booking operation, including its terminal outcome.

func (*PerformanceGroupsService) RetrieveHold added in v0.5.0

func (s *PerformanceGroupsService) RetrieveHold(
	ctx context.Context, performanceGroupKey, operationID string,
) (map[string]any, error)

RetrieveHold is the trusted server projection of one group hold.

func (*PerformanceGroupsService) RetrieveLifecycle added in v0.5.0

func (s *PerformanceGroupsService) RetrieveLifecycle(
	ctx context.Context, performanceGroupKey, operationID string,
) (map[string]any, error)

RetrieveLifecycle reads the lifecycle operation returned by Activate or Close.

func (*PerformanceGroupsService) RevokeBuyerAccessSession added in v0.5.0

func (s *PerformanceGroupsService) RevokeBuyerAccessSession(
	ctx context.Context, performanceGroupKey, sessionID string,
) (map[string]any, error)

RevokeBuyerAccessSession prevents a browser bearer from starting another hold.

type RateLimitError

type RateLimitError struct {
	APIError
	// RetryAfter is how long to wait, in seconds.
	RetryAfter float64
}

RateLimitError is a 429. RetryAfter prefers the header over the JSON field.

type SeasonAmendmentParams added in v0.7.0

type SeasonAmendmentParams struct {
	EventKey string
	// Kind is "reschedule", "replace", "cancel_exception", "postpone" (the
	// date stays with no new time yet), or "cancel" (it will not happen).
	Kind     string
	StartsAt int64
	Name     string
	// Refund, with Kind "cancel" only, refunds each SeatLayer order's share of
	// the date as a job: "none" (the default) or "per_date". A whole-order
	// refund is the order refund. Empty leaves it out.
	Refund string
	// Reason is kept on the refund job. Empty leaves it out.
	Reason         string
	IdempotencyKey string
}

type SeasonBlockReleaseParams added in v0.9.0

type SeasonBlockReleaseParams struct {
	ExpectedRevision int
	Scope            SeasonBlockReleaseScope
	// EventKeys limits the release to these dates. Empty: every date still to come.
	EventKeys []string
	// At is an ISO time to release at. Empty: now.
	At             string
	Reason         string
	IdempotencyKey string
}

SeasonBlockReleaseParams releases season seats to single sale.

type SeasonBlockReleaseScope added in v0.9.0

type SeasonBlockReleaseScope struct {
	All          bool     `json:"all,omitempty"`
	SectionIDs   []string `json:"sectionIds,omitempty"`
	CategoryKeys []string `json:"categoryKeys,omitempty"`
	Labels       []string `json:"labels,omitempty"`
}

SeasonBlockReleaseScope is what a release covers: All, or one of the lists.

type SeasonBlockSetAsideParams added in v0.9.0

type SeasonBlockSetAsideParams struct {
	// ExpectedRevision is the Season revision you read; another answers 409
	// revision_mismatch.
	ExpectedRevision int
	// KeepForSingleTickets is left out of the block. Nil keeps nothing back:
	// the block is every seat the packages price.
	KeepForSingleTickets *SeasonSeatSelection
	IdempotencyKey       string
}

SeasonBlockSetAsideParams sets a Season's seats aside on every date.

type SeasonBuyerAccessSessionParams added in v0.7.0

type SeasonBuyerAccessSessionParams struct {
	AllowedOrigin    string
	IncludePublic    bool
	ExpiresInSeconds int
	MaxQuantity      NullableField[int]
	BuyerRef         NullableField[string]
}

type SeasonCancelBookingParams added in v0.7.0

type SeasonCancelBookingParams struct {
	CancelActionID   string
	BookingRef       string
	PlanActivationID string
	RightDisposition string
}

type SeasonCheckoutTestParams added in v0.9.0

type SeasonCheckoutTestParams struct {
	PlanKey string
	// Quantity is the number of seats, 1 to 4. Zero leaves it out.
	Quantity       int
	IdempotencyKey string
}

SeasonCheckoutTestParams scopes a Season checkout test.

type SeasonCreateParams added in v0.7.0

type SeasonCreateParams struct {
	Name                       string
	Edition                    NullableField[string]
	EventKeys                  []string
	SourcePerformanceGroupKeys []string
	// SingleTickets makes each date also sell its own single tickets once the
	// Season is on sale. Nil leaves it out: Season only, the default.
	SingleTickets *bool
	// InventoryMode SeasonInventoryModeBlock turns season seats on for this
	// Season. Empty leaves it out: "per_hold", the default. Anything else
	// answers 422 invalid_inventory_mode.
	InventoryMode  SeasonInventoryMode
	IdempotencyKey string
}

func (SeasonCreateParams) SeasonSelectionParams added in v0.7.0

func (p SeasonCreateParams) SeasonSelectionParams() SeasonSelectionParams

type SeasonDuplicateToLiveParams added in v0.7.0

type SeasonDuplicateToLiveParams struct {
	EventKeys      []string
	Name           string
	IdempotencyKey string
}

type SeasonHolderExportParams added in v0.9.0

type SeasonHolderExportParams struct {
	// Q searches holder name, email, reference, order number or seat.
	Q      string
	Status string
}

SeasonHolderExportParams filters the holders CSV export.

type SeasonHolderImportFromSeasonParams added in v0.9.0

type SeasonHolderImportFromSeasonParams struct {
	SourceSeasonID            string
	SuccessorPlanActivationID string
	// DryRun checks the import without committing it. Nil leaves it out.
	DryRun         *bool
	IdempotencyKey string
}

SeasonHolderImportFromSeasonParams derives renewal rights from a previous Season's holders instead of uploaded rows.

type SeasonHolderImportParams added in v0.7.0

type SeasonHolderImportParams struct {
	SuccessorPlanActivationID string
	DryRun                    *bool
	Rows                      []SeasonHolderImportRow
	IdempotencyKey            string
}

type SeasonHolderImportRow added in v0.7.0

type SeasonHolderImportRow struct {
	RowID                 string   `json:"rowId"`
	HolderRef             string   `json:"holderRef"`
	PriorPlanActivationID string   `json:"priorPlanActivationId"`
	PriorContractRef      string   `json:"priorContractRef"`
	Labels                []string `json:"labels"`
	ExistingBookingRef    *string  `json:"existingBookingRef,omitempty"`
	// HolderEmail and HolderName are where the holder's renewal emails go.
	HolderEmail *string `json:"holderEmail,omitempty"`
	HolderName  *string `json:"holderName,omitempty"`
}

type SeasonHolderListParams added in v0.9.0

type SeasonHolderListParams struct {
	// Q searches holder name, email, reference, order number or seat.
	Q      string
	Status string
	Cursor string
	Limit  int
}

SeasonHolderListParams filters and pages a Season's holders.

type SeasonInventoryMode added in v0.9.0

type SeasonInventoryMode string

SeasonInventoryMode is how a Season's seats are decided. Every Season answer carries it as "inventoryMode": "block" once season seats are turned on for it (inventoryMode "block" on create or update) or it sells from its block, else "per_hold".

const (
	// SeasonInventoryModeBlock turns season seats on for the Season.
	SeasonInventoryModeBlock SeasonInventoryMode = "block"
	// SeasonInventoryModePerHold, the default, turns them off.
	SeasonInventoryModePerHold SeasonInventoryMode = "per_hold"
)

type SeasonInventorySource added in v0.9.0

type SeasonInventorySource struct {
	BookingActionID string `json:"bookingActionId,omitempty"`
	RenewalOfferID  string `json:"renewalOfferId,omitempty"`
}

SeasonInventorySource names where returned seats came from: set exactly one of BookingActionID or RenewalOfferID.

type SeasonListParams added in v0.7.0

type SeasonListParams struct {
	WorkspaceID    string
	StructureState string
	Limit          int
	Cursor         string
}

type SeasonMarkPastParams added in v0.9.0

type SeasonMarkPastParams struct {
	Force          bool
	IdempotencyKey string
}

SeasonMarkPastParams marks a Season performance as past.

type SeasonOccurrenceReclaimParams added in v0.9.0

type SeasonOccurrenceReclaimParams struct {
	ActionID         string
	ReturnActionID   string
	BookingRef       string
	PlanActivationID string
	Labels           []string
	Source           SeasonInventorySource
}

SeasonOccurrenceReclaimParams reclaims returned occurrence inventory.

type SeasonOccurrenceReturnParams added in v0.9.0

type SeasonOccurrenceReturnParams struct {
	ActionID         string
	BookingRef       string
	PlanActivationID string
	Labels           []string
	Source           SeasonInventorySource
}

SeasonOccurrenceReturnParams returns one occurrence allocation to Event inventory.

type SeasonOfferPageParams added in v0.9.0

type SeasonOfferPageParams struct {
	Cursor string
	Limit  int
}

SeasonOfferPageParams pages renewal offers, newest first. Cursor is the nextCursor of the page before; empty reads the first page. Limit is the page size, 1-100 for ListRenewalOffers and 1-500 for RetrieveHostedRenewals; zero leaves it out for the default (100 and 500). A cursor the list did not give out, or a limit out of range, answers 400 invalid_cursor or invalid_limit.

type SeasonOrderDateCancelParams added in v0.9.0

type SeasonOrderDateCancelParams struct {
	ActionID       string
	IdempotencyKey string
}

SeasonOrderDateCancelParams takes back one date of a Season order.

type SeasonPackagePrice added in v0.9.0

type SeasonPackagePrice struct {
	CategoryKey string `json:"categoryKey"`
	// PriceTypeKey is one of the SeasonPriceType constants. Empty leaves it
	// out, which prices the category for adults. Each category takes each type once.
	PriceTypeKey string `json:"priceTypeKey,omitempty"`
	UnitPrice    int64  `json:"unitPrice"`
}

SeasonPackagePrice is one category price, in minor units, for a package.

type SeasonPackagePricesParams added in v0.9.0

type SeasonPackagePricesParams struct {
	Prices []SeasonPackagePrice
	// Currency is a three-letter code. Empty leaves it out.
	Currency       string
	IdempotencyKey string
}

SeasonPackagePricesParams replaces every category price of a package.

type SeasonPerformanceRefundParams added in v0.9.0

type SeasonPerformanceRefundParams struct {
	// Amount is "per_date": the date's share of each order, rounded down.
	// "full" is refused (422 date_refund_per_date_only); refund a whole order
	// with Orders.Refund.
	Amount string
	// Reason is kept on the job. Empty leaves it out.
	Reason         string
	IdempotencyKey string
}

SeasonPerformanceRefundParams refunds every SeatLayer order holding a cancelled date.

type SeasonPerformancesAttachParams added in v0.9.0

type SeasonPerformancesAttachParams struct {
	EventKeys        []string
	AttachToPlanKeys []string
	IdempotencyKey   string
}

SeasonPerformancesAttachParams attaches existing events to a draft Season.

type SeasonPerformancesCreateParams added in v0.9.0

type SeasonPerformancesCreateParams struct {
	TitlePattern string
	// FirstStartsAt is epoch milliseconds. Zero leaves it out.
	FirstStartsAt int64
	Timezone      string
	// Repeat is one of none, daily, weekly, biweekly or dates.
	Repeat string
	// Count is how many performances to create. Zero leaves it out.
	Count int
	// Dates are epoch milliseconds, used with Repeat "dates".
	Dates           []int64
	Venue           NullableField[string]
	DurationMinutes NullableField[int]
	// Region places live inventory near the venue. Empty leaves it out.
	Region           EventHostingRegion
	AttachToPlanKeys []string
	IdempotencyKey   string
}

SeasonPerformancesCreateParams creates performances inside a draft Season from a repeat rule.

type SeasonPlanCreateParams added in v0.7.0

type SeasonPlanCreateParams struct {
	Name                       string
	EventKeys                  []string
	SourcePerformanceGroupKeys []string
	IdempotencyKey             string
}

type SeasonPlanUpdateParams added in v0.9.0

type SeasonPlanUpdateParams struct {
	Name           string
	EventKeys      []string
	IdempotencyKey string
}

SeasonPlanUpdateParams renames or re-scopes a draft package. Empty fields are left out.

type SeasonRenewalCheckoutParams added in v0.9.0

type SeasonRenewalCheckoutParams struct {
	ReturnURL string
	// BuyerEmail is where the tickets go when no email is on file for the
	// holder; the one on file wins.
	BuyerEmail string
	BuyerName  string
	// Provider picks the connected gateway when the organization has more
	// than one.
	Provider       string
	IdempotencyKey string
}

SeasonRenewalCheckoutParams starts a SeatLayer checkout that renews an offer. ReturnURL is required and must be on one of the organization's allowed domains; the buyer comes back there with seatlayer_checkout=success or cancelled added. Empty optional fields are left out.

type SeasonRenewalContactParams added in v0.9.0

type SeasonRenewalContactParams struct {
	Email NullableField[string]
	Name  NullableField[string]
}

SeasonRenewalContactParams sets who a renewal offer is sent to. Use FieldNull to clear a value.

type SeasonRenewalDeclineParams added in v0.9.0

type SeasonRenewalDeclineParams struct {
	Reason string
}

SeasonRenewalDeclineParams gives the holder's reason for declining, 1 to 200 characters, kept on the offer as declineReason. An empty Reason is left out.

type SeasonRenewalNoticesParams added in v0.9.0

type SeasonRenewalNoticesParams struct {
	OfferIDs []string
	// BatchID, instead of OfferIDs, emails every open offer one CreateRenewalOffers batch made (its batchId).
	BatchID string
}

SeasonRenewalNoticesParams limits renewal notices to some offers, at most 20,000. Empty OfferIDs leaves the field out.

type SeasonRenewalOffersParams added in v0.7.0

type SeasonRenewalOffersParams struct {
	SuccessorPlanActivationID string
	DeadlineAt                int64
	ContractIDs               []string
	IdempotencyKey            string
}

type SeasonSeatSelection added in v0.9.0

type SeasonSeatSelection struct {
	SectionIDs   []string `json:"sectionIds,omitempty"`
	CategoryKeys []string `json:"categoryKeys,omitempty"`
	Labels       []string `json:"labels,omitempty"`
}

SeasonSeatSelection names seats kept for single tickets, or released: by section, category or label.

type SeasonSelectionParams added in v0.7.0

type SeasonSelectionParams struct {
	EventKeys                  []string
	SourcePerformanceGroupKeys []string
}

type SeasonSupportLookupParams added in v0.7.0

type SeasonSupportLookupParams struct {
	BookingRef string
	HolderRef  string
}

type SeasonUpdateParams added in v0.7.0

type SeasonUpdateParams struct {
	ExpectedRevision int
	Name             string
	Edition          NullableField[string]
	// CheckoutMode is who takes the money: "seatlayer" or "server". Empty
	// leaves it unchanged; it cannot go back to undecided, and it is fixed once
	// a live booking exists.
	CheckoutMode string
	// TransferCutoffHours is how many hours (0 to 720) before a date starts its
	// tickets stop being sent to others. FieldNull means the club default
	// (Settings › Ticket site), or until it starts when the club has none.
	TransferCutoffHours NullableField[int]
	// ReturnCutoffHours is how many hours (0 to 720) before a date starts a
	// holder can no longer give a seat back. FieldNull means the club default.
	ReturnCutoffHours NullableField[int]
	// Audience is "embed_only" or "public" (listed on your SeatLayer website;
	// an ended Season cannot become public, 409 sales_ended). Empty leaves it
	// unchanged.
	Audience string
	// SingleTickets turned on while the Season is on sale opens each upcoming
	// date's own sales through its readiness checks; turned off, they stop. The
	// answer's singleTicketDates says which. Nil leaves it unchanged.
	SingleTickets *bool
	// InventoryMode SeasonInventoryModeBlock turns season seats on for this
	// Season; SeasonInventoryModePerHold turns them off again, refused with
	// 409 season_block_exists once seats are set aside. It does not change the
	// Season's revision. Refused with 409 season_block_packages (more than one
	// package), 409 season_block_on_sale (sales already opened without season
	// seats), 409 season_not_draft_or_active, or 422 invalid_inventory_mode.
	// Empty leaves it unchanged.
	InventoryMode  SeasonInventoryMode
	IdempotencyKey string
}

type SeasonsService added in v0.7.0

type SeasonsService struct {
	// contains filtered or unexported fields
}

SeasonsService manages Fixed Renewable Seasons from trusted server code. Browser selection belongs in the distinct SeasonPicker and receives only a scoped buyer token minted through this service.

func (*SeasonsService) Activate added in v0.7.0

func (s *SeasonsService) Activate(
	ctx context.Context, seasonKey string, expectedRevision int,
) (map[string]any, error)

func (*SeasonsService) Archive added in v0.7.0

func (s *SeasonsService) Archive(
	ctx context.Context, seasonKey string, expectedRevision int,
) (map[string]any, error)

func (*SeasonsService) AttachPerformances added in v0.9.0

func (s *SeasonsService) AttachPerformances(
	ctx context.Context, seasonKey string, p SeasonPerformancesAttachParams,
) (map[string]any, error)

AttachPerformances attaches existing events to a draft Season and its packages.

func (*SeasonsService) AttachPlanPerformance added in v0.9.0

func (s *SeasonsService) AttachPlanPerformance(
	ctx context.Context, seasonKey, planKey, eventKey, idempotencyKey string,
) (map[string]any, error)

AttachPlanPerformance adds a performance to a published package and extends its allocations.

func (*SeasonsService) BookHold added in v0.7.0

func (s *SeasonsService) BookHold(
	ctx context.Context, seasonKey, operationID, bookActionID, bookingRef string,
) (map[string]any, error)

func (*SeasonsService) CancelBooking added in v0.7.0

func (s *SeasonsService) CancelBooking(
	ctx context.Context, seasonKey, actionID string, p SeasonCancelBookingParams,
) (map[string]any, error)

func (*SeasonsService) CancelOrder added in v0.9.0

func (s *SeasonsService) CancelOrder(
	ctx context.Context, seasonKey, orderID string, p OrderCancelParams,
) (map[string]any, error)

CancelOrder cancels a Season order without moving money and releases every date.

func (*SeasonsService) CancelOrderDate added in v0.9.0

func (s *SeasonsService) CancelOrderDate(
	ctx context.Context, seasonKey, orderID, eventKey string, p *SeasonOrderDateCancelParams,
) (map[string]any, error)

CancelOrderDate takes back one date of a Season order and puts its seats back on sale. Pass nil to send no body.

func (*SeasonsService) Close added in v0.7.0

func (s *SeasonsService) Close(
	ctx context.Context, seasonKey string, expectedRevision int,
) (map[string]any, error)

func (*SeasonsService) CommitRenewalOffer added in v0.7.0

func (s *SeasonsService) CommitRenewalOffer(
	ctx context.Context, seasonKey, offerID, commitActionID, orderRef, bookingRef, planActivationID string,
) (map[string]any, error)

func (*SeasonsService) Create added in v0.7.0

func (s *SeasonsService) Create(ctx context.Context, p SeasonCreateParams) (map[string]any, error)

func (*SeasonsService) CreateAmendment added in v0.7.0

func (s *SeasonsService) CreateAmendment(
	ctx context.Context, seasonKey string, p SeasonAmendmentParams,
) (map[string]any, error)

CreateAmendment postpones, reschedules, replaces or cancels one date. A "cancel" also voids every live ticket for the date as a date_cancel_void job, SeasonDateCancelVoidJobID(amendmentId), which the answer does not name; follow it with RetrieveBulkJob. With a Refund, refundJob names the refund job. A cancelled date can't be moved (reschedule), postponed or replaced: 409 performance_cancelled. On a season-seats season, a "cancel" first takes the date off every season seat: while that finishes the answer is a 202 (check with IsSeasonDateLeavePending); send the same request again to read the amendment.

func (*SeasonsService) CreateBuyerAccessSession added in v0.7.0

func (s *SeasonsService) CreateBuyerAccessSession(
	ctx context.Context, seasonKey string, p SeasonBuyerAccessSessionParams,
) (map[string]any, error)

CreateBuyerAccessSession reveals a show-once bearer and is deliberately single-attempt.

func (*SeasonsService) CreateCheckoutTest added in v0.9.0

func (s *SeasonsService) CreateCheckoutTest(
	ctx context.Context, seasonKey string, p *SeasonCheckoutTestParams,
) (map[string]any, error)

CreateCheckoutTest runs a server-side hold and release to prove the Season buyer path. Pass nil to send no body.

func (*SeasonsService) CreateHolderImport added in v0.7.0

func (s *SeasonsService) CreateHolderImport(
	ctx context.Context, seasonKey string, p SeasonHolderImportParams,
) (map[string]any, error)

CreateHolderImport imports incumbent holders, as a dry run or for real. A package holds 2 to 50 dates, and a call takes at most SeasonHolderImportRowsPerCall(dates) rows (100 up to 20 dates); more answers 422 invalid_rows, a *ValidationError with maxRows in its Body.

func (*SeasonsService) CreateHolderImportFromSeason added in v0.9.0

func (s *SeasonsService) CreateHolderImportFromSeason(
	ctx context.Context, seasonKey string, p SeasonHolderImportFromSeasonParams,
) (map[string]any, error)

CreateHolderImportFromSeason dry-runs or commits renewal rights derived from a previous Season's holders. A dry run answers 200 and a commit of 100 holders or fewer 201, both {"import": ...}. A commit of more than 100 holders answers 202 {"job": ...}: a holder_import job brings them across. Follow it with RetrieveBulkJob; its summary has the same counts when it completes. The same Idempotency-Key answers the same job. It can refuse with 409 job_mismatch, or 503 job_busy or season_not_configured.

func (*SeasonsService) CreatePerformances added in v0.9.0

func (s *SeasonsService) CreatePerformances(
	ctx context.Context, seasonKey string, p SeasonPerformancesCreateParams,
) (map[string]any, error)

CreatePerformances creates performances inside a draft Season from a repeat rule.

func (*SeasonsService) CreatePlan added in v0.7.0

func (s *SeasonsService) CreatePlan(
	ctx context.Context, seasonKey string, p SeasonPlanCreateParams,
) (map[string]any, error)

func (*SeasonsService) CreateRenewalCheckout added in v0.9.0

func (s *SeasonsService) CreateRenewalCheckout(
	ctx context.Context, seasonKey, offerID string, p SeasonRenewalCheckoutParams,
) (map[string]any, error)

CreateRenewalCheckout starts a SeatLayer checkout that renews an offer, with no hosted page. Send the buyer to payment.url; paying renews the offer. A repeat with the same Idempotency-Key answers the same order.

func (*SeasonsService) CreateRenewalIntent added in v0.9.0

func (s *SeasonsService) CreateRenewalIntent(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

CreateRenewalIntent records that the holder means to renew, for a renewal taken by phone or at the box office, so your own checkout can commit the offer. A repeat answers the same offer. It is single-attempt.

func (*SeasonsService) CreateRenewalNotices added in v0.9.0

func (s *SeasonsService) CreateRenewalNotices(
	ctx context.Context, seasonKey string, p *SeasonRenewalNoticesParams,
) (map[string]any, error)

CreateRenewalNotices emails renewal invitations now and reminders before the deadline. It is single-attempt. Pass nil to send no body, which emails every open offer. It takes up to 20,000 offer ids; more answers 422 too_many_offer_ids.

func (*SeasonsService) CreateRenewalOffers added in v0.7.0

func (s *SeasonsService) CreateRenewalOffers(
	ctx context.Context, seasonKey string, p SeasonRenewalOffersParams,
) (map[string]any, error)

CreateRenewalOffers makes one renewal offer per eligible prior Contract. For 100 contracts or fewer it answers 201 {"offers": [...]}. Above 100 it answers 202 {"job": ..., "batchId": ...}: a renewal_run job makes the offers. Follow it with RetrieveBulkJob, then read the offers with ListRenewalOffers. It is retried safely with one Idempotency-Key, which answers the same job. It can refuse with 409 job_mismatch or 503 season_not_configured.

func (*SeasonsService) DeclineRenewalOffer added in v0.7.0

func (s *SeasonsService) DeclineRenewalOffer(
	ctx context.Context, seasonKey, offerID string, options ...SeasonRenewalDeclineParams,
) (map[string]any, error)

DeclineRenewalOffer declines an offer and releases its seats at once. Pass one SeasonRenewalDeclineParams to keep the holder's reason on the offer.

func (*SeasonsService) Delete added in v0.7.0

func (s *SeasonsService) Delete(
	ctx context.Context, seasonKey, idempotencyKey string,
) error

func (*SeasonsService) DeletePerformance added in v0.9.0

func (s *SeasonsService) DeletePerformance(
	ctx context.Context, seasonKey, eventKey, idempotencyKey string,
) (map[string]any, error)

DeletePerformance removes a performance from a draft Season and every package.

func (*SeasonsService) DeletePlan added in v0.9.0

func (s *SeasonsService) DeletePlan(
	ctx context.Context, seasonKey, planKey, idempotencyKey string,
) error

DeletePlan deletes a draft package that is not the last one. The API answers 204 with no body, so only an error comes back.

func (*SeasonsService) DeletePlanPerformance added in v0.9.0

func (s *SeasonsService) DeletePlanPerformance(
	ctx context.Context, seasonKey, planKey, eventKey, idempotencyKey string,
) (map[string]any, error)

DeletePlanPerformance removes a performance from a published package and releases its allocations.

func (*SeasonsService) DuplicateToLive added in v0.7.0

func (s *SeasonsService) DuplicateToLive(
	ctx context.Context, seasonKey string, p SeasonDuplicateToLiveParams,
) (map[string]any, error)

func (*SeasonsService) EndSales added in v0.7.0

func (s *SeasonsService) EndSales(ctx context.Context, seasonKey string, expectedRevision int) (map[string]any, error)

func (*SeasonsService) ExportHoldersCSV added in v0.9.0

func (s *SeasonsService) ExportHoldersCSV(
	ctx context.Context, seasonKey string, p *SeasonHolderExportParams,
) (string, error)

ExportHoldersCSV downloads every Season ticket holder as CSV text with a header row, returned unchanged.

func (*SeasonsService) ExportOrdersCSV added in v0.9.0

func (s *SeasonsService) ExportOrdersCSV(ctx context.Context, seasonKey string) (string, error)

ExportOrdersCSV downloads every Season order SeatLayer took as CSV text with a header row, returned unchanged.

func (*SeasonsService) ExportSupportSnapshot added in v0.7.0

func (s *SeasonsService) ExportSupportSnapshot(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) ExtendRenewalOffer added in v0.7.0

func (s *SeasonsService) ExtendRenewalOffer(
	ctx context.Context, seasonKey, offerID string, deadlineAt int64,
) (map[string]any, error)

func (*SeasonsService) InspectRenewalOffer added in v0.7.0

func (s *SeasonsService) InspectRenewalOffer(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

func (*SeasonsService) List added in v0.7.0

func (s *SeasonsService) List(ctx context.Context, p *SeasonListParams) (map[string]any, error)

List returns one cursor page of Seasons.

func (*SeasonsService) ListAmendments added in v0.7.0

func (s *SeasonsService) ListAmendments(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) ListAudit added in v0.7.0

func (s *SeasonsService) ListAudit(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) ListBulkJobs added in v0.9.0

func (s *SeasonsService) ListBulkJobs(ctx context.Context, seasonKey string) (map[string]any, error)

ListBulkJobs lists the Season's bulk jobs, newest first (100 at most).

func (*SeasonsService) ListBuyerAccessSessions added in v0.7.0

func (s *SeasonsService) ListBuyerAccessSessions(
	ctx context.Context, seasonKey string, limit int,
) (map[string]any, error)

func (*SeasonsService) ListCheckoutTests added in v0.9.0

func (s *SeasonsService) ListCheckoutTests(ctx context.Context, seasonKey string) (map[string]any, error)

ListCheckoutTests lists recent Season checkout tests, newest first.

func (*SeasonsService) ListHolders added in v0.9.0

func (s *SeasonsService) ListHolders(
	ctx context.Context, seasonKey string, p *SeasonHolderListParams,
) (map[string]any, error)

ListHolders lists Season ticket holders, one cursor page at a time.

func (*SeasonsService) ListOccurrences added in v0.7.0

func (s *SeasonsService) ListOccurrences(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) ListOperations added in v0.7.0

func (s *SeasonsService) ListOperations(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) ListOutbox added in v0.7.0

func (s *SeasonsService) ListOutbox(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) ListPerformances added in v0.9.0

func (s *SeasonsService) ListPerformances(ctx context.Context, seasonKey string) (map[string]any, error)

ListPerformances lists the Season's performances and package membership in every lifecycle state.

func (*SeasonsService) ListPrices added in v0.9.0

func (s *SeasonsService) ListPrices(ctx context.Context, seasonKey string) (map[string]any, error)

ListPrices lists every package price table for the Season.

func (*SeasonsService) ListRenewalOffers added in v0.7.0

func (s *SeasonsService) ListRenewalOffers(
	ctx context.Context, seasonKey string, options ...SeasonOfferPageParams,
) (map[string]any, error)

ListRenewalOffers reads one page of renewal offers, newest first; the answer's nextCursor reads the next page and is null on the last. Pass one SeasonOfferPageParams to page (Limit 1-100, default 100); existing calls compile unchanged and read the first page.

func (*SeasonsService) MarkPerformancePast added in v0.9.0

func (s *SeasonsService) MarkPerformancePast(
	ctx context.Context, seasonKey, eventKey string, p SeasonMarkPastParams,
) (map[string]any, error)

MarkPerformancePast marks a performance past so it stops blocking new Season sales. A cancelled date answers 409 performance_cancelled. On a season-seats season the date first leaves every season seat: while that finishes the answer is a 202 (check with IsSeasonDateLeavePending).

func (*SeasonsService) OpenSales added in v0.7.0

func (s *SeasonsService) OpenSales(ctx context.Context, seasonKey string, expectedRevision int) (map[string]any, error)

OpenSales opens the Season's sales. With season seats turned on (InventoryMode SeasonInventoryModeBlock) but the seats not set aside yet it answers 409 block_not_ready.

func (*SeasonsService) PauseSales added in v0.7.0

func (s *SeasonsService) PauseSales(ctx context.Context, seasonKey string, expectedRevision int) (map[string]any, error)

func (*SeasonsService) Publish added in v0.9.0

func (s *SeasonsService) Publish(
	ctx context.Context, seasonKey, idempotencyKey string,
) (map[string]any, error)

Publish activates the Season structure and publishes every draft package in one retryable call.

func (*SeasonsService) PublishPlan added in v0.7.0

func (s *SeasonsService) PublishPlan(
	ctx context.Context, seasonKey, planKey string, expectedRevision int,
) (map[string]any, error)

func (*SeasonsService) ReclaimOccurrenceInventory added in v0.9.0

func (s *SeasonsService) ReclaimOccurrenceInventory(
	ctx context.Context, seasonKey, eventKey string, p SeasonOccurrenceReclaimParams,
) (map[string]any, error)

ReclaimOccurrenceInventory reclaims returned occurrence inventory while it is still free. It is single-attempt; ActionID makes a repeat safe.

func (*SeasonsService) RefundOrder added in v0.9.0

func (s *SeasonsService) RefundOrder(
	ctx context.Context, seasonKey, orderID string, p *OrderRefundParams,
) (map[string]any, error)

RefundOrder refunds a Season order in full or in part through its payment provider. Pass nil to refund what is left.

func (*SeasonsService) RefundPerformance added in v0.9.0

func (s *SeasonsService) RefundPerformance(
	ctx context.Context, seasonKey, eventKey string, p SeasonPerformanceRefundParams,
) (map[string]any, error)

RefundPerformance refunds every SeatLayer order holding a cancelled date, as a job; the answer is {"job": ...}. Follow it with RetrieveBulkJob. It is retried safely with one Idempotency-Key, which replays the same job.

func (*SeasonsService) ReleaseBlock added in v0.9.0

func (s *SeasonsService) ReleaseBlock(
	ctx context.Context, seasonKey string, p SeasonBlockReleaseParams,
) (map[string]any, error)

ReleaseBlock releases season seats to single sale: every unsold seat (Scope.All), or the sections, categories or seats named. The answer is 202 {"job": ..., "block": ...}: a season_block_release job to follow with RetrieveBulkJob. season.block.released is sent once it has run on every date. It is retried safely with one Idempotency-Key, which replays the same release; an empty IdempotencyKey generates one.

func (*SeasonsService) ReleaseLapsedOffers added in v0.9.0

func (s *SeasonsService) ReleaseLapsedOffers(
	ctx context.Context, seasonKey, idempotencyKey string,
) (map[string]any, error)

ReleaseLapsedOffers releases the seats of every lapsed renewal offer, as a job; the answer is 202 {"job": ...}. An offer extended before its turn is skipped and keeps its seat. Follow it with RetrieveBulkJob. It is retried safely with one Idempotency-Key, which replays the same job; an empty idempotencyKey generates one.

func (*SeasonsService) ReleaseRenewalOffer added in v0.7.0

func (s *SeasonsService) ReleaseRenewalOffer(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

func (*SeasonsService) ReplacePackagePrices added in v0.9.0

func (s *SeasonsService) ReplacePackagePrices(
	ctx context.Context, seasonKey, planKey string, p SeasonPackagePricesParams,
) (map[string]any, error)

ReplacePackagePrices replaces a package price table, per chart category, in minor units.

func (*SeasonsService) ReplayOutbox added in v0.7.0

func (s *SeasonsService) ReplayOutbox(
	ctx context.Context, seasonKey, occurrenceID string,
) (map[string]any, error)

func (*SeasonsService) ResendOrderTickets added in v0.9.0

func (s *SeasonsService) ResendOrderTickets(
	ctx context.Context, seasonKey, orderID string, p *OrderResendParams,
) (map[string]any, error)

ResendOrderTickets emails a Season order's tickets again. It has no replay contract, so it is single-attempt. Pass nil to send no body.

func (*SeasonsService) ResendRenewalOffer added in v0.9.0

func (s *SeasonsService) ResendRenewalOffer(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

ResendRenewalOffer sends one holder a new renewal invitation. It has no replay contract, so it is single-attempt.

func (*SeasonsService) ResumeSales added in v0.7.0

func (s *SeasonsService) ResumeSales(ctx context.Context, seasonKey string, expectedRevision int) (map[string]any, error)

func (*SeasonsService) Retrieve added in v0.7.0

func (s *SeasonsService) Retrieve(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) RetrieveAmendment added in v0.7.0

func (s *SeasonsService) RetrieveAmendment(
	ctx context.Context, seasonKey, amendmentID string,
) (map[string]any, error)

func (*SeasonsService) RetrieveBlock added in v0.9.0

func (s *SeasonsService) RetrieveBlock(ctx context.Context, seasonKey string) (map[string]any, error)

RetrieveBlock reads the Season's seats set aside on every date: "block" with its "mode" ("block" once on, else "per_hold"), "state", "counts" and each date's "state".

func (*SeasonsService) RetrieveBooking added in v0.7.0

func (s *SeasonsService) RetrieveBooking(
	ctx context.Context, seasonKey, actionID string,
) (map[string]any, error)

func (*SeasonsService) RetrieveBulkJob added in v0.9.0

func (s *SeasonsService) RetrieveBulkJob(ctx context.Context, seasonKey, jobID string) (map[string]any, error)

RetrieveBulkJob reads one bulk job with its counts and up to 500 failed items. Its summary is what the job ended with, empty until it completes: for a holder_import job the bring-across counts, for a renewal_run job batchId, offered, skipped and failed.

func (*SeasonsService) RetrieveHold added in v0.7.0

func (s *SeasonsService) RetrieveHold(
	ctx context.Context, seasonKey, operationID string,
) (map[string]any, error)

func (*SeasonsService) RetrieveHolderImport added in v0.7.0

func (s *SeasonsService) RetrieveHolderImport(
	ctx context.Context, seasonKey, importID string,
) (map[string]any, error)

func (*SeasonsService) RetrieveHostedRenewals added in v0.9.0

func (s *SeasonsService) RetrieveHostedRenewals(
	ctx context.Context, seasonKey string, options ...SeasonOfferPageParams,
) (map[string]any, error)

RetrieveHostedRenewals reads renewal links, payments and emails for one page of renewal offers, newest first; the answer's nextCursor reads the next page and is null on the last. Pass one SeasonOfferPageParams to page (Limit 1-500, default 500).

func (*SeasonsService) RetrieveLifecycle added in v0.7.0

func (s *SeasonsService) RetrieveLifecycle(
	ctx context.Context, seasonKey, operationID string,
) (map[string]any, error)

func (*SeasonsService) RetrievePlan added in v0.7.0

func (s *SeasonsService) RetrievePlan(
	ctx context.Context, seasonKey, planKey string,
) (map[string]any, error)

func (*SeasonsService) RetrieveRenewalOffer added in v0.7.0

func (s *SeasonsService) RetrieveRenewalOffer(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

func (*SeasonsService) RetrieveRenewalQuote added in v0.9.0

func (s *SeasonsService) RetrieveRenewalQuote(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

RetrieveRenewalQuote reads what renewing an offer costs, priced as the SeatLayer checkout will charge it. "problem" is null when SeatLayer checkout can take the renewal now; otherwise it says why not.

func (*SeasonsService) RetrieveReport added in v0.7.0

func (s *SeasonsService) RetrieveReport(ctx context.Context, seasonKey string) (map[string]any, error)

func (*SeasonsService) RetrieveSalesReport added in v0.9.0

func (s *SeasonsService) RetrieveSalesReport(ctx context.Context, seasonKey string) (map[string]any, error)

RetrieveSalesReport reads Season money, seats, holders and renewals as totals.

func (*SeasonsService) RetrieveSeatCounts added in v0.9.0

func (s *SeasonsService) RetrieveSeatCounts(ctx context.Context, seasonKey string) (map[string]any, error)

RetrieveSeatCounts reads Season seats sold per package and per date.

func (*SeasonsService) RetrieveSeatsReport added in v0.9.0

func (s *SeasonsService) RetrieveSeatsReport(ctx context.Context, seasonKey string) (map[string]any, error)

RetrieveSeatsReport reads the seats still free per package and per date.

func (*SeasonsService) RetrieveSupportLookup added in v0.7.0

func (s *SeasonsService) RetrieveSupportLookup(
	ctx context.Context, seasonKey string, p *SeasonSupportLookupParams,
) (map[string]any, error)

func (*SeasonsService) ReturnOccurrenceInventory added in v0.9.0

func (s *SeasonsService) ReturnOccurrenceInventory(
	ctx context.Context, seasonKey, eventKey string, p SeasonOccurrenceReturnParams,
) (map[string]any, error)

ReturnOccurrenceInventory returns one Season occurrence allocation to ordinary Event inventory. It is single-attempt; ActionID makes a repeat safe.

func (*SeasonsService) RevokeBuyerAccessSession added in v0.7.0

func (s *SeasonsService) RevokeBuyerAccessSession(
	ctx context.Context, seasonKey, sessionID string,
) (map[string]any, error)
func (s *SeasonsService) RotateRenewalOfferLink(
	ctx context.Context, seasonKey, offerID string,
) (map[string]any, error)

RotateRenewalOfferLink makes a new renewal link for one holder; the old link stops working. The link is shown once, so this is deliberately single-attempt.

func (*SeasonsService) SetAsideBlock added in v0.9.0

func (s *SeasonsService) SetAsideBlock(
	ctx context.Context, seasonKey string, p SeasonBlockSetAsideParams,
) (map[string]any, error)

SetAsideBlock sets the Season's seats aside on every date: every seat its packages price, minus KeepForSingleTickets. The answer is 202 {"job": ..., "block": ...}: a season_block_set_aside job to follow with RetrieveBulkJob. On an active Season block mode turns on by itself once every date has the seats (season.block.ready); on a draft, Publish turns it on. Season seats must be on for the Season (409 season_block_not_enabled otherwise). It is retried safely with one Idempotency-Key, which replays the same answer; an empty IdempotencyKey generates one.

func (*SeasonsService) SupersedePlan added in v0.7.0

func (s *SeasonsService) SupersedePlan(
	ctx context.Context, seasonKey, planKey string, expectedRevision int,
) (map[string]any, error)

func (*SeasonsService) Update added in v0.7.0

func (s *SeasonsService) Update(
	ctx context.Context, seasonKey string, p SeasonUpdateParams,
) (map[string]any, error)

Update changes a Season at ExpectedRevision. The answer's singleTicketDates may carry jobRefused: why the season_singles job could not start. The change still stands, and sending SingleTickets true again opens any date still not open. An exact retry with the same ExpectedRevision and IdempotencyKey is not applied twice.

func (*SeasonsService) UpdatePlan added in v0.9.0

func (s *SeasonsService) UpdatePlan(
	ctx context.Context, seasonKey, planKey string, p SeasonPlanUpdateParams,
) (map[string]any, error)

UpdatePlan renames a draft package or changes the performances it covers.

func (*SeasonsService) UpdateRenewalOfferContact added in v0.9.0

func (s *SeasonsService) UpdateRenewalOfferContact(
	ctx context.Context, seasonKey, offerID string, p SeasonRenewalContactParams,
) (map[string]any, error)

UpdateRenewalOfferContact sets the name and email a renewal offer is sent to. It is single-attempt.

func (*SeasonsService) Validate added in v0.7.0

func (s *SeasonsService) Validate(ctx context.Context, p SeasonSelectionParams) (map[string]any, error)

Validate is a read-only compatibility preflight.

func (*SeasonsService) ValidateBuyerRehearsal added in v0.7.0

func (s *SeasonsService) ValidateBuyerRehearsal(
	ctx context.Context, seasonKey string,
) (map[string]any, error)

type SessionsService

type SessionsService struct {
	// contains filtered or unexported fields
}

SessionsService mints short-lived, origin-bound browser tokens.

The governing rule: the SDK mints tokens, widgets consume them. Your secret key never reaches a browser.

func (*SessionsService) CreateDesignerSession

func (s *SessionsService) CreateDesignerSession(
	ctx context.Context, p DesignerSessionParams,
) (DesignerSessionEnvelope, error)

CreateDesignerSession mints a token so an organiser can edit a chart inside your own UI.

func (*SessionsService) CreateManageSession

func (s *SessionsService) CreateManageSession(
	ctx context.Context, eventKey string, p ManageSessionParams,
) (ManageSession, error)

CreateManageSession mints a manage-session token for the control room.

The raw API defaults an omitted list to view-only (event:view). This SDK still requires an explicit set so browser authority remains visible at every call site.

func (*SessionsService) RevokeDesignerSession

func (s *SessionsService) RevokeDesignerSession(ctx context.Context, sessionID string) error

RevokeDesignerSession invalidates a designer token before it expires.

func (*SessionsService) RevokeManageSession

func (s *SessionsService) RevokeManageSession(ctx context.Context, eventKey, sessionID string) error

RevokeManageSession invalidates a manage token before it expires.

type TemplateInstantiateParams added in v0.4.0

type TemplateInstantiateParams struct {
	Name           string
	WorkspaceID    string
	EditedDoc      map[string]any
	Version        int
	SHA256         string
	IdempotencyKey string
}

TemplateInstantiateParams optionally pins a catalog snapshot or overrides the draft that the API creates. EditedDoc is sent whenever it is non-nil, including an empty object.

type TemplatesService added in v0.4.0

type TemplatesService struct {
	// contains filtered or unexported fields
}

TemplatesService materializes published catalog templates as draft charts.

func (*TemplatesService) InstantiateTemplate added in v0.4.0

func (s *TemplatesService) InstantiateTemplate(
	ctx context.Context, templateID string, options ...TemplateInstantiateParams,
) (map[string]any, error)

InstantiateTemplate materializes a published catalog template as a draft chart. The body is always a JSON object, even when no optional parameters are supplied. The API supports exact header replay for this operation.

type TicketRelease added in v0.4.0

type TicketRelease struct {
	ID            string  `json:"id"`
	Position      int     `json:"position"`
	Name          string  `json:"name"`
	CategoryKey   *string `json:"categoryKey"`
	Price         int     `json:"price"`
	PreviousPrice *int    `json:"previousPrice"`
	Quota         *int    `json:"quota"`
	StartsAt      *int64  `json:"startsAt"`
	EndsAt        *int64  `json:"endsAt"`
	Action        string  `json:"action"`
	ActionURL     *string `json:"actionUrl"`
	SoldOutAt     *int64  `json:"soldOutAt"`
	Consumed      *int    `json:"consumed,omitempty"`
	Remaining     *int    `json:"remaining"`
}

TicketRelease is the live response shape. Consumed and Remaining are calculated by the service and therefore are not accepted by replacement.

type TicketReleaseList added in v0.4.0

type TicketReleaseList struct {
	Releases []TicketRelease `json:"releases"`
}

type TicketReleaseReplaceInput added in v0.4.0

type TicketReleaseReplaceInput struct {
	ID            NullableField[string]
	Name          string
	CategoryKey   NullableField[string]
	Price         int
	PreviousPrice NullableField[int]
	Quota         NullableField[int]
	StartsAt      NullableField[int64]
	EndsAt        NullableField[int64]
	Action        string
	ActionURL     NullableField[string]
}

TicketReleaseReplaceInput is the request-only release representation. Use FieldNull for an explicit JSON null and FieldValue to send an optional value. The service validates the 12-release limit and all release rules.

type TrustedInventoryAccess added in v0.3.0

type TrustedInventoryAccess struct {
	ChannelIDs []string
	// IgnoreChannelRestrictions is a privileged backend override.
	IgnoreChannelRestrictions bool
	// Reason is written to the audit trail for channel use or an override.
	Reason string
}

TrustedInventoryAccess carries private-allocation authority for trusted server inventory mutations.

type ValidationError

type ValidationError struct{ APIError }

ValidationError is a 422 — the request was understood and rejected.

type WebhookCreateEnvelope added in v0.3.0

type WebhookCreateEnvelope struct {
	Sub    WebhookSubscription `json:"sub"`
	Secret string              `json:"secret"`
}

type WebhookDelivery added in v0.3.0

type WebhookDelivery struct {
	ID           string           `json:"id"`
	At           int64            `json:"at"`
	Event        WebhookEventName `json:"event"`
	Ref          *string          `json:"ref"`
	Status       int              `json:"status"`
	Attempt      int              `json:"attempt"`
	MaxAttempts  int              `json:"maxAttempts"`
	WillRetry    bool             `json:"willRetry"`
	OccurrenceID *string          `json:"occurrenceId"`
	Payload      any              `json:"payload"`
	ResponseBody *string          `json:"responseBody"`
	ErrorMessage *string          `json:"errorMessage"`
}

type WebhookDeliveryListParams added in v0.3.0

type WebhookDeliveryListParams struct {
	Limit  int
	Status WebhookDeliveryStatus
	Before int64
}

WebhookDeliveryListParams filters and pages delivery attempts.

type WebhookDeliveryPage added in v0.3.0

type WebhookDeliveryPage struct {
	Deliveries []WebhookDelivery `json:"deliveries"`
	NextBefore *int64            `json:"nextBefore,omitempty"`
}

type WebhookDeliveryStatus added in v0.3.0

type WebhookDeliveryStatus string

WebhookDeliveryStatus filters webhook delivery attempts.

const (
	WebhookDeliveryOK     WebhookDeliveryStatus = "ok"
	WebhookDeliveryFailed WebhookDeliveryStatus = "failed"
)

type WebhookEnvelope added in v0.3.0

type WebhookEnvelope struct {
	Sub WebhookSubscription `json:"sub"`
}

type WebhookEventName added in v0.3.0

type WebhookEventName string

WebhookEventName is one of the event names accepted by webhook create/update.

const (
	WebhookEventSeatBooked                      WebhookEventName = "seat.booked"
	WebhookEventSeatReleased                    WebhookEventName = "seat.released"
	WebhookEventSeatBlocked                     WebhookEventName = "seat.blocked"
	WebhookEventHoldExpired                     WebhookEventName = "hold.expired"
	WebhookEventHoldCreated                     WebhookEventName = "hold.created"
	WebhookEventHoldExtended                    WebhookEventName = "hold.extended"
	WebhookEventEventCreated                    WebhookEventName = "event.created"
	WebhookEventEventSoldOut                    WebhookEventName = "event.soldout"
	WebhookEventObjectResaleListed              WebhookEventName = "object.resale.listed"
	WebhookEventObjectResaleUnlisted            WebhookEventName = "object.resale.unlisted"
	WebhookEventObjectResaleSold                WebhookEventName = "object.resale.sold"
	WebhookEventCustomerCreated                 WebhookEventName = "customer.created"
	WebhookEventCustomerEmailChanged            WebhookEventName = "customer.email_changed"
	WebhookEventOrderPaid                       WebhookEventName = "order.paid"
	WebhookEventOrderRefunded                   WebhookEventName = "order.refunded"
	WebhookEventOrderCancelled                  WebhookEventName = "order.cancelled"
	WebhookEventSeasonTicketTransferSent        WebhookEventName = "season.ticket.transfer_sent"
	WebhookEventSeasonTicketTransferred         WebhookEventName = "season.ticket.transferred"
	WebhookEventSeasonTicketTransferCancelled   WebhookEventName = "season.ticket.transfer_cancelled"
	WebhookEventSeasonTicketIssued              WebhookEventName = "season.ticket.issued"
	WebhookEventSeasonTicketVoided              WebhookEventName = "season.ticket.voided"
	WebhookEventSeasonStructureActivated        WebhookEventName = "season.structure.activated"
	WebhookEventSeasonStructureClosed           WebhookEventName = "season.structure.closed"
	WebhookEventSeasonStructureArchived         WebhookEventName = "season.structure.archived"
	WebhookEventSeasonPlanPublished             WebhookEventName = "season.plan.published"
	WebhookEventSeasonPlanSuperseded            WebhookEventName = "season.plan.superseded"
	WebhookEventSeasonSalesOpened               WebhookEventName = "season.sales.opened"
	WebhookEventSeasonSalesPaused               WebhookEventName = "season.sales.paused"
	WebhookEventSeasonSalesEnded                WebhookEventName = "season.sales.ended"
	WebhookEventSeasonHoldCommitted             WebhookEventName = "season.hold.committed"
	WebhookEventSeasonHoldReleased              WebhookEventName = "season.hold.released"
	WebhookEventSeasonHoldExpired               WebhookEventName = "season.hold.expired"
	WebhookEventSeasonBookingConfirmed          WebhookEventName = "season.booking.confirmed"
	WebhookEventSeasonBookingCancelled          WebhookEventName = "season.booking.cancelled"
	WebhookEventSeasonBookingEmergencyRequested WebhookEventName = "season.booking.emergency_requested"
	WebhookEventSeasonOccurrenceReturned        WebhookEventName = "season.occurrence.returned"
	WebhookEventSeasonOccurrenceReclaimed       WebhookEventName = "season.occurrence.reclaimed"
	WebhookEventSeasonRenewalOffered            WebhookEventName = "season.renewal.offered"
	WebhookEventSeasonRenewalIntentReceived     WebhookEventName = "season.renewal.intent_received"
	WebhookEventSeasonRenewalRenewed            WebhookEventName = "season.renewal.renewed"
	WebhookEventSeasonRenewalDeclined           WebhookEventName = "season.renewal.declined"
	WebhookEventSeasonRenewalLapsed             WebhookEventName = "season.renewal.lapsed"
	WebhookEventSeasonRenewalReleased           WebhookEventName = "season.renewal.released"
	WebhookEventSeasonOperationPartialTerminal  WebhookEventName = "season.operation.partial_terminal"
	WebhookEventSeasonAmendmentApplied          WebhookEventName = "season.amendment.applied"
	WebhookEventSeasonPerformanceAdded          WebhookEventName = "season.performance.added"
	WebhookEventSeasonPerformanceRemoved        WebhookEventName = "season.performance.removed"
	WebhookEventSeasonPerformancePast           WebhookEventName = "season.performance.past"
	WebhookEventSeasonPerformancePostponed      WebhookEventName = "season.performance.postponed"
	WebhookEventSeasonPerformanceCancelled      WebhookEventName = "season.performance.cancelled"
	WebhookEventSeasonPerformanceRescheduled    WebhookEventName = "season.performance.rescheduled"
	WebhookEventSeasonBulkActionCompleted       WebhookEventName = "season.bulk_action.completed"
	WebhookEventSeasonBlockReady                WebhookEventName = "season.block.ready"
	WebhookEventSeasonBlockReleased             WebhookEventName = "season.block.released"
	WebhookEventSeasonOrderPaid                 WebhookEventName = "season.order.paid"
	WebhookEventSeasonOrderRefunded             WebhookEventName = "season.order.refunded"
	WebhookEventSeriesCreated                   WebhookEventName = "series.created"
	WebhookEventSeriesDatesAdded                WebhookEventName = "series.dates_added"
)

The 58 public webhook event names, in the order the API lists them.

type WebhookList added in v0.3.0

type WebhookList struct {
	Subs []WebhookSubscription `json:"subs"`
}

type WebhookSubscription added in v0.3.0

type WebhookSubscription struct {
	ID          string             `json:"id"`
	URL         string             `json:"url"`
	Events      []WebhookEventName `json:"events"`
	Disabled    bool               `json:"disabled"`
	LastStatus  *string            `json:"lastStatus"`
	LastAt      *int64             `json:"lastAt"`
	CreatedAt   int64              `json:"createdAt"`
	Mode        *string            `json:"mode"`
	Environment *string            `json:"environment"`
	Uptime7d    *float64           `json:"uptime7d"`
}

WebhookSubscription is the public subscription projection. The signing secret is intentionally absent after creation.

type WebhookUpdateParams added in v0.3.0

type WebhookUpdateParams struct {
	URL      string
	Events   []WebhookEventName
	Disabled *bool
}

WebhookUpdateParams describes the only mutable subscription fields.

type WebhooksService

type WebhooksService struct {
	// contains filtered or unexported fields
}

WebhooksService manages webhook subscriptions. To VERIFY a delivery, see VerifyWebhook.

func (*WebhooksService) Create

func (s *WebhooksService) Create(
	ctx context.Context, targetURL string, events []WebhookEventName,
) (WebhookCreateEnvelope, error)

Create registers a subscription. The response carries the signing secret once.

func (*WebhooksService) Delete

func (s *WebhooksService) Delete(ctx context.Context, webhookID string) error

Delete removes a subscription.

func (*WebhooksService) List

List returns the webhook subscriptions.

func (*WebhooksService) ListDeliveries

func (s *WebhooksService) ListDeliveries(
	ctx context.Context, webhookID string, options ...WebhookDeliveryListParams,
) (WebhookDeliveryPage, error)

ListDeliveries returns recent delivery attempts for a subscription. The optional params value preserves the original no-filter call shape.

func (*WebhooksService) Update

func (s *WebhooksService) Update(
	ctx context.Context, webhookID string, p WebhookUpdateParams,
) (WebhookEnvelope, error)

Update changes a subscription.

type WorkspaceCreateParams added in v0.3.0

type WorkspaceCreateParams struct {
	Name           string
	ExternalRef    NullableField[string]
	DefaultRegion  EventHostingRegion
	IdempotencyKey string
}

WorkspaceCreateParams preserves omitted, valued, and explicit-null external references. Use FieldNull[string]() to request JSON null.

type WorkspaceUpdateParams added in v0.8.0

type WorkspaceUpdateParams struct {
	Name          string
	DefaultRegion EventHostingRegion
}

WorkspaceUpdateParams supplies typed workspace fields. A zero region leaves the current default unchanged.

type WorkspacesService

type WorkspacesService struct {
	// contains filtered or unexported fields
}

WorkspacesService manages workspaces, which isolate one tenant's charts and events from another's.

func (*WorkspacesService) Create

Create provisions a workspace with exact nullable wire semantics.

func (*WorkspacesService) List

func (s *WorkspacesService) List(ctx context.Context) (map[string]any, error)

List returns the organisation's workspaces.

func (*WorkspacesService) Retrieve

func (s *WorkspacesService) Retrieve(ctx context.Context, workspaceID string) (map[string]any, error)

Retrieve fetches one workspace.

func (*WorkspacesService) Update

func (s *WorkspacesService) Update(
	ctx context.Context, workspaceID string, fields map[string]any,
) (map[string]any, error)

Update renames, re-references, or disables a workspace.

The organisation's default workspace cannot be disabled — the API answers 409 default_workspace_required. Promote another one first.

func (*WorkspacesService) UpdateWithParams added in v0.8.0

func (s *WorkspacesService) UpdateWithParams(
	ctx context.Context, workspaceID string, p WorkspaceUpdateParams,
) (map[string]any, error)

UpdateWithParams changes typed workspace settings, including the default used only by Events created after the update.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL