{"info":{"title":"Sonik Booking Service API","version":"0.2.0","description":"Generated contract truth for the Sonik booking service.\n\nThis is the booking surface denominator, not the legacy Node API inventory. Operations expose machine-readable x-sonik-status and x-sonik-adapter metadata:\n- mounted/mounted: served by sonik-booking-service today.\n- shadow/not-mounted: typed contract truth for future booking families; not mounted by runtime yet.\n\nThe document is generated from oRPC contract metadata, stamped with Better Auth session security, verified booking error rows, and committed fixture examples. Do not hand-edit the generated OpenAPI document.\n\nEvent is not a space: @sonikfm/events owns the aggregate and booking does not mint Venues. Offer and Ticketeer composition reuses canonical InventoryPool capacity and RatePlan/RateAssignment truth. Canonical Event lifecycle, Offer CRUD/lifecycle, exact-one-Offer intent resolution, direct or held zero-total commitment, Event ticket reads, proof-gated Ticket ownership claims, Event Sessions, access points, online scan authorization/record/reversal, bounded signed offline leases, and authoritative reconciliation are mounted on organization-scoped Postgres. Positive-total commitment fails closed before Booking or inventory mutation until payment settlement mounts. Scanner-v2 adoption, providers, adjustments, and rich policy evaluation consequences remain explicit shadow contracts. VIP is presentation only, buyer and attendee remain separate, and provider evidence is advisory."},"servers":[{"url":"/"}],"tags":[{"name":"booking-provider-connections","description":"Authenticated organizer provider connections and bounded synchronization."},{"name":"booking-billing","description":"The organization's plan, read from amplify's billing router over the OAuth rail."},{"name":"booking-payments","description":"Payment webhooks that failed every queue retry: the organization's list and a redrive through the payment module."},{"name":"booking","description":"Greenfield booking service contracts. Mounted operations are live; shadow operations are future contract truth only."},{"name":"bookings","description":"Booking lifecycle, party, and assigned-resource operations. Operation status metadata identifies mounted versus shadow behavior."},{"name":"booking-guests","description":"Booking guest records derived from authenticated organization context."},{"name":"booking-customers","description":"Organization-scoped booking customer records and updates."},{"name":"booking-house-accounts","description":"House-account balances, ledger entries, and statements."},{"name":"booking-customer-profiles","description":"Customer preference profiles and derived booking insights."},{"name":"booking-resources","description":"Resource types, units, blocks, and compatible resource combinations."},{"name":"booking-inventory-pools","description":"Mounted standalone counted-capacity pools with explicit hold, commit, held-release, and capacity-management operations. Existing direct Booking and Hold→Booking paths do not automatically claim a pool; Booking cancellation releases committed claims. Policy may constrain claims but never owns the count."},{"name":"booking-waitlist","description":"Waitlist entry lifecycle, offers, claims, and expiration."},{"name":"booking-policies","description":"Mounted narrow booking policies plus deprecated mutable rate-plan compatibility routes. New commercial composition uses the canonical versioned booking-commercial rate authority."},{"name":"booking-commercial","description":"Canonical immutable RatePlan, Policy, and PolicySet identity/version authoring plus RateAssignment and PolicyBinding persistence are mounted. Live policy evaluation consequences and external evaluator execution remain shadow; operation metadata makes the boundary explicit."},{"name":"booking-holds","description":"Time-bounded inventory holds and hold-to-booking commitment operations."},{"name":"booking-quotes","description":"Server-derived booking quotes and commercial snapshots."},{"name":"booking-templates","description":"Public read-only organizer template manifests and dry-run/browser handoff reports; no install mutation is mounted here."},{"name":"booking-media","description":"Authenticated private media assets for bookable contexts. Backed by BOOKING_MEDIA_BUCKET; public CDN rendering remains deferred."},{"name":"booking-events","description":"Mounted canonical Event draft, readiness, publication, and lifecycle operations over @sonikfm/events schemas. Event is not a space; booking contexts remain fulfillment projections, and booking does not mint Venues."},{"name":"booking-event-providers","description":"Governed provider-neutral authority profiles and advisory admissibility evaluation. Evidence never authenticates, authorizes mutation, or calls a provider."},{"name":"booking-event-associations","description":"Unpublished, unmounted companion EventAssociation projection with strict redacted public and participant views."},{"name":"booking-event-offers","description":"Mounted narrow Offer and Ticketeer composition over typed inventory requirements, a base RateAssignment, sales windows, issuance rules, and policy-free Event-entry grants. Rich adjustments, policies, and multi-resource combinations remain typed but unmounted. VIP is a label, not a schema lane."},{"name":"booking-event-tickets","description":"Mounted Event ticket reads, zero-total issuance, and Identity-proof-gated ownership claims with explicit buyer and attendee separation across the same direct-commitment and held-commitment graph. Attendee mutation remains shadow."},{"name":"booking-event-orders","description":"Mounted read-only Event order list and detail projections over canonical Booking, Payment, refund, and Ticket state with stable pagination and explicit cross-authority disagreements."},{"name":"booking-event-access","description":"Mounted Event zones, Sessions, access points, online authorization, append-only scans, typed denials, reversal, bounded signed offline leases, and authoritative reconciliation. Scanner-v2 adoption remains deferred."},{"name":"booking-disputes","description":"Shadow Dispute Center host surface: case files, derived read-only timeline, the evidence stage → review → submit machine with its consume-once review token, irreversible accept, auto-file policy, and early-fraud-warning rows. Contract truth only; provider commands stay behind the payments package and its integration-manifest gate."},{"name":"booking-loyalty","description":"Shadow Loyalty v2 host surface: members, the derived append-only ledger (read-only by design), adjustments with typed policy-gate outcomes, replay-resolved claims, versioned simulatable policy, challenges, ledger-reconciled analytics, and consent-filtered Amplify segment export. Contract truth only."},{"name":"embed-studio","description":"Mounted org-scoped embed-manifest authoring for the internal embedding studio: autosaved draft with ETag guard, transactional publish to immutable versions with a live pointer, rollback by pointer flip, and operator hour metering. Save-as-template promotion remains draft/unmounted pending its own slice (T9b). Manifests carry structure and theme-by-value only — never monetary amounts."},{"name":"booking-seatmaps","description":"Mounted org-scoped seatmap venue documents: create, list, autosaved draft with an ETag guard, and delete. Publish, immutable versions, and rollback are a later wave and are absent by design. The venue payload is opaque geometry validated for structure only — it never carries monetary amounts, which resolve server-side at quote time."}],"openapi":"3.1.1","paths":{"/api/v1/booking/provider-connections/eventbrite":{"post":{"operationId":"bookingConnectProviderEventbrite","summary":"Connect an Eventbrite organizer","description":"Verify organizer membership through the SDK and store tenant-bound encrypted credentials. Returns only redacted connection state.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"privateToken":{"type":"string","minLength":1,"maxLength":4096,"pattern":"^[\\x21-\\x7E]+$","description":"Organizer private token. Encrypted at rest; never returned."},"providerOrganizationId":{"type":"string","maxLength":128,"pattern":"^\\d+$"}},"required":["privateToken","providerOrganizationId"],"additionalProperties":false},"example":{"privateToken":"fixture-eventbrite-token-not-a-credential","providerOrganizationId":"123456789"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"const":"eventbrite"},"webhookStatus":{"enum":["subscribed","not_configured"],"type":"string","description":"Subscription setup result; absent trusted public callback configuration keeps receive closed."},"status":{"enum":["connected","error","disconnected"],"type":"string","description":"error = the get-self preflight failed; the card shows the named failure."},"providerAccountId":{"type":"string","maxLength":128,"pattern":"^\\d+$"},"calendarName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null: the membership preflight proves an organizer identifier, not its display name."},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Eventbrite organization identifier verified against the token's memberships."},"lastSyncAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 end of the last completed sync; null before the first sync."},"connectedAt":{"type":"string","description":"ISO 8601 when the key was stored."},"eventCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Persisted Eventbrite events for the active organizer, including private or inactive records."}},"required":["provider","status","providerAccountId","calendarName","scope","lastSyncAt","connectedAt","eventCount"],"additionalProperties":false,"description":"Eventbrite organizer connection. Contains no token or ciphertext."},"example":{"provider":"eventbrite","status":"connected","providerAccountId":"7","calendarName":null,"scope":"7","lastSyncAt":null,"connectedAt":"2026-09-18T13:00:00.000Z","eventCount":0}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad Request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Unauthorized"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"FORBIDDEN"},"status":{"const":403},"message":{"type":"string","default":"Forbidden"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking JSON mutations require application/json"}}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"TOO_MANY_REQUESTS"},"status":{"const":429},"message":{"type":"string","default":"Too Many Requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"TOO_MANY_REQUESTS","message":"Provider rate limited"}}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_GATEWAY"},"status":{"const":502},"message":{"type":"string","default":"Bad Gateway"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"BAD_GATEWAY","message":"Provider transport or response failed"}}}}},"503":{"description":"503","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"SERVICE_UNAVAILABLE"},"status":{"const":503},"message":{"type":"string","default":"Service Unavailable"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking authentication context unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingGetProviderEventbrite","summary":"Read the Eventbrite connection","description":"Read the active account, sync timestamp and persisted event count without credentials or contacting Eventbrite.","tags":["booking-provider-connections"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"const":"eventbrite"},"webhookStatus":{"enum":["subscribed","not_configured"],"type":"string","description":"Subscription setup result; absent trusted public callback configuration keeps receive closed."},"status":{"enum":["connected","error","disconnected"],"type":"string","description":"error = the get-self preflight failed; the card shows the named failure."},"providerAccountId":{"type":"string","maxLength":128,"pattern":"^\\d+$"},"calendarName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null: the membership preflight proves an organizer identifier, not its display name."},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Eventbrite organization identifier verified against the token's memberships."},"lastSyncAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 end of the last completed sync; null before the first sync."},"connectedAt":{"type":"string","description":"ISO 8601 when the key was stored."},"eventCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Persisted Eventbrite events for the active organizer, including private or inactive records."}},"required":["provider","status","providerAccountId","calendarName","scope","lastSyncAt","connectedAt","eventCount"],"additionalProperties":false,"description":"Eventbrite organizer connection. Contains no token or ciphertext."},"example":{"provider":"eventbrite","status":"connected","providerAccountId":"7","calendarName":null,"scope":"7","lastSyncAt":null,"connectedAt":"2026-09-18T13:00:00.000Z","eventCount":0}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Unauthorized"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"FORBIDDEN"},"status":{"const":403},"message":{"type":"string","default":"Forbidden"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not Found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking authentication context unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/eventbrite/sync":{"post":{"operationId":"bookingSyncProviderEventbrite","summary":"Sync a bounded page range of Eventbrite organizer events","description":"Verify membership and atomically update tenant-owned events and sessions. Returned inactive records retract visibility; absent rows remain. nextPage exposes continuation.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":10000,"default":1},"maxPages":{"type":"integer","minimum":1,"maximum":20,"default":5}},"additionalProperties":false},"example":{"page":1,"maxPages":5}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"const":"eventbrite"},"eventsUpserted":{"type":"integer","minimum":0,"maximum":9007199254740991},"nextPage":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]},"lastSyncAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["provider","eventsUpserted","nextPage","lastSyncAt"],"additionalProperties":false},"example":{"provider":"eventbrite","eventsUpserted":1,"nextPage":null,"lastSyncAt":"2026-09-18T13:01:00.000Z"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad Request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Unauthorized"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"FORBIDDEN"},"status":{"const":403},"message":{"type":"string","default":"Forbidden"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not Found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CONFLICT"},"status":{"const":409},"message":{"type":"string","default":"Conflict"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"CONFLICT","message":"Provider connection changed during sync"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking JSON mutations require application/json"}}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"TOO_MANY_REQUESTS"},"status":{"const":429},"message":{"type":"string","default":"Too Many Requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"TOO_MANY_REQUESTS","message":"Provider rate limited"}}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_GATEWAY"},"status":{"const":502},"message":{"type":"string","default":"Bad Gateway"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"BAD_GATEWAY","message":"Provider transport or response failed"}}}}},"503":{"description":"503","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"SERVICE_UNAVAILABLE"},"status":{"const":503},"message":{"type":"string","default":"Service Unavailable"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking authentication context unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/luma/events/create":{"post":{"operationId":"bookingCreateLumaEvent","summary":"Create a Luma event","description":"Executes the provider SDK request after organizer authorization and refreshes the local organizer mirror. The MCP door requires explicit confirmation.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"example":{"name":"Fixture Event","start_at":"2026-10-01T18:00:00Z","timezone":"UTC"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"const":"luma"},"commandId":{"const":"events.event.manage"},"operation":{"enum":["create","update","cancel"],"type":"string"},"status":{"const":"completed"}},"required":["provider","commandId","operation","status"],"additionalProperties":false},"example":{"provider":"luma","commandId":"events.event.manage","operation":"create","status":"completed"}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/luma/events/update":{"post":{"operationId":"bookingUpdateLumaEvent","summary":"Update a Luma event","description":"Executes the provider SDK request after organizer authorization and refreshes the local organizer mirror. The MCP door requires explicit confirmation.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"example":{"event_id":"evt-fixture-1","name":"Updated Fixture Event"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"const":"luma"},"commandId":{"const":"events.event.manage"},"operation":{"enum":["create","update","cancel"],"type":"string"},"status":{"const":"completed"}},"required":["provider","commandId","operation","status"],"additionalProperties":false},"example":{"provider":"luma","commandId":"events.event.manage","operation":"update","status":"completed"}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/luma/events/cancel":{"post":{"operationId":"bookingCancelLumaEvent","summary":"Cancel a Luma event","description":"Executes the provider SDK request after organizer authorization and refreshes the local organizer mirror. The MCP door requires explicit confirmation.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"example":{"event_id":"evt-fixture-1","cancellation_token":"fixture-cancellation-token"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"const":"luma"},"commandId":{"const":"events.event.manage"},"operation":{"enum":["create","update","cancel"],"type":"string"},"status":{"const":"completed"}},"required":["provider","commandId","operation","status"],"additionalProperties":false},"example":{"provider":"luma","commandId":"events.event.manage","operation":"cancel","status":"completed"}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"destructive","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/luma":{"post":{"operationId":"bookingConnectProviderLuma","summary":"Connect a Luma calendar","description":"Stores the organizer's calendar-scoped Luma API key as provider_connection ciphertext, runs the events.provider_account.preflight SDK plan (GET /v1/users/get-self) and records the user identity without inferring calendar metadata. The key is never returned.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string","minLength":1,"maxLength":200,"description":"Calendar-scoped Luma API key (Luma Plus). Sealed to provider_connection ciphertext on write; never echoed by any operation."}},"required":["apiKey"],"additionalProperties":false},"example":{"apiKey":"fixture-luma-key-not-a-credential"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"enum":["luma"],"type":"string","description":"Connected event provider. Luma only until Eventbrite lands on the same card."},"webhookStatus":{"enum":["subscribed","not_configured"],"type":"string","description":"Subscription setup result; absent trusted public callback configuration keeps receive closed."},"status":{"enum":["connected","error","disconnected"],"type":"string","description":"error = the get-self preflight failed; the card shows the named failure."},"providerAccountId":{"type":"string","description":"Luma identity api_id captured by the get-self preflight."},"calendarName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Calendar display name only when separately verified; get-self supplies a user identity, so preflight alone leaves this null."},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Luma calendar api_id the key is scoped to."},"lastSyncAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 end of the last completed sync; null before the first sync."},"connectedAt":{"type":"string","description":"ISO 8601 when the key was stored."},"eventCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Luma-sourced booking_event rows for this organization."}},"required":["provider","status","providerAccountId","calendarName","scope","lastSyncAt","connectedAt","eventCount"],"additionalProperties":false,"description":"Connections-card state for one provider. Never carries key material."},"example":{"provider":"luma","status":"connected","providerAccountId":"usr-6f2f6c1d0b3a4e21","calendarName":null,"scope":"cal-9d41c3f7a8b25e60","lastSyncAt":null,"connectedAt":"2026-09-18T13:00:00.000Z","eventCount":0}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/{provider}":{"get":{"operationId":"bookingGetProviderConnection","summary":"Get one provider connection","description":"Connections-card read: status, calendar identity, last sync and Luma-sourced event count. Never carries key material.","tags":["booking-provider-connections"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"enum":["luma"],"type":"string","description":"Connected event provider. Luma only until Eventbrite lands on the same card."},"example":"luma"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"enum":["luma"],"type":"string","description":"Connected event provider. Luma only until Eventbrite lands on the same card."},"webhookStatus":{"enum":["subscribed","not_configured"],"type":"string","description":"Subscription setup result; absent trusted public callback configuration keeps receive closed."},"status":{"enum":["connected","error","disconnected"],"type":"string","description":"error = the get-self preflight failed; the card shows the named failure."},"providerAccountId":{"type":"string","description":"Luma identity api_id captured by the get-self preflight."},"calendarName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Calendar display name only when separately verified; get-self supplies a user identity, so preflight alone leaves this null."},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Luma calendar api_id the key is scoped to."},"lastSyncAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 end of the last completed sync; null before the first sync."},"connectedAt":{"type":"string","description":"ISO 8601 when the key was stored."},"eventCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Luma-sourced booking_event rows for this organization."}},"required":["provider","status","providerAccountId","calendarName","scope","lastSyncAt","connectedAt","eventCount"],"additionalProperties":false,"description":"Connections-card state for one provider. Never carries key material."},"example":{"provider":"luma","status":"connected","providerAccountId":"usr-6f2f6c1d0b3a4e21","calendarName":null,"scope":"cal-9d41c3f7a8b25e60","lastSyncAt":"2026-09-18T13:05:00.000Z","connectedAt":"2026-09-18T13:00:00.000Z","eventCount":2}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/provider-connections/luma/sync":{"post":{"operationId":"bookingSyncProviderLuma","summary":"Sync Luma events into booking","description":"Pages GET /v1/calendars/events/list through the SDK plan (events.event.manage), upserts booking_event keyed (organizationId, 'luma', api_id) with one booking_event_session per window, idempotently. Skipped while lastSyncAt is fresher than 15 minutes unless force.","tags":["booking-provider-connections"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","default":false,"description":"true bypasses the 15-minute freshness window; the default sync is skipped while lastSyncAt is fresher than 15 minutes."}},"additionalProperties":false},"example":{"force":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"enum":["luma"],"type":"string","description":"Connected event provider. Luma only until Eventbrite lands on the same card."},"refreshed":{"type":"boolean","description":"false when the sync was skipped because lastSyncAt was fresher than 15 minutes."},"pagesFetched":{"type":"integer","minimum":0,"maximum":9007199254740991},"eventsUpserted":{"type":"integer","minimum":0,"maximum":9007199254740991},"sessionsUpserted":{"type":"integer","minimum":0,"maximum":9007199254740991},"externalSkipped":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"List entries with platform \"external\" are never upserted, only counted (L6 finding, Fizz 2026-09-18 13:04Z)."},"lastSyncAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 end of the sync this call observed."}},"required":["provider","refreshed","pagesFetched","eventsUpserted","sessionsUpserted","externalSkipped","lastSyncAt"],"additionalProperties":false,"description":"Outcome of one bookingSyncProviderLuma call."},"example":{"provider":"luma","refreshed":true,"pagesFetched":2,"eventsUpserted":2,"sessionsUpserted":2,"lastSyncAt":"2026-09-18T13:05:00.000Z","externalSkipped":1}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/availability/search":{"get":{"operationId":"bookingSearchAvailability","summary":"Search bookable availability across every mounted source","description":"Answers 'when can I …' across both booking spines and mounted external sources: local contexts and events, organizer sources (Luma, Eventbrite — Postgres only, never a live fan-out), and live sources (Ticketmaster — through a 15-minute cache; TripAdvisor — entitlement-gated without cache). Rows are bookable windows merged local → organizer → live and sorted by startsAt; every external row carries its attribution URL; envelope.sources reports ok / skipped_gate / skipped_no_credential / stale per source. Read effect — the generated door tool requires no confirmation. Mounted runtime: served by sonik-booking-service availability-search handlers.","tags":["booking"],"parameters":[{"name":"q","in":"query","schema":{"type":"string","minLength":1,"description":"Keyword over name / description / tags."},"allowEmptyValue":true,"allowReserved":true},{"name":"lat","in":"query","schema":{"type":"number","description":"Geo filter latitude; organizer sources post-filter on venue."},"allowEmptyValue":true,"allowReserved":true},{"name":"lng","in":"query","schema":{"type":"number","description":"Geo filter longitude."},"allowEmptyValue":true,"allowReserved":true},{"name":"radiusKm","in":"query","schema":{"type":"number","description":"Geo filter radius in kilometres."},"allowEmptyValue":true,"allowReserved":true},{"name":"from","in":"query","schema":{"type":"string","description":"Window start (ISO 8601 datetime), inclusive. Defaults server-side to now."},"allowEmptyValue":true,"allowReserved":true},{"name":"to","in":"query","schema":{"type":"string","description":"Window end (ISO 8601 datetime), inclusive. Defaults server-side to now + 14 days."},"allowEmptyValue":true,"allowReserved":true},{"name":"partySize","in":"query","schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Party size; drives the capacity filter. Defaults server-side to 1."},"allowEmptyValue":true,"allowReserved":true},{"name":"kind","in":"query","schema":{"type":"array","minItems":1,"items":{"enum":["event","slot","appointment","session"],"type":"string","description":"The kind of bookable window. `event` = a dated ticketed happening; `slot` = a schedule-computed table/opening; `appointment` = a resource-unit opening; `session` = one occurrence of a multi-session event."},"description":"Restrict to these window kinds (comma-separated in the query string). Default: all."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"sources","in":"query","schema":{"type":"array","minItems":1,"items":{"enum":["local","luma","eventbrite","ticketmaster","tripadvisor"],"type":"string","description":"A search source. `local` = booking's own contexts and events; luma/eventbrite are organizer sources (Postgres only); Ticketmaster is live (15-minute cache); TripAdvisor remains entitlement-gated, without cache."},"description":"Restrict to these sources (comma-separated in the query string). Default: all mounted sources."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["local","luma","eventbrite"]},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"description":"Page size, 1..50 (spec §2: page ≤ 50)."},"allowEmptyValue":true,"allowReserved":true,"example":20},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor from a previous page."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["event","slot","appointment","session"],"type":"string","description":"The kind of bookable window. `event` = a dated ticketed happening; `slot` = a schedule-computed table/opening; `appointment` = a resource-unit opening; `session` = one occurrence of a multi-session event."},"title":{"type":"string","description":"What the window is (event name, service name, table label)."},"startsAt":{"type":"string","description":"Window start (ISO 8601, UTC)."},"endsAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO 8601, UTC); null when open-ended."},"timezone":{"type":"string","description":"IANA timezone the window is anchored in."},"venue":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Venue display name, when the source exposes one."},"lat":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Venue latitude."},"lng":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Venue longitude."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable venue address."}},"required":["name","lat","lng","address"],"additionalProperties":false,"description":"Where the window happens. Fields are null when the source does not expose them."},"capacityRemaining":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Remaining capacity; null when the source does not expose it."},"priceFrom":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0,"description":"Lowest advertised price, in minor or major units as the source publishes it."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amount","currency"],"additionalProperties":false,"description":"The cheapest way in. Null on the row when the source does not expose pricing."},{"type":"null"}]},"source":{"enum":["local","luma","eventbrite","ticketmaster","tripadvisor"],"type":"string","description":"A search source. `local` = booking's own contexts and events; luma/eventbrite are organizer sources (Postgres only); Ticketmaster is live (15-minute cache); TripAdvisor remains entitlement-gated, without cache."},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The source's own id for the row; null for local rows."},"attributionUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Mandatory on every external row (#104 rule): where the row came from and where a redirect books it. Null only for source = local."},"bookable":{"enum":["local","redirect","gated"],"type":"string","description":"`local` = book through booking now; `redirect` = follow attributionUrl; `gated` = visible but not bookable until its gate opens."}},"required":["kind","title","startsAt","endsAt","timezone","venue","capacityRemaining","priceFrom","source","externalId","attributionUrl","bookable"],"additionalProperties":false,"description":"One bookable window — the unit of discovery (spec §1)."},"description":"The merged answer, deterministic order: local, then organizer sources, then live sources, sorted by startsAt (stable)."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page; null when this is the last page."},"envelope":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"source":{"enum":["local","luma","eventbrite","ticketmaster","tripadvisor"],"type":"string","description":"A search source. `local` = booking's own contexts and events; luma/eventbrite are organizer sources (Postgres only); Ticketmaster is live (15-minute cache); TripAdvisor remains entitlement-gated, without cache."},"status":{"enum":["ok","skipped_gate","skipped_no_credential","stale"],"type":"string","description":"Per-source answer status: ok = answered; skipped_gate = the source is mounted but gated off; skipped_no_credential = no credential connected; stale = a cached copy older than the 15-minute TTL was served because refresh failed."},"fetchedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When this source's answer was fetched (ISO 8601, UTC). Set for live sources (fresh or stale cached copy); null for Postgres-only answers and skipped sources."}},"required":["source","status","fetchedAt"],"additionalProperties":false,"description":"Per-source status row of the response envelope (spec §2)."},"description":"One status row per source consulted or skipped."}},"required":["sources"],"additionalProperties":false,"description":"Response envelope: per-source statuses (spec §2)."}},"required":["rows","nextCursor","envelope"],"additionalProperties":false,"description":"The availability-search answer: bookable windows plus the per-source envelope."},"example":{"rows":[{"kind":"slot","title":"Dinner — table for 4","startsAt":"2026-09-19T23:00:00.000Z","endsAt":"2026-09-20T01:00:00.000Z","timezone":"America/Bogota","venue":{"name":"Casa Restaurante","lat":4.6585,"lng":-74.0935,"address":"Cra 7 # 45-10, Bogotá"},"capacityRemaining":3,"priceFrom":null,"source":"local","externalId":null,"attributionUrl":null,"bookable":"local"},{"kind":"event","title":"Rooftop Synth Night","startsAt":"2026-09-20T00:30:00.000Z","endsAt":"2026-09-20T04:00:00.000Z","timezone":"America/Bogota","venue":{"name":"Terraza Norte","lat":4.6702,"lng":-74.0561,"address":"Cll 85 # 12-30, Bogotá"},"capacityRemaining":null,"priceFrom":{"amount":60000,"currency":"COP"},"source":"luma","externalId":"evt-luma-8842","attributionUrl":"https://lu.ma/rooftop-synth-night","bookable":"redirect"},{"kind":"event","title":"Live Music Tonight","startsAt":"2026-09-20T01:00:00.000Z","endsAt":null,"timezone":"America/Bogota","venue":{"name":"Movistar Arena","lat":4.6494,"lng":-74.0776,"address":"Diagonal 61c # 26-36, Bogotá"},"capacityRemaining":null,"priceFrom":{"amount":38000,"currency":"COP"},"source":"ticketmaster","externalId":"tm-G5vYZ9","attributionUrl":"https://www.ticketmaster.com/event/G5vYZ9","bookable":"redirect"}],"nextCursor":null,"envelope":{"sources":[{"source":"local","status":"ok","fetchedAt":null},{"source":"luma","status":"ok","fetchedAt":null},{"source":"eventbrite","status":"skipped_no_credential","fetchedAt":null},{"source":"ticketmaster","status":"stale","fetchedAt":"2026-09-18T11:40:00.000Z"},{"source":"tripadvisor","status":"skipped_gate","fetchedAt":null}]}}}}},"400":{"description":"Invalid provider input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BAD_REQUEST","message":"Invalid provider input"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"Booking session required"}}}}},"403":{"description":"Organizer capability required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Organizer capability or same-origin mutation authority required"}}}}},"404":{"description":"Provider connection absent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"NOT_FOUND","message":"Provider connection absent"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/ping":{"get":{"operationId":"bookingPing","summary":"Booking service health probe","description":"Liveness probe for the greenfield booking service. Returns service identity, ok flag, session source, explicit demo-auth posture, demoCustomerId for local/demo harness proof, venueProductionReady=false, and timestamp. No authentication required — anonymous callers receive authenticated: false. Mounted runtime: served by sonik-booking-service router.ts.","tags":["booking"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"service":{"const":"sonik-booking-service","description":"Identifies the responding service."},"ok":{"const":true,"description":"Liveness flag — always true on a 200."},"authenticated":{"type":"boolean","description":"Whether a booking session resolved for this request (false when no session token or demo harness is present)."},"sessionMode":{"enum":["anonymous","dev-header","demo-harness","production","agent-ui-host-context"],"type":"string","description":"Resolved session source. demo-harness/dev-header are local/demo-only and are not venue-production auth."},"demoAuth":{"type":"boolean","description":"True only when the explicit local/demo auth harness resolved this request."},"demoCustomerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Deterministic demo user id exposed through the legacy demoCustomerId field only by the local/demo harness so demo proofs can commit user-bound holds without claiming CRM ownership."},"membershipRole":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Current organization-membership role when the authority provides one."},"organizationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Current resolved Booking organization, or null for anonymous requests."},"hostAuthorityBinding":{"type":"object","properties":{"schemaVersion":{"const":"sonik.booking.host_authority.v1"},"organizationId":{"type":"string","format":"uuid"},"sessionGenerationBindingId":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"subjectBindingId":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$"},"revocationMode":{"const":"online"}},"required":["schemaVersion","organizationId","sessionGenerationBindingId","subjectBindingId","revocationMode"],"additionalProperties":false,"description":"Opaque online-verified source-session binding, present only for Agent UI host-context requests."},"rail":{"enum":["amplify","shadow","identity"],"type":"string","description":"Which host serves organizer sign-in for this deploy, from the switchboard's auth.organizer_rail resolved once per request by the service (D2 — ONE READER). The login page branches on this instead of reading the switchboard itself. Always present: an unresolved lever reports 'amplify', the env rail, never an absent key."},"venueProductionReady":{"const":false,"description":"Always false until the Amplify production session adapter is configured, command-policy gates are mounted, and venue smoke is complete."},"at":{"type":"string","description":"Server timestamp (ISO 8601) when the probe was handled."}},"required":["service","ok","authenticated","sessionMode","demoAuth","demoCustomerId","rail","venueProductionReady","at"],"additionalProperties":false,"description":"Booking service health probe payload (see BookingContractCompatibility.pingShape)."}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/contexts":{"post":{"operationId":"bookingCreateContext","summary":"Create a bookable context","description":"Creates a bookable context — the managed bookable thing (an event, a venue_schedule like a tee sheet or restaurant service, or a resource like a simulator bay). Provide its kind, display name, and timezone (required); config defaults to empty and slug is optional. The owning organization is taken from your session — never send it in the body. Emits an operational attribution signal. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["event","venue_schedule","resource"],"type":"string","description":"The kind of managed bookable thing. `event` is a projected spine event; `venue_schedule` is a recurring-capacity context (restaurant service, gym timetable, tee sheet — differing only in schedule-rule config); `resource` is a book-the-thing-itself context (simulator bay, private dining room). Closed enum — set at creation, immutable thereafter."},"name":{"type":"string","minLength":1,"description":"Operator-facing display name (required)."},"timezone":{"type":"string","minLength":1,"description":"IANA timezone the context's schedule is computed in (required — slot times are meaningless without it)."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Operator-provided config (slot duration, capacity, windows, pacing). Optional; defaults to {} server-side."},"slug":{"type":"string","minLength":1,"description":"Optional URL-friendly handle. Not unique — duplicates are accepted by the schema."}},"required":["kind","name","timezone"],"additionalProperties":false,"description":"Create a bookable context. organizationId is never supplied here — the server stamps it from the session's org context."}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The bookable context's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side from session context; RLS-isolated)."},"kind":{"enum":["event","venue_schedule","resource"],"type":"string","description":"The kind of managed bookable thing. `event` is a projected spine event; `venue_schedule` is a recurring-capacity context (restaurant service, gym timetable, tee sheet — differing only in schedule-rule config); `resource` is a book-the-thing-itself context (simulator bay, private dining room). Closed enum — set at creation, immutable thereafter."},"name":{"type":"string","description":"Operator-facing display name for the bookable thing."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Operator-provided context config (open jsonb): slot duration, capacity, open windows, pacing, etc. Defaults to an empty object on create."},"timezone":{"type":"string","description":"IANA timezone the context's schedule and availability are computed in (e.g. 'America/Bogota'). Required — slot times are meaningless without it."},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL-friendly handle for the context. Nullable; not unique (no uniqueness is enforced by the schema)."},"externalEventRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Soft pointer to a projected spine event (events arrive via CDC). No FK constraint — may be null or point at a not-yet-backfilled event."},"createdAt":{"type":"string","description":"When the context was created (ISO 8601, UTC)."},"updatedAt":{"type":"string","description":"When the context was last updated (ISO 8601, UTC)."}},"required":["id","organizationId","kind","name","config","timezone","slug","externalEventRef","createdAt","updatedAt"],"additionalProperties":false,"description":"A single bookable context, returned as the bare raw object (no envelope)."},"example":{"id":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","kind":"venue_schedule","name":"Pebble Beach Front Nine","config":{"slotMinutes":10,"roundMinutes":240,"crossover":false,"memberWindowDays":14},"timezone":"America/Los_Angeles","slug":"front-nine","externalEventRef":null,"createdAt":"2026-06-12T15:04:05.000Z","updatedAt":"2026-06-12T15:04:05.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: kind/name/timezone required; organizationId rejected (strictObject).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListContexts","summary":"List bookable contexts","description":"Lists the bookable contexts in your organization, optionally filtered by kind (event, venue_schedule, or resource). Availability reads are not tracked, but this list is a plain read. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"kind","in":"query","schema":{"enum":["event","venue_schedule","resource"],"type":"string","description":"Optional filter — restrict the list to contexts of one kind."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The bookable context's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side from session context; RLS-isolated)."},"kind":{"enum":["event","venue_schedule","resource"],"type":"string","description":"The kind of managed bookable thing. `event` is a projected spine event; `venue_schedule` is a recurring-capacity context (restaurant service, gym timetable, tee sheet — differing only in schedule-rule config); `resource` is a book-the-thing-itself context (simulator bay, private dining room). Closed enum — set at creation, immutable thereafter."},"name":{"type":"string","description":"Operator-facing display name for the bookable thing."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Operator-provided context config (open jsonb): slot duration, capacity, open windows, pacing, etc. Defaults to an empty object on create."},"timezone":{"type":"string","description":"IANA timezone the context's schedule and availability are computed in (e.g. 'America/Bogota'). Required — slot times are meaningless without it."},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL-friendly handle for the context. Nullable; not unique (no uniqueness is enforced by the schema)."},"externalEventRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Soft pointer to a projected spine event (events arrive via CDC). No FK constraint — may be null or point at a not-yet-backfilled event."},"createdAt":{"type":"string","description":"When the context was created (ISO 8601, UTC)."},"updatedAt":{"type":"string","description":"When the context was last updated (ISO 8601, UTC)."}},"required":["id","organizationId","kind","name","config","timezone","slug","externalEventRef","createdAt","updatedAt"],"additionalProperties":false,"description":"A bookable context — one managed bookable thing (see BookingSchedulesContractCompatibility.surface)."},"description":"A list of bookable contexts (optionally filtered by kind), as a bare raw array (non-paginated)."},"example":[{"id":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","kind":"venue_schedule","name":"Pebble Beach Front Nine","config":{"slotMinutes":10,"roundMinutes":240},"timezone":"America/Los_Angeles","slug":"front-nine","externalEventRef":null,"createdAt":"2026-06-12T15:04:05.000Z","updatedAt":"2026-06-12T15:04:05.000Z"},{"id":"c2a4f8e1-6d2b-4a9c-8f3e-1b5d7c9a0e2f","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","kind":"venue_schedule","name":"The Tap Room Dinner Service","config":{"slotMinutes":15,"turnMinutes":90,"covers":60},"timezone":"America/Los_Angeles","slug":"tap-room-dinner","externalEventRef":null,"createdAt":"2026-06-12T15:06:20.000Z","updatedAt":"2026-06-12T15:06:20.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/event-shadows/contexts":{"post":{"operationId":"bookingProjectEventContext","summary":"Project a legacy event context","description":"Projects a real Sonik event into booking as bookable_context.kind=event using externalEventRef as a soft shadow key. This operation is idempotent per organization + externalEventRef, refreshes mutable display/config fields on replay, and does not make booking authoritative for legacy event ticketing, approvals, analytics, or commerce. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalEventRef":{"type":"string","format":"uuid","description":"Required shadow pointer to a legacy Sonik event. This is a soft projection key, not a foreign key or booking-owned event authority."},"name":{"type":"string","minLength":1,"description":"Operator-facing display name copied from the legacy event."},"timezone":{"type":"string","minLength":1,"description":"IANA timezone the projected event context's schedule is computed in."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Optional event projection config envelope. Effectful booking behavior still belongs to schedules/resources/policies."},"slug":{"type":"string","minLength":1,"description":"Optional legacy event slug to mirror on the event context."}},"required":["externalEventRef","name","timezone"],"additionalProperties":false,"description":"Project a real Sonik event into booking as bookable_context.kind=event. The operation is idempotent per organization + externalEventRef and refreshes mutable display/config fields on replay."}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The bookable context's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side from session context; RLS-isolated)."},"kind":{"enum":["event","venue_schedule","resource"],"type":"string","description":"The kind of managed bookable thing. `event` is a projected spine event; `venue_schedule` is a recurring-capacity context (restaurant service, gym timetable, tee sheet — differing only in schedule-rule config); `resource` is a book-the-thing-itself context (simulator bay, private dining room). Closed enum — set at creation, immutable thereafter."},"name":{"type":"string","description":"Operator-facing display name for the bookable thing."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Operator-provided context config (open jsonb): slot duration, capacity, open windows, pacing, etc. Defaults to an empty object on create."},"timezone":{"type":"string","description":"IANA timezone the context's schedule and availability are computed in (e.g. 'America/Bogota'). Required — slot times are meaningless without it."},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL-friendly handle for the context. Nullable; not unique (no uniqueness is enforced by the schema)."},"externalEventRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Soft pointer to a projected spine event (events arrive via CDC). No FK constraint — may be null or point at a not-yet-backfilled event."},"createdAt":{"type":"string","description":"When the context was created (ISO 8601, UTC)."},"updatedAt":{"type":"string","description":"When the context was last updated (ISO 8601, UTC)."}},"required":["id","organizationId","kind","name","config","timezone","slug","externalEventRef","createdAt","updatedAt"],"additionalProperties":false,"description":"A single bookable context, returned as the bare raw object (no envelope)."},"example":{"id":"8b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","kind":"event","name":"Legacy Sonik Launch","config":{"apiContractMode":"orpc-shadow"},"timezone":"America/Bogota","slug":"legacy-sonik-launch","externalEventRef":"018fa100-0000-4000-8000-000000000101","createdAt":"2026-06-12T15:04:05.000Z","updatedAt":"2026-06-12T15:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: externalEventRef is already attached to a non-event context from earlier data.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: externalEventRef/name/timezone required; kind/organizationId rejected (projection endpoint owns kind=event and org stamping).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/contexts/{contextId}":{"get":{"operationId":"bookingGetContext","summary":"Get a bookable context","description":"Returns one bookable context by id. Only contexts in your organization are visible — a context owned by another org is indistinguishable from a missing one (both 404). Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The bookable context's id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The bookable context's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side from session context; RLS-isolated)."},"kind":{"enum":["event","venue_schedule","resource"],"type":"string","description":"The kind of managed bookable thing. `event` is a projected spine event; `venue_schedule` is a recurring-capacity context (restaurant service, gym timetable, tee sheet — differing only in schedule-rule config); `resource` is a book-the-thing-itself context (simulator bay, private dining room). Closed enum — set at creation, immutable thereafter."},"name":{"type":"string","description":"Operator-facing display name for the bookable thing."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Operator-provided context config (open jsonb): slot duration, capacity, open windows, pacing, etc. Defaults to an empty object on create."},"timezone":{"type":"string","description":"IANA timezone the context's schedule and availability are computed in (e.g. 'America/Bogota'). Required — slot times are meaningless without it."},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL-friendly handle for the context. Nullable; not unique (no uniqueness is enforced by the schema)."},"externalEventRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Soft pointer to a projected spine event (events arrive via CDC). No FK constraint — may be null or point at a not-yet-backfilled event."},"createdAt":{"type":"string","description":"When the context was created (ISO 8601, UTC)."},"updatedAt":{"type":"string","description":"When the context was last updated (ISO 8601, UTC)."}},"required":["id","organizationId","kind","name","config","timezone","slug","externalEventRef","createdAt","updatedAt"],"additionalProperties":false,"description":"A single bookable context, returned as the bare raw object (no envelope)."},"example":{"id":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","kind":"venue_schedule","name":"Pebble Beach Front Nine","config":{"slotMinutes":10,"roundMinutes":240,"crossover":false,"memberWindowDays":14},"timezone":"America/Los_Angeles","slug":"front-nine","externalEventRef":null,"createdAt":"2026-06-12T15:04:05.000Z","updatedAt":"2026-06-12T15:04:05.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"patch":{"operationId":"bookingUpdateContext","summary":"Update a bookable context","description":"Updates a context's mutable fields — name, config, and/or slug. The context's kind cannot be changed: a kind determines how its schedule rules are interpreted, so changing it would orphan the rule semantics. Send only the fields you want to change. Emits an operational attribution signal. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The bookable context's id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"New display name."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Replacement config envelope (replaces the stored config)."},"slug":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"New slug, or null to clear it. Not unique."}},"additionalProperties":false,"description":"Update a bookable context's mutable fields (name / config / slug). kind and externalEventRef are immutable here; legacy Sonik events must enter through the projection endpoint so generic context edits cannot claim event authority."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The bookable context's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side from session context; RLS-isolated)."},"kind":{"enum":["event","venue_schedule","resource"],"type":"string","description":"The kind of managed bookable thing. `event` is a projected spine event; `venue_schedule` is a recurring-capacity context (restaurant service, gym timetable, tee sheet — differing only in schedule-rule config); `resource` is a book-the-thing-itself context (simulator bay, private dining room). Closed enum — set at creation, immutable thereafter."},"name":{"type":"string","description":"Operator-facing display name for the bookable thing."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Operator-provided context config (open jsonb): slot duration, capacity, open windows, pacing, etc. Defaults to an empty object on create."},"timezone":{"type":"string","description":"IANA timezone the context's schedule and availability are computed in (e.g. 'America/Bogota'). Required — slot times are meaningless without it."},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional URL-friendly handle for the context. Nullable; not unique (no uniqueness is enforced by the schema)."},"externalEventRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Soft pointer to a projected spine event (events arrive via CDC). No FK constraint — may be null or point at a not-yet-backfilled event."},"createdAt":{"type":"string","description":"When the context was created (ISO 8601, UTC)."},"updatedAt":{"type":"string","description":"When the context was last updated (ISO 8601, UTC)."}},"required":["id","organizationId","kind","name","config","timezone","slug","externalEventRef","createdAt","updatedAt"],"additionalProperties":false,"description":"A single bookable context, returned as the bare raw object (no envelope)."},"example":{"id":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","kind":"venue_schedule","name":"Pebble Beach Front Nine","config":{"slotMinutes":10,"roundMinutes":240,"crossover":false,"memberWindowDays":14},"timezone":"America/Los_Angeles","slug":"front-nine","externalEventRef":null,"createdAt":"2026-06-12T15:04:05.000Z","updatedAt":"2026-06-12T15:04:05.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: kind rejected (immutable); unknown keys rejected (strictObject).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/contexts/{contextId}/schedule-rules":{"post":{"operationId":"bookingCreateScheduleRule","summary":"Create a schedule rule","description":"Adds a schedule rule to a context. A rule is an open config envelope expressing an effective-date range, a priority, and pacing/window/turn-time settings (e.g. opens/closes, slotMinutes, capacity); higher-priority rules win where effective windows overlap. Rules are how availability is defined — availability itself is always computed from them, never stored. Emits an operational attribution signal. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The bookable context's id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The schedule-rule config envelope (required). See ScheduleRuleEnvelopeSchema for documented keys."}},"required":["rule"],"additionalProperties":false,"description":"Create a schedule rule for a context. organizationId and contextId are server-supplied (session + path); only the rule envelope is in the body."}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The schedule rule's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side; RLS-isolated)."},"contextId":{"type":"string","format":"uuid","description":"The bookable context this rule governs (FK, cascade-deleted with the context)."},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The schedule-rule config envelope (open jsonb). Expresses effective-date ranges, priorities, and pacing/window/turn-time config. Documented (non-exhaustive) keys: effectiveFrom, effectiveTo, priority, dayOfWeek, opens, closes, slotMinutes, capacity. Higher-priority rules win where effective windows overlap."},"createdAt":{"type":"string","description":"When the rule was created (ISO 8601, UTC)."}},"required":["id","organizationId","contextId","rule","createdAt"],"additionalProperties":false,"description":"A single schedule rule, returned as the bare raw object (no envelope)."},"example":{"id":"7d8e2a1c-9f4b-4c6d-8a2e-3b1f5d7c9e0a","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","rule":{"effectiveFrom":"2026-06-01","effectiveTo":"2026-09-30","priority":100,"dayOfWeek":["mon","tue","wed","thu","fri"],"opens":"07:00","closes":"18:00","slotMinutes":10,"capacity":4},"createdAt":"2026-06-12T15:08:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: rule envelope required (NOT NULL jsonb).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListScheduleRules","summary":"List a context's schedule rules","description":"Lists every schedule rule attached to a context, in the order they were created. Only your organization's contexts are visible. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The bookable context's id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The schedule rule's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side; RLS-isolated)."},"contextId":{"type":"string","format":"uuid","description":"The bookable context this rule governs (FK, cascade-deleted with the context)."},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The schedule-rule config envelope (open jsonb). Expresses effective-date ranges, priorities, and pacing/window/turn-time config. Documented (non-exhaustive) keys: effectiveFrom, effectiveTo, priority, dayOfWeek, opens, closes, slotMinutes, capacity. Higher-priority rules win where effective windows overlap."},"createdAt":{"type":"string","description":"When the rule was created (ISO 8601, UTC)."}},"required":["id","organizationId","contextId","rule","createdAt"],"additionalProperties":false,"description":"A schedule rule — one availability rule (effective-date range + priority + pacing) for a context."},"description":"The schedule rules for a context, as a bare raw array (non-paginated)."},"example":[{"id":"7d8e2a1c-9f4b-4c6d-8a2e-3b1f5d7c9e0a","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","rule":{"effectiveFrom":"2026-06-01","effectiveTo":"2026-09-30","priority":100,"dayOfWeek":["mon","tue","wed","thu","fri"],"opens":"07:00","closes":"18:00","slotMinutes":10,"capacity":4},"createdAt":"2026-06-12T15:08:00.000Z"},{"id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","rule":{"effectiveFrom":"2026-06-01","effectiveTo":"2026-09-30","priority":200,"dayOfWeek":["sat","sun"],"opens":"06:30","closes":"19:00","slotMinutes":8,"capacity":4},"createdAt":"2026-06-12T15:09:30.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/contexts/{contextId}/schedule-rules/{ruleId}":{"patch":{"operationId":"bookingUpdateScheduleRule","summary":"Update a schedule rule","description":"Replaces a schedule rule's config envelope. Emits an operational attribution signal. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The owning bookable context's id."}},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The schedule rule's id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The replacement schedule-rule envelope (replaces the stored rule in place)."}},"required":["rule"],"additionalProperties":false,"description":"Update a schedule rule's config envelope."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The schedule rule's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side; RLS-isolated)."},"contextId":{"type":"string","format":"uuid","description":"The bookable context this rule governs (FK, cascade-deleted with the context)."},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The schedule-rule config envelope (open jsonb). Expresses effective-date ranges, priorities, and pacing/window/turn-time config. Documented (non-exhaustive) keys: effectiveFrom, effectiveTo, priority, dayOfWeek, opens, closes, slotMinutes, capacity. Higher-priority rules win where effective windows overlap."},"createdAt":{"type":"string","description":"When the rule was created (ISO 8601, UTC)."}},"required":["id","organizationId","contextId","rule","createdAt"],"additionalProperties":false,"description":"A single schedule rule, returned as the bare raw object (no envelope)."},"example":{"id":"7d8e2a1c-9f4b-4c6d-8a2e-3b1f5d7c9e0a","organizationId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","rule":{"effectiveFrom":"2026-06-01","effectiveTo":"2026-09-30","priority":100,"dayOfWeek":["mon","tue","wed","thu","fri"],"opens":"07:00","closes":"18:00","slotMinutes":10,"capacity":4},"createdAt":"2026-06-12T15:08:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context or rule not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: rule envelope required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"delete":{"operationId":"bookingDeleteScheduleRule","summary":"Delete a schedule rule","description":"Removes a schedule rule from a context. Future availability computations stop applying it immediately. Emits an operational attribution signal. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The owning bookable context's id."}},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The schedule rule's id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The schedule rule's id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (set server-side; RLS-isolated)."},"contextId":{"type":"string","format":"uuid","description":"The bookable context this rule governs (FK, cascade-deleted with the context)."},"rule":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The schedule-rule config envelope (open jsonb). Expresses effective-date ranges, priorities, and pacing/window/turn-time config. Documented (non-exhaustive) keys: effectiveFrom, effectiveTo, priority, dayOfWeek, opens, closes, slotMinutes, capacity. Higher-priority rules win where effective windows overlap."},"createdAt":{"type":"string","description":"When the rule was created (ISO 8601, UTC)."}},"required":["id","organizationId","contextId","rule","createdAt"],"additionalProperties":false,"description":"A single schedule rule, returned as the bare raw object (no envelope)."}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context or rule not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/contexts/{contextId}/availability":{"get":{"operationId":"bookingGetAvailability","summary":"Get computed availability for a context","description":"Returns the computed availability slots for a context over a date range (from/to). This is THE law of the booking framework: availability is computed from the context's schedule rules every time it is requested — it is never stored as slots. Each returned slot carries its start, end, and remaining capacity after existing bookings. Optional partySize/source/resource filters let the read hide slots that active booking-window or party policies would reject; the response remains a bare slot array without pricing or reason-code expansion. This read is NOT tracked as an attribution signal. Mounted runtime: served by sonik-booking-service booking context handlers.","tags":["booking"],"parameters":[{"name":"contextId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The bookable context's id."}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"Start of the availability window (ISO 8601 date or datetime), inclusive."},"allowEmptyValue":true,"allowReserved":true},{"name":"to","in":"query","required":true,"schema":{"type":"string","description":"End of the availability window (ISO 8601 date or datetime), inclusive."},"allowEmptyValue":true,"allowReserved":true},{"name":"partySize","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Optional party size for policy-aware availability filtering. Defaults to 1 when omitted."},"allowEmptyValue":true,"allowReserved":true},{"name":"source","in":"query","required":false,"schema":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Optional booking source for policy-aware availability filtering. Defaults to web when omitted."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceTypeId","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Optional resource type target for policy-aware availability filtering. When supplied with resourceUnitId, the unit must belong to this type."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":20,"description":"Next-N mode: answer only the first N bookable slots (capacityRemaining >= partySize, starting at or after now) from the window, in order. 1..20. Omit for the full window."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceUnitId","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Optional resource unit (provider) target. Makes the answer provider-true: capacityTotal is the unit's own capacity and only blocks, assignments and holds that hit this unit (directly, via its type, or via a combination containing it) consume it; unassigned bookings and context-level holds do not. Implies the unit's resource type for policy matching."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"startsAt":{"type":"string","description":"Slot start (ISO 8601, in the context's timezone offset)."},"endsAt":{"type":"string","description":"Slot end (ISO 8601, in the context's timezone offset)."},"capacityRemaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Remaining capacity for this slot after existing bookings are subtracted. 0 means the slot is full but still shown (it exists in the schedule)."},"capacityTotal":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The slot's resolved total capacity (from the active schedule rule's capacity, falling back through context config)."},"state":{"enum":["open","limited","full"],"type":"string","description":"Computed slot state: full when capacityRemaining is 0; limited when capacityRemaining/capacityTotal <= 0.34 (Contract 0 draft threshold, see RESERVATION-CONTRACTS.md); otherwise open."}},"required":["startsAt","endsAt","capacityRemaining","capacityTotal","state"],"additionalProperties":false,"description":"A single computed availability slot (synthesized from schedule rules, never stored)."},"description":"The computed availability slots for a context over the requested window, as a bare raw array. Slots are synthesized from schedule rules — never stored."},"example":[{"startsAt":"2026-06-15T07:00:00-07:00","endsAt":"2026-06-15T07:10:00-07:00","capacityRemaining":4,"capacityTotal":4,"state":"open"},{"startsAt":"2026-06-15T07:10:00-07:00","endsAt":"2026-06-15T07:20:00-07:00","capacityRemaining":2,"capacityTotal":4,"state":"open"},{"startsAt":"2026-06-15T07:20:00-07:00","endsAt":"2026-06-15T07:30:00-07:00","capacityRemaining":0,"capacityTotal":4,"state":"full"}]}}},"400":{"description":"Bad request: resourceTypeId/resourceUnitId mismatch or runtime availability window rejection.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context or resource policy target not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: from/to window plus optional party/source/resource policy filters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings":{"post":{"operationId":"bookingCreateBooking","summary":"Create a booking","description":"Creates a booking against a bookable context for a persistent user/guest over a time window. The same shape backs a tee time, a dinner reservation, or any other booking — the context decides what it means. Supply a clientRequestId to make the create idempotent: retrying with the same key returns the existing booking with 200 rather than creating a duplicate (the Worker-retry defense). The organization is taken from your session. Emits a v4 attribution signal carrying the source channel at capture time. The response may carry warn-only Contract 0 monitor advisories.","tags":["bookings"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"The bookable_context to book against (FK → bookable_context.id)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding the booking. Use /api/v1/booking/guests to search or create this identity."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id for imported CRM/marketing context. Never required for reservation creation."},"startsAt":{"type":"string","format":"date-time","description":"Window start."},"endsAt":{"type":"string","format":"date-time","description":"Window end — must be strictly after startsAt (422 otherwise)."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"default":1,"description":"Party size (>= 1; defaults to 1)."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key. Retrying create with the same (org, clientRequestId) returns the EXISTING booking with 200, never a duplicate. Omit for server-originated rows. See BookingBookingsContractCompatibility.idempotency."}},"required":["contextId","userId","startsAt","endsAt","source"],"additionalProperties":false,"description":"Body for POST /api/v1/booking/bookings. The org is taken from the session, never the body (RLS)."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"enum":["V0-SCHEDULE-FIT","V0-CONTEXT-CAPACITY"],"type":"string","description":"Monitor-gate code the UI maps to an advisory line."},"message":{"type":"string","description":"Human-readable advisory the operator sees."}},"required":["code","message"],"description":"A single Contract 0 monitor advisory (warn-only — the write still succeeds)."},"description":"Contract 0 monitor advisories (V0-SCHEDULE-FIT / V0-CONTEXT-CAPACITY). Absent = none. Warn-only: the booking was written regardless."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"A booking write result — the booking record, plus optional warn-only monitor advisories."},"example":{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"booked","source":"web","createdBy":null,"clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:00:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}}}},"400":{"description":"Bad request: active booking-window or party policy rejects the create request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context or customer not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: V0-CONTEXT-CAPACITY: the window's slot capacity (active schedule rule → context config) would be exceeded counting overlapping bookings and active holds; V0-SCHEDULE-FIT: the window falls outside the context's active schedule-rule hours; or a context-wide resource block covers the window (slice BD, Contract 0 U0-4 = deny, BD-U3 = deny).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: ends_at > starts_at; party_size >= 1; source enum.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListBookings","summary":"List bookings","description":"Lists bookings in your organization, optionally filtered by context, persistent user/guest, deprecated customer-context id, status, and a start-time date range. Org scoping is implicit — you only ever see your own organization's bookings.","tags":["bookings"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Filter to a single bookable_context."},"allowEmptyValue":true,"allowReserved":true},{"name":"userId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"description":"Filter to a single persistent auth/user holder."},"allowEmptyValue":true,"allowReserved":true},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid","description":"Deprecated optional filter to customer-context id for old/imported rows."},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Filter by lifecycle status."},"allowEmptyValue":true,"allowReserved":true},{"name":"startsAfter","in":"query","schema":{"type":"string","format":"date-time","description":"Only bookings starting at or after this instant (date-range lower bound)."},"allowEmptyValue":true,"allowReserved":true},{"name":"startsBefore","in":"query","schema":{"type":"string","format":"date-time","description":"Only bookings starting at or before this instant (date-range upper bound)."},"allowEmptyValue":true,"allowReserved":true},{"name":"endsBefore","in":"query","schema":{"type":"string","format":"date-time","description":"Only bookings whose window ended at or before this instant."},"allowEmptyValue":true,"allowReserved":true},{"name":"attendance","in":"query","schema":{"enum":["pending"],"type":"string","description":"attendance=pending: bookings still 'booked' | 'confirmed' (no attended / no-show outcome yet), oldest first. Pair with endsBefore for the coordinator's after-slot list."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"description":"Bookings in the caller's org matching the filters, as raw records (no legacy envelope)."},"example":[{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"confirmed","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:05:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"},{"id":"5d8c2b1a-9e7f-4a3b-8c6d-1f2e3a4b5c6e","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"2c4d6e8f-1a3b-4c5d-9e7f-0a1b2c3d4e5f","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T19:30:00.000Z","endsAt":"2026-06-20T21:30:00.000Z","partySize":2,"status":"booked","source":"admin","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":null,"createdAt":"2026-06-12T18:10:00.000Z","updatedAt":"2026-06-12T18:10:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}":{"get":{"operationId":"bookingGetBooking","summary":"Get a booking","description":"Returns a single booking by id, scoped to your organization. A booking in another organization is indistinguishable from one that does not exist — both return 404.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"example":{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"confirmed","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:05:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/lifecycle":{"get":{"operationId":"bookingListBookingLifecycle","summary":"List a booking's lifecycle","description":"Returns the booking's append-only lifecycle rows, newest first: action, from/to status, actor, source, reason, occurredAt. The audit the attendance and cancellation doors write. 404 for a booking outside your organization.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"fromStatus":{"anyOf":[{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},{"type":"null"}]},"toStatus":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"action":{"enum":["created_from_hold","created","party_added","party_removed","confirmed","cancelled","rescheduled","checked_in","no_show","completed"],"type":"string"},"occurredAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"actorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"requestId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","bookingId","fromStatus","toStatus","action","occurredAt","actorId","source","reason","metadata","requestId"],"description":"One append-only booking_lifecycle_event row: who did what to the booking, when, and why."}},"example":[{"id":"018fa100-0000-4000-8000-0000000000e1","bookingId":"4f4bb1df-860d-4f7b-a041-7a296f3d6ed1","fromStatus":"confirmed","toStatus":"completed","action":"completed","occurredAt":"2026-06-14T14:35:00.000Z","actorId":"018fa100-0000-4000-8000-0000000000aa","source":"web","reason":null,"metadata":{"note":null},"requestId":"att-1"},{"id":"018fa100-0000-4000-8000-0000000000e0","bookingId":"4f4bb1df-860d-4f7b-a041-7a296f3d6ed1","fromStatus":null,"toStatus":"booked","action":"created","occurredAt":"2026-06-12T15:04:05.000Z","actorId":"2fa85f64-5717-4562-b3fc-2c963f66afa6","source":"web","reason":null,"metadata":{},"requestId":"req-1"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/cancel":{"post":{"operationId":"bookingCancelBooking","summary":"Cancel a booking","description":"Cancels a booking, moving it to 'cancelled'. Cancelling an already-cancelled booking is a conflict (409) — the transition is illegal. Emits a v4 attribution signal carrying the source channel at capture time.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"enum":["customer_request","no_show_policy","provider_unavailable","duplicate","payment_failed","rescheduled_elsewhere","other"],"type":"string","description":"Closed cancellation reason code, written to the lifecycle row."},"note":{"type":"string","minLength":1,"maxLength":280},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"example":{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"cancelled","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:20:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: booking is already cancelled (illegal status transition).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/confirm":{"post":{"operationId":"bookingConfirmBooking","summary":"Confirm a booking","description":"Confirms a booking, moving it from 'booked' to 'confirmed'. Confirming a booking that is not in 'booked' status is a conflict (409).","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"example":{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"confirmed","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:05:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: booking is not in 'booked' status (illegal status transition).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/attendance":{"post":{"operationId":"bookingRecordBookingAttendance","summary":"Record attendance for a booking","description":"Writes the attendance outcome as an append-only lifecycle row with actor, timestamp and reason. 'checked_in' leaves the status alone; 'completed' (attended) and 'no_show' move the booking to a terminal status. Attendance on a cancelled or already-terminal booking is a conflict (409). Idempotent per clientRequestId. Attendance is the billable event.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"enum":["checked_in","completed","no_show"],"type":"string","description":"Attendance outcome. 'checked_in' is a lifecycle row only (status unchanged); 'completed' (attended) and 'no_show' are terminal status moves. Attendance is the billable event."},"reason":{"enum":["not_reached","late_cancel","arrived_late","unknown"],"type":"string","description":"Closed no-show reason code."},"note":{"type":"string","minLength":1,"maxLength":280},"occurredAt":{"type":"string","format":"date-time","description":"When the outcome was observed. Defaults to now."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["outcome","clientRequestId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"example":{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"completed","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:05:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}}}},"400":{"description":"Bad request: outcome is not one of checked_in | completed | no_show, or clientRequestId is missing.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: booking is cancelled or already terminal (no_show / completed); attendance cannot be recorded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/reschedule":{"post":{"operationId":"bookingRescheduleBooking","summary":"Reschedule a booking","description":"Moves a booking to a new time window on the same booking — a first-class operation, not a cancel-and-rebook. The booking keeps its id, party, and resource assignments. The new ends must be strictly after the new starts. Emits a v4 attribution signal carrying the source channel at capture time. The response may carry warn-only Contract 0 monitor advisories.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"New window start."},"endsAt":{"type":"string","format":"date-time","description":"New window end — must be strictly after the new startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Body for POST /api/v1/booking/bookings/{bookingId}/reschedule. Writes the new window on the SAME booking row — no cancel+rebook. See BookingBookingsContractCompatibility.rescheduleFirstClass."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"enum":["V0-SCHEDULE-FIT","V0-CONTEXT-CAPACITY"],"type":"string","description":"Monitor-gate code the UI maps to an advisory line."},"message":{"type":"string","description":"Human-readable advisory the operator sees."}},"required":["code","message"],"description":"A single Contract 0 monitor advisory (warn-only — the write still succeeds)."},"description":"Contract 0 monitor advisories (V0-SCHEDULE-FIT / V0-CONTEXT-CAPACITY). Absent = none. Warn-only: the booking was written regardless."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"A booking write result — the booking record, plus optional warn-only monitor advisories."},"example":{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-21T15:00:00.000Z","endsAt":"2026-06-21T16:30:00.000Z","partySize":4,"status":"confirmed","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}}}},"400":{"description":"Bad request: active booking-window or party policy rejects the reschedule request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: V0-CONTEXT-CAPACITY or V0-SCHEDULE-FIT for the new window (bookings + active holds, this booking excluded), or the assigned resource target is blocked / already assigned / already held.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: new ends_at > starts_at.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/party":{"get":{"operationId":"bookingListPartyMembers","summary":"List party members for a booking","description":"Returns the booking's current active party roster. Removed members remain tombstoned for audit/retry safety but are excluded from this current-roster response.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Party row id (booking_party.id)."},"bookingId":{"type":"string","format":"uuid","description":"The booking this party member belongs to (booking_party.booking_id)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for a known party member; NULL for walk-ins or unnamed companions."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id for imported CRM context; NULL for walk-ins. Not the primary party identity."},"displayName":{"type":"string","minLength":1,"description":"Human-readable name for the party member (booking_party.display_name, NOT NULL). The only identifier for a phoneless walk-in."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."}},"required":["id","bookingId","userId","customerId","displayName","createdAt"],"additionalProperties":false,"description":"A single party member. customerId NULL = walk-in (no spine customer); customerId set = known member. Current roster endpoints return active rows only; removed rows remain internal tombstones for retry/audit safety."},"description":"The booking's current active party roster."},"example":[{"id":"a1b2c3d4-e5f6-4708-8192-0a1b2c3d4e5f","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","displayName":"Dale Whitmore","createdAt":"2026-06-12T18:00:00.000Z","userId":null},{"id":"b2c3d4e5-f6a7-4819-9203-1b2c3d4e5f60","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","customerId":null,"displayName":"Walk-in guest (no phone)","createdAt":"2026-06-12T18:35:00.000Z","userId":null}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingAddPartyMember","summary":"Add a party member to a booking","description":"Adds a generic party member to a booking. Provide a userId for a known guest, or omit it for a walk-in/guest — a guest without a user record is identified by displayName alone and is never written as CRM/customer profile data. Supplying clientRequestId makes retried adds return the existing party row instead of duplicating the roster. Returns the booking's current active party roster.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for a known member, or null/omitted for a walk-in."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated customer-context id, or null/omitted for a walk-in."},"displayName":{"type":"string","minLength":1,"description":"Name for the party member (required even for known members; the only identifier for a walk-in)."},"clientRequestId":{"type":"string","minLength":1,"description":"Optional retry/idempotency key for add-party writes; unique per organization + booking when supplied."}},"required":["displayName"],"additionalProperties":false,"description":"Body for POST /api/v1/booking/bookings/{bookingId}/party. A null/omitted customerId is the walk-in path. clientRequestId makes retries replay as the same party row. See BookingBookingsContractCompatibility.walkInPath."}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Party row id (booking_party.id)."},"bookingId":{"type":"string","format":"uuid","description":"The booking this party member belongs to (booking_party.booking_id)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for a known party member; NULL for walk-ins or unnamed companions."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id for imported CRM context; NULL for walk-ins. Not the primary party identity."},"displayName":{"type":"string","minLength":1,"description":"Human-readable name for the party member (booking_party.display_name, NOT NULL). The only identifier for a phoneless walk-in."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."}},"required":["id","bookingId","userId","customerId","displayName","createdAt"],"additionalProperties":false,"description":"A single party member. customerId NULL = walk-in (no spine customer); customerId set = known member. Current roster endpoints return active rows only; removed rows remain internal tombstones for retry/audit safety."},"description":"The booking's current active party roster."},"example":[{"id":"a1b2c3d4-e5f6-4708-8192-0a1b2c3d4e5f","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","displayName":"Dale Whitmore","createdAt":"2026-06-12T18:00:00.000Z","userId":null},{"id":"b2c3d4e5-f6a7-4819-9203-1b2c3d4e5f60","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","customerId":null,"displayName":"Walk-in guest (no phone)","createdAt":"2026-06-12T18:35:00.000Z","userId":null}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking or customer not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: displayName non-empty.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/party/{partyMemberId}":{"delete":{"operationId":"bookingRemovePartyMember","summary":"Remove a party member from a booking","description":"Removes a generic party member from a booking by party-member id by tombstoning the booking_party row. Repeating the same remove for an already-removed party row is idempotent and returns the current active roster without emitting a duplicate lifecycle event. This mutates booking operational roster truth only; it does not delete or update CRM/customer profile data.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}},{"name":"partyMemberId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Party member (booking_party) id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Party row id (booking_party.id)."},"bookingId":{"type":"string","format":"uuid","description":"The booking this party member belongs to (booking_party.booking_id)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for a known party member; NULL for walk-ins or unnamed companions."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id for imported CRM context; NULL for walk-ins. Not the primary party identity."},"displayName":{"type":"string","minLength":1,"description":"Human-readable name for the party member (booking_party.display_name, NOT NULL). The only identifier for a phoneless walk-in."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."}},"required":["id","bookingId","userId","customerId","displayName","createdAt"],"additionalProperties":false,"description":"A single party member. customerId NULL = walk-in (no spine customer); customerId set = known member. Current roster endpoints return active rows only; removed rows remain internal tombstones for retry/audit safety."},"description":"The booking's current active party roster."},"example":[{"id":"a1b2c3d4-e5f6-4708-8192-0a1b2c3d4e5f","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","displayName":"Dale Whitmore","createdAt":"2026-06-12T18:00:00.000Z","userId":null}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking or party member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/resources":{"get":{"operationId":"bookingListResourceAssignments","summary":"List resource assignments for a booking","description":"Returns the booking's current active resource assignments. This is the read-side companion to assign/unassign so the app can render mounted resource truth instead of inferred slot labels.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Assignment join row id (booking_resource.id)."},"bookingId":{"type":"string","format":"uuid","description":"The booking the resource is assigned to (booking_resource.booking_id)."},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Assigned resource unit id when assignmentKind is unit (booking_resource.resource_unit_id)."},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Assigned resource combination id when assignmentKind is combination (booking_resource.resource_combination_id)."},"assignmentKind":{"enum":["unit","combination"],"type":"string","description":"Mounted assignment target kind. legacy_context is intentionally excluded from mounted API payloads."},"window":{"type":"object","properties":{"startsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]}},"required":["startsAt","endsAt"],"additionalProperties":false},"status":{"enum":["active","released"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last assignment mutation timestamp."}},"required":["id","bookingId","resourceUnitId","resourceCombinationId","assignmentKind","window","status","createdAt","updatedAt"],"additionalProperties":false,"description":"A booking↔resource assignment. A JOIN row, never a column on booking — a booking can hold many resources. See BookingBookingsContractCompatibility.resourceJoin."},"description":"The booking's current resource assignments after the mutation."},"example":[{"id":"c3d4e5f6-a7b8-4920-8314-2c3d4e5f6071","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","resourceUnitId":"018fa100-0000-4000-8000-000000000008","resourceCombinationId":null,"assignmentKind":"unit","window":{"startsAt":"2026-06-12T18:40:00.000Z","endsAt":"2026-06-12T18:50:00.000Z"},"status":"active","createdAt":"2026-06-12T18:40:00.000Z","updatedAt":"2026-06-12T18:40:00.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingAssignResource","summary":"Assign a resource to a booking","description":"Assigns an active resource unit or resource combination to a booking. The service checks booking lifecycle, resource status, resource blocks, and overlapping active assignments before writing booking_resource. Returns the booking's active resource assignments.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"resourceUnitId":{"type":"string","format":"uuid","description":"Resource unit to assign. Mutually exclusive with resourceCombinationId."}},"required":["resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"resourceCombinationId":{"type":"string","format":"uuid","description":"Resource combination to assign. Mutually exclusive with resourceUnitId."}},"required":["resourceCombinationId"],"additionalProperties":false}],"description":"Body for POST /api/v1/booking/bookings/{bookingId}/resources. Adds an active booking_resource join row using exactly one mounted unit or combination target. See BookingBookingsContractCompatibility.resourceJoin."}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Assignment join row id (booking_resource.id)."},"bookingId":{"type":"string","format":"uuid","description":"The booking the resource is assigned to (booking_resource.booking_id)."},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Assigned resource unit id when assignmentKind is unit (booking_resource.resource_unit_id)."},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Assigned resource combination id when assignmentKind is combination (booking_resource.resource_combination_id)."},"assignmentKind":{"enum":["unit","combination"],"type":"string","description":"Mounted assignment target kind. legacy_context is intentionally excluded from mounted API payloads."},"window":{"type":"object","properties":{"startsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]}},"required":["startsAt","endsAt"],"additionalProperties":false},"status":{"enum":["active","released"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last assignment mutation timestamp."}},"required":["id","bookingId","resourceUnitId","resourceCombinationId","assignmentKind","window","status","createdAt","updatedAt"],"additionalProperties":false,"description":"A booking↔resource assignment. A JOIN row, never a column on booking — a booking can hold many resources. See BookingBookingsContractCompatibility.resourceJoin."},"description":"The booking's current resource assignments after the mutation."},"example":[{"id":"c3d4e5f6-a7b8-4920-8314-2c3d4e5f6071","bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","resourceUnitId":"018fa100-0000-4000-8000-000000000008","resourceCombinationId":null,"assignmentKind":"unit","window":{"startsAt":"2026-06-12T18:40:00.000Z","endsAt":"2026-06-12T18:50:00.000Z"},"status":"active","createdAt":"2026-06-12T18:40:00.000Z","updatedAt":"2026-06-12T18:40:00.000Z"}]}}},"400":{"description":"Bad request: active booking-window or party policy rejects the assignment target.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking or resource unit/combination not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: booking/resource unavailable or assignment overlaps.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: exactly one resourceUnitId or resourceCombinationId UUID.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/bookings/{bookingId}/resources/{assignmentId}":{"delete":{"operationId":"bookingUnassignResource","summary":"Unassign a resource from a booking","description":"Releases an active booking_resource assignment by assignment id. The row is retained with status=released for audit-ready assignment truth. Returns the booking's remaining active resource assignments.","tags":["bookings"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Booking id."}},{"name":"assignmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The booking_resource assignment row id to release."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Assignment join row id (booking_resource.id)."},"bookingId":{"type":"string","format":"uuid","description":"The booking the resource is assigned to (booking_resource.booking_id)."},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Assigned resource unit id when assignmentKind is unit (booking_resource.resource_unit_id)."},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Assigned resource combination id when assignmentKind is combination (booking_resource.resource_combination_id)."},"assignmentKind":{"enum":["unit","combination"],"type":"string","description":"Mounted assignment target kind. legacy_context is intentionally excluded from mounted API payloads."},"window":{"type":"object","properties":{"startsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]}},"required":["startsAt","endsAt"],"additionalProperties":false},"status":{"enum":["active","released"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last assignment mutation timestamp."}},"required":["id","bookingId","resourceUnitId","resourceCombinationId","assignmentKind","window","status","createdAt","updatedAt"],"additionalProperties":false,"description":"A booking↔resource assignment. A JOIN row, never a column on booking — a booking can hold many resources. See BookingBookingsContractCompatibility.resourceJoin."},"description":"The booking's current resource assignments after the mutation."},"example":[]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Booking or resource assignment not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/booking-intents/{intentId}/commit":{"post":{"operationId":"bookingIntentCommit","summary":"Commit a resolved booking intent","description":"Commits one immutable zero-total resolved intent in direct or held mode and returns the server-created Booking, BookingLine, Ticket, and entitlement truth. Positive-total intents fail closed before Booking or inventory mutation until the payment-settlement adapter is mounted; paymentHandoff reserves that future typed boundary. Held mode requires the one active intent-bound counted-capacity hold. Digest and clientRequestId enforce stale-write and replay safety.","tags":["bookings"],"parameters":[{"name":"intentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"mode":{"const":"direct"},"expectedIntentDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact resolved-intent snapshot the caller accepts."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key."}},"required":["mode","expectedIntentDigest","clientRequestId"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"held"},"holdId":{"type":"string","format":"uuid","description":"Active hold created from this resolved intent."},"expectedIntentDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact resolved-intent snapshot the caller accepts."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key."}},"required":["mode","holdId","expectedIntentDigest","clientRequestId"],"additionalProperties":false}]},"example":{"mode":"direct","expectedIntentDigest":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","clientRequestId":"commit-event-intent-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Server-minted immutable booking-intent snapshot id."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"Service-owned canonical booking context projection."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Booking holder identity when known; null only while a held flow is collecting identity."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"clientRequestId":{"type":"string","minLength":1},"allocation":{"anyOf":[{"anyOf":[{"type":"object","properties":{"physicalTarget":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Individual resource unit to allocate, such as one table, room, seat, or court."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"Predefined combination of resource units that must be allocated together."}},"required":["kind","resourceCombinationId"],"additionalProperties":false}],"description":"Exactly one physical allocation target: a resource unit or a resource combination."},"inventoryPoolClaim":{"type":"object","properties":{"inventoryPoolId":{"type":"string","format":"uuid","description":"Counted-capacity inventory pool to claim."},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Positive quantity claimed from the pool."}},"required":["inventoryPoolId","quantity"],"additionalProperties":false,"description":"A counted-capacity claim materialized from the booking party or Offer demand."}},"additionalProperties":false,"description":"Inventory a booking intends to consume. Physical and counted-capacity claims may be used independently or together."},{"type":"object","properties":{"inventoryPoolClaims":{"type":"array","items":{"type":"object","properties":{"kind":{"const":"inventory_pool"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","intentLineId","requirementIndex","inventoryPoolId","quantity"],"additionalProperties":false},"default":[]},"physicalResourceClaims":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_unit"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","intentLineId","requirementIndex","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","intentLineId","requirementIndex","resourceCombinationId"],"additionalProperties":false}]},"default":[]}},"additionalProperties":false,"description":"Source-bound counted-capacity and exact physical-resource claims for every selected Event Offer requirement."}]},{"type":"null"}]},"finalizedQuoteSnapshotId":{"type":"string","format":"uuid","description":"Pinned commercial snapshot resolved from the selected offer versions."},"lines":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Server-minted stable intent-line id."},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_offer"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","eventId","offerId","offerVersion"],"additionalProperties":false}],"description":"Immutable commercial source that produced one normalized booking-intent line."},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"fulfillment":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}}},"required":["issuance","entitlementTemplates"],"additionalProperties":false,"description":"Immutable issuance and entitlement evidence copied from the accepted Offer version. Commitment never reloads mutable Offer fulfillment truth."}},"required":["id","source","quantity","fulfillment"],"additionalProperties":false}},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","window","partySize","source","clientRequestId","allocation","finalizedQuoteSnapshotId","lines","digest","expiresAt","createdAt"],"additionalProperties":false},"booking":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"bookingLines":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_offer"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","eventId","offerId","offerVersion"],"additionalProperties":false}],"description":"Immutable commercial source that produced one normalized booking-intent line."},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"finalizedQuoteSnapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","bookingId","intentLineId","source","quantity","finalizedQuoteSnapshotId","createdAt"],"additionalProperties":false}},"issuedTickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false}},"paymentHandoff":{"anyOf":[{"type":"object","properties":{"kind":{"const":"payment_required"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"finalizedQuoteSnapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"quoteDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","bookingId","finalizedQuoteSnapshotId","amount","quoteDigest"],"additionalProperties":false},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["intent","booking","bookingLines","issuedTickets","paymentHandoff","replayed"],"additionalProperties":false},"example":{"intent":{"id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","organizationId":"11111111-1111-4111-8111-111111111111","contextId":"22222222-2222-4222-8222-222222222222","userId":"user_123","customerId":null,"window":{"startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T23:00:00.000Z"},"partySize":1,"source":"web","clientRequestId":"resolve-event-intent-1","allocation":null,"finalizedQuoteSnapshotId":"77777777-7777-4777-8777-777777777777","lines":[{"id":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","source":{"kind":"event_offer","eventId":"33333333-3333-4333-8333-333333333333","offerId":"44444444-4444-4444-8444-444444444444","offerVersion":3},"quantity":1,"fulfillment":{"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":[]}]}}],"digest":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","expiresAt":"2026-07-20T19:30:00.000Z","createdAt":"2026-07-20T19:00:00.000Z"},"booking":{"id":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","contextId":"22222222-2222-4222-8222-222222222222","userId":"user_123","customerId":null,"startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T23:00:00.000Z","partySize":1,"status":"booked","source":"web","createdBy":null,"clientRequestId":"commit-event-intent-1","createdAt":"2026-07-20T19:05:00.000Z","updatedAt":"2026-07-20T19:05:00.000Z"},"bookingLines":[{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","bookingId":"88888888-8888-4888-8888-888888888888","intentLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","source":{"kind":"event_offer","eventId":"33333333-3333-4333-8333-333333333333","offerId":"44444444-4444-4444-8444-444444444444","offerVersion":3},"quantity":1,"finalizedQuoteSnapshotId":"77777777-7777-4777-8777-777777777777","createdAt":"2026-07-20T19:05:00.000Z"}],"issuedTickets":[{"id":"cccccccc-cccc-4ccc-8ccc-cccccccccccc","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"33333333-3333-4333-8333-333333333333","offerId":"44444444-4444-4444-8444-444444444444","offerVersion":3,"buyerBookingId":"88888888-8888-4888-8888-888888888888","buyerBookingLineId":"99999999-9999-4999-8999-999999999999","ownerPersonId":null,"attendee":null,"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","eventId":"33333333-3333-4333-8333-333333333333","status":"active","validFrom":null,"validUntil":null,"consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":[],"policyDecisionReceiptIds":[]}],"version":1,"issuedAt":"2026-07-20T19:05:00.000Z","updatedAt":"2026-07-20T19:05:00.000Z"}],"paymentHandoff":null,"replayed":false}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required."}}}}},"404":{"description":"The resolved intent or held-mode Hold was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_NOT_FOUND","BOOKING_HOLD_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_NOT_FOUND","message":"The resolved intent was not found."}}}}},"409":{"description":"The intent, idempotency key, or held-mode Hold conflicts with current commitment truth. A not-ready refusal names its typed reason; a positive total without payment authority is payment_required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_STALE","BOOKING_INTENT_ALREADY_COMMITTED","BOOKING_INTENT_IDEMPOTENCY_CONFLICT","BOOKING_HOLD_INTENT_MISMATCH","BOOKING_HOLD_NOT_COMMITTABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1},"reason":{"type":"string","enum":["event_not_active","event_not_scheduled","event_started","sales_window_not_open","rate_plan_not_active","rate_plan_not_effective_yet","rate_plan_expired","payment_required","configuration_incomplete"]}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_STALE","message":"The resolved intent no longer represents current commitment truth.","traceId":"trace_booking_intent_stale"}}}}},"410":{"description":"The resolved intent expired before commitment.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_EXPIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_EXPIRED","message":"The resolved intent has expired.","traceId":"trace_booking_intent_expired"}}}}},"412":{"description":"expectedIntentDigest does not match the immutable resolved-intent snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_DIGEST_MISMATCH","message":"expectedIntentDigest does not match the resolved-intent snapshot.","traceId":"trace_booking_intent_digest_mismatch"}}}}},"422":{"description":"The strict direct or held commitment input is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_COMMIT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_COMMIT_INPUT_INVALID","message":"The strict commitment request is invalid."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/booking-intents/{intentId}/holds":{"post":{"operationId":"bookingIntentCreateHold","summary":"Create a hold from a resolved booking intent","description":"Creates an intent-bound counted-capacity hold from allocation already resolved and digested on the intent. The caller supplies only the expected digest, idempotency key, and bounded TTL; it cannot rewrite context, allocation, Event, Offer, booking lines, or tickets. This route does not reuse the separate single physical-resource Hold contract.","tags":["booking-holds"],"parameters":[{"name":"intentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedIntentDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact resolved-intent snapshot to hold."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key."},"ttlSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":600}},"required":["expectedIntentDigest","clientRequestId"],"additionalProperties":false},"example":{"expectedIntentDigest":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","clientRequestId":"hold-event-intent-1","ttlSeconds":600}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Intent-bound hold identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"intentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","converted","released","expired"],"type":"string"},"inventoryClaimIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"inventoryClaims":{"type":"array","items":{"type":"object","properties":{"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"inventoryClaimId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["intentLineId","requirementIndex","inventoryClaimId"],"additionalProperties":false},"default":[]},"resourceHolds":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_unit"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","intentLineId","requirementIndex","holdId","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","intentLineId","requirementIndex","holdId","resourceCombinationId"],"additionalProperties":false}]},"default":[]},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"convertedBookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"clientRequestId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","intentId","status","inventoryClaimIds","expiresAt","convertedBookingId","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"Intent-bound hold over counted-capacity claims and source-bound physical-resource Holds."},"example":{"id":"018fa100-0000-4000-8000-000000000002","organizationId":"018f9b00-1111-7000-8000-000000000abc","intentId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","status":"active","inventoryClaimIds":["018fa100-0000-4000-8000-000000000006"],"inventoryClaims":[{"intentLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","requirementIndex":0,"inventoryClaimId":"018fa100-0000-4000-8000-000000000006"}],"resourceHolds":[],"expiresAt":"2026-06-20T14:45:00.000Z","convertedBookingId":null,"clientRequestId":"intent-hold-demo-1","createdAt":"2026-06-12T18:05:00.000Z","updatedAt":"2026-06-12T18:05:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required."}}}}},"404":{"description":"The resolved intent was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_NOT_FOUND","message":"The resolved intent was not found."}}}}},"409":{"description":"The resolved intent is stale, requested capacity is unavailable, or clientRequestId was reused with a different Hold request. A not-ready refusal names its typed reason.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_STALE","BOOKING_INTENT_IDEMPOTENCY_CONFLICT","BOOKING_INTENT_CAPACITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1},"reason":{"type":"string","enum":["event_not_active","event_not_scheduled","event_started","sales_window_not_open","rate_plan_not_active","rate_plan_not_effective_yet","rate_plan_expired","payment_required","configuration_incomplete"]}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_IDEMPOTENCY_CONFLICT","message":"clientRequestId was already used with a different intent Hold request.","traceId":"trace_booking_intent_idempotency_conflict"}}}}},"410":{"description":"The resolved intent expired before a Hold was created.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_EXPIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_EXPIRED","message":"The resolved intent has expired.","traceId":"trace_booking_intent_expired"}}}}},"412":{"description":"expectedIntentDigest does not match the immutable resolved-intent snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_DIGEST_MISMATCH","message":"expectedIntentDigest does not match the resolved-intent snapshot.","traceId":"trace_booking_intent_digest_mismatch"}}}}},"422":{"description":"The intent-bound Hold request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BOOKING_INTENT_HOLD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BOOKING_INTENT_HOLD_INPUT_INVALID","message":"The intent-bound Hold request is invalid."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/inventory-pools":{"post":{"operationId":"bookingCreateInventoryPool","summary":"Create an inventory pool","description":"Creates an organization-scoped capacity pool owned by one mounted canonical Event, venue-schedule context, resource context, resource type, or resource unit target. Owner kind is verified against durable authority; releasedCapacity is the portion of hardCapacity currently claimable.","tags":["booking-inventory-pools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted Event, venue-schedule, resource, ResourceType, or ResourceUnit owner."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity currently released for claims."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not.","default":"active"}},"required":["code","name","owner","hardCapacity","releasedCapacity"],"additionalProperties":false},"example":{"code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"status":"active"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"typed Event, venue-schedule, resource, resource-type, or resource-unit owner not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"not_found","message":"InventoryPool resource was not found"}}}}},"409":{"description":"Conflict: inventory-pool code already exists for the typed owner.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"conflict","message":"InventoryPool lifecycle or capacity conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"Validation failed: typed owner, capacity, code, and lifecycle fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"INVENTORY_POOL_INPUT_INVALID","message":"The typed inventory-pool request is invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListInventoryPools","summary":"List inventory pools","description":"Lists pool snapshots with live held, committed, and available counts. ownerKind and ownerId must be supplied together when filtering by owner.","tags":["booking-inventory-pools"],"parameters":[{"name":"ownerKind","in":"query","schema":{"enum":["event","venue_schedule","resource","resource_type","resource_unit"],"type":"string","description":"Typed owner family to filter; ownerId is required when supplied."},"allowEmptyValue":true,"allowReserved":true,"example":"event"},{"name":"ownerId","in":"query","schema":{"type":"string","format":"uuid","description":"Owner UUID paired with ownerKind; neither filter may be supplied alone."},"allowEmptyValue":true,"allowReserved":true,"example":"71000000-0000-4000-8000-000000000003"},{"name":"status","in":"query","schema":{"enum":["active","paused","retired"],"type":"string","description":"InventoryPool lifecycle status filter."},"allowEmptyValue":true,"allowReserved":true,"example":"active"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false},"description":"Matching pool snapshots and live counters."}},"required":["pools"],"additionalProperties":false},"example":{"pools":[{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"}]}}}},"400":{"description":"Bad request: ownerKind and ownerId must be supplied together.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"bad_request","message":"ownerKind and ownerId must be supplied together"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"422":{"description":"Validation failed: owner and status query filters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"INVENTORY_POOL_FILTER_INVALID","message":"The inventory-pool filters are invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/inventory-pools/{poolId}":{"get":{"operationId":"bookingGetInventoryPool","summary":"Get an inventory pool","description":"Returns one organization-scoped pool snapshot; active expired holds are excluded from heldCount.","tags":["booking-inventory-pools"],"parameters":[{"name":"poolId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"example":"71000000-0000-4000-8000-000000000001"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"404":{"description":"InventoryPool not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"not_found","message":"InventoryPool resource was not found"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/inventory-pools/{poolId}/capacity":{"patch":{"operationId":"bookingUpdateInventoryPoolCapacity","summary":"Update inventory pool capacity","description":"Atomically changes hard/released capacity or status when expectedVersion matches. It rejects reductions below live held plus committed quantity.","tags":["booking-inventory-pools"],"parameters":[{"name":"poolId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"example":"71000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current pool version required by CAS."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Replacement absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Replacement claimable capacity."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Replacement pool lifecycle state."}},"required":["expectedVersion"],"additionalProperties":false},"example":{"expectedVersion":4,"hardCapacity":550,"releasedCapacity":350,"status":"active"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"InventoryPool not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"not_found","message":"InventoryPool resource was not found"}}}}},"409":{"description":"Conflict: stale version or capacity below live claims.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"conflict","message":"InventoryPool lifecycle or capacity conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"Validation failed: capacity, lifecycle status, and expectedVersion.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"INVENTORY_POOL_INPUT_INVALID","message":"The typed inventory-pool request is invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/inventory-pools/{poolId}/claims/hold":{"post":{"operationId":"bookingHoldInventoryClaim","summary":"Hold inventory capacity","description":"Atomically creates an expiring capacity claim using a caller-generated BookingIntent correlation UUID when active released capacity is available. BookingIntent persistence remains shadow, so the UUID is correlation rather than mounted authority. clientRequestId is organization-scoped and replays only an identical hold.","tags":["booking-inventory-pools"],"parameters":[{"name":"poolId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"example":"71000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bookingIntentId":{"type":"string","format":"uuid","description":"Caller-generated correlation UUID. BookingIntent persistence remains shadow, so this value is not treated as mounted authority."},"quantity":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Positive quantity to hold."},"expiresAt":{"type":"string","format":"date-time","description":"Future instant when the hold expires."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Organization-scoped idempotency key for this hold."}},"required":["bookingIntentId","quantity","expiresAt","clientRequestId"],"additionalProperties":false},"example":{"bookingIntentId":"71000000-0000-4000-8000-000000000005","quantity":2,"expiresAt":"2026-07-19T14:30:00.000Z","clientRequestId":"inventory-hold-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false,"description":"Pool counters after the claim operation."},"claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical inventory-claim UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the claim."},"poolId":{"type":"string","format":"uuid","description":"InventoryPool whose capacity is claimed."},"bookingIntentId":{"type":"string","format":"uuid","description":"Caller-generated correlation UUID for the future BookingIntent aggregate. It is not mounted authority and does not prove that a BookingIntent record exists."},"bookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Committed Booking UUID; null while held and retained after cancellation for audit."},"quantity":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Positive quantity reserved from the pool."},"status":{"enum":["held","committed","released"],"type":"string","description":"Claim lifecycle; committed claims release only through Booking cancellation."},"expiresAt":{"type":"string","format":"date-time","description":"Hold expiry; commit must occur before this instant."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Organization-scoped idempotency key for hold creation."},"committedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Time the claim bound to a Booking."},"releasedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Time capacity was returned to the pool."},"releaseReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}],"description":"Audit reason for release; null until released."},"createdAt":{"type":"string","format":"date-time","description":"Claim creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current claim state was written."}},"required":["id","organizationId","poolId","bookingIntentId","bookingId","quantity","status","expiresAt","clientRequestId","committedAt","releasedAt","releaseReason","createdAt","updatedAt"],"additionalProperties":false,"description":"Canonical claim after the operation."},"replayed":{"type":"boolean","description":"True when an exact prior idempotent result was returned."}},"required":["pool","claim","replayed"],"additionalProperties":false},"example":{"pool":{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"},"claim":{"id":"71000000-0000-4000-8000-000000000004","organizationId":"71000000-0000-4000-8000-000000000002","poolId":"71000000-0000-4000-8000-000000000001","bookingIntentId":"71000000-0000-4000-8000-000000000005","quantity":2,"expiresAt":"2026-07-19T14:30:00.000Z","clientRequestId":"inventory-hold-001","createdAt":"2026-07-19T14:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z","bookingId":null,"status":"held","committedAt":null,"releasedAt":null,"releaseReason":null},"replayed":false}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"InventoryPool not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"not_found","message":"InventoryPool resource was not found"}}}}},"409":{"description":"Conflict: insufficient capacity, disabled pool, or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"conflict","message":"InventoryPool lifecycle or capacity conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"Validation failed: future expiry, positive quantity, booking intent, and idempotency key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"INVENTORY_CLAIM_INPUT_INVALID","message":"The typed inventory-claim request is invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/inventory-pools/{poolId}/claims/{claimId}/commit":{"post":{"operationId":"bookingCommitInventoryClaim","summary":"Commit an inventory claim","description":"Atomically converts one unexpired held claim into committed capacity for one existing Booking in the same organization. Replaying the same bookingId is safe; a missing or different booking conflicts.","tags":["booking-inventory-pools"],"parameters":[{"name":"poolId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"example":"71000000-0000-4000-8000-000000000001"},{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical inventory-claim UUID within the pool."},"example":"71000000-0000-4000-8000-000000000004"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","description":"Existing, non-cancelled Booking in the same organization that receives the capacity."}},"required":["bookingId"],"additionalProperties":false},"example":{"bookingId":"71000000-0000-4000-8000-000000000006"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false,"description":"Pool counters after the claim operation."},"claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical inventory-claim UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the claim."},"poolId":{"type":"string","format":"uuid","description":"InventoryPool whose capacity is claimed."},"bookingIntentId":{"type":"string","format":"uuid","description":"Caller-generated correlation UUID for the future BookingIntent aggregate. It is not mounted authority and does not prove that a BookingIntent record exists."},"bookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Committed Booking UUID; null while held and retained after cancellation for audit."},"quantity":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Positive quantity reserved from the pool."},"status":{"enum":["held","committed","released"],"type":"string","description":"Claim lifecycle; committed claims release only through Booking cancellation."},"expiresAt":{"type":"string","format":"date-time","description":"Hold expiry; commit must occur before this instant."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Organization-scoped idempotency key for hold creation."},"committedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Time the claim bound to a Booking."},"releasedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Time capacity was returned to the pool."},"releaseReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}],"description":"Audit reason for release; null until released."},"createdAt":{"type":"string","format":"date-time","description":"Claim creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current claim state was written."}},"required":["id","organizationId","poolId","bookingIntentId","bookingId","quantity","status","expiresAt","clientRequestId","committedAt","releasedAt","releaseReason","createdAt","updatedAt"],"additionalProperties":false,"description":"Canonical claim after the operation."},"replayed":{"type":"boolean","description":"True when an exact prior idempotent result was returned."}},"required":["pool","claim","replayed"],"additionalProperties":false},"example":{"pool":{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"},"claim":{"id":"71000000-0000-4000-8000-000000000004","organizationId":"71000000-0000-4000-8000-000000000002","poolId":"71000000-0000-4000-8000-000000000001","bookingIntentId":"71000000-0000-4000-8000-000000000005","quantity":2,"expiresAt":"2026-07-19T14:30:00.000Z","clientRequestId":"inventory-hold-001","createdAt":"2026-07-19T14:00:00.000Z","updatedAt":"2026-07-19T14:05:00.000Z","bookingId":"71000000-0000-4000-8000-000000000006","status":"committed","committedAt":"2026-07-19T14:05:00.000Z","releasedAt":null,"releaseReason":null},"replayed":false}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"InventoryPool, inventory claim, or Booking not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"not_found","message":"InventoryPool resource was not found"}}}}},"409":{"description":"Conflict: expired or incompatible inventory-claim transition.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"conflict","message":"InventoryPool lifecycle or capacity conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"Validation failed: booking identity.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"INVENTORY_CLAIM_INPUT_INVALID","message":"The typed inventory-claim request is invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/inventory-pools/{poolId}/claims/{claimId}/release":{"post":{"operationId":"bookingReleaseInventoryClaim","summary":"Release an inventory claim","description":"Atomically releases held quantity back to available capacity and retains the optional reason. Committed claims release through Booking cancellation so capacity and Booking truth cannot diverge. Replaying an already released held claim is safe.","tags":["booking-inventory-pools"],"parameters":[{"name":"poolId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"example":"71000000-0000-4000-8000-000000000001"},{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical inventory-claim UUID within the pool."},"example":"71000000-0000-4000-8000-000000000004"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":240,"description":"Optional operational reason retained on the released claim."}},"additionalProperties":false},"example":{"reason":"checkout_abandoned"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pool":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false,"description":"Pool counters after the claim operation."},"claim":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical inventory-claim UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the claim."},"poolId":{"type":"string","format":"uuid","description":"InventoryPool whose capacity is claimed."},"bookingIntentId":{"type":"string","format":"uuid","description":"Caller-generated correlation UUID for the future BookingIntent aggregate. It is not mounted authority and does not prove that a BookingIntent record exists."},"bookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Committed Booking UUID; null while held and retained after cancellation for audit."},"quantity":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Positive quantity reserved from the pool."},"status":{"enum":["held","committed","released"],"type":"string","description":"Claim lifecycle; committed claims release only through Booking cancellation."},"expiresAt":{"type":"string","format":"date-time","description":"Hold expiry; commit must occur before this instant."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Organization-scoped idempotency key for hold creation."},"committedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Time the claim bound to a Booking."},"releasedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Time capacity was returned to the pool."},"releaseReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}],"description":"Audit reason for release; null until released."},"createdAt":{"type":"string","format":"date-time","description":"Claim creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current claim state was written."}},"required":["id","organizationId","poolId","bookingIntentId","bookingId","quantity","status","expiresAt","clientRequestId","committedAt","releasedAt","releaseReason","createdAt","updatedAt"],"additionalProperties":false,"description":"Canonical claim after the operation."},"replayed":{"type":"boolean","description":"True when an exact prior idempotent result was returned."}},"required":["pool","claim","replayed"],"additionalProperties":false},"example":{"pool":{"id":"71000000-0000-4000-8000-000000000001","organizationId":"71000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"71000000-0000-4000-8000-000000000003"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-07-19T14:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"},"claim":{"id":"71000000-0000-4000-8000-000000000004","organizationId":"71000000-0000-4000-8000-000000000002","poolId":"71000000-0000-4000-8000-000000000001","bookingIntentId":"71000000-0000-4000-8000-000000000005","quantity":2,"expiresAt":"2026-07-19T14:30:00.000Z","clientRequestId":"inventory-hold-001","createdAt":"2026-07-19T14:00:00.000Z","updatedAt":"2026-07-19T14:10:00.000Z","bookingId":null,"status":"released","committedAt":null,"releasedAt":"2026-07-19T14:10:00.000Z","releaseReason":"checkout_abandoned"},"replayed":false}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Authentication required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"InventoryPool or inventory claim not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"not_found","message":"InventoryPool resource was not found"}}}}},"409":{"description":"Conflict: incompatible inventory-claim transition.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"conflict","message":"InventoryPool lifecycle or capacity conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"Validation failed: optional release reason.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"INVENTORY_CLAIM_INPUT_INVALID","message":"The typed inventory-claim request is invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/rate-assignments":{"post":{"operationId":"bookingRateAssignmentCreate","summary":"Create a rich rate assignment","description":"Creates an organization-scoped assignment of one active, pinned RatePlanVersion to a typed commercial target and subject. The server owns id, organizationId, and createdAt; idempotency and effective-range conflicts are enforced atomically.","tags":["booking-policies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}]},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false}]},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","clientRequestId"],"additionalProperties":false},"example":{"ratePlanVersionId":"33333333-3333-4333-8333-333333333333","target":{"kind":"organization"},"subject":{"kind":"everyone"},"purpose":"base","priority":100,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"clientRequestId":"rate-assignment-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical RateAssignment UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the assignment and its referenced rate version."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Booking-owned object whose price is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Customer or audience scope eligible for the rate."},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"Assignment creation time."}},"required":["id","organizationId","version","ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","ratePlanVersionId":"33333333-3333-4333-8333-333333333333","target":{"kind":"organization"},"subject":{"kind":"everyone"},"purpose":"base","priority":100,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-18T12:00:00.000Z","version":1}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_rate_assignment_create_auth"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rate-plan version or typed assignment target was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_REFERENCE_NOT_FOUND","message":"The rate-plan version or assignment target was not found.","traceId":"trace_rate_assignment_create_reference"}}}}},"409":{"description":"The idempotency key or effective assignment range conflicts with existing truth.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_IDEMPOTENCY_CONFLICT","RATE_ASSIGNMENT_RANGE_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_IDEMPOTENCY_CONFLICT","message":"The idempotency key conflicts with an existing assignment.","traceId":"trace_rate_assignment_create_conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich rate-assignment body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_INPUT_INVALID","message":"The rich rate-assignment input is invalid.","traceId":"trace_rate_assignment_create_invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingRateAssignmentList","summary":"List rich rate assignments","description":"Lists rich rate assignments with the shared opaque cursor and bounded page size only.","tags":["booking-policies"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rateAssignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical RateAssignment UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the assignment and its referenced rate version."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Booking-owned object whose price is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Customer or audience scope eligible for the rate."},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"Assignment creation time."}},"required":["id","organizationId","version","ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["rateAssignments","nextCursor"],"additionalProperties":false},"example":{"rateAssignments":[{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","ratePlanVersionId":"33333333-3333-4333-8333-333333333333","target":{"kind":"organization"},"subject":{"kind":"everyone"},"purpose":"base","priority":100,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-18T12:00:00.000Z","version":1}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_rate_assignment_list_auth"}}}}},"422":{"description":"The cursor or page limit is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_FILTER_INVALID","message":"The rate-assignment cursor or limit is invalid.","traceId":"trace_rate_assignment_list_invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/rate-assignments/{rateAssignmentId}":{"get":{"operationId":"bookingRateAssignmentGet","summary":"Get a rich rate assignment","description":"Returns one exact rich RateAssignment record by server-owned identity.","tags":["booking-policies"],"parameters":[{"name":"rateAssignmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical RateAssignment UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the assignment and its referenced rate version."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Booking-owned object whose price is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Customer or audience scope eligible for the rate."},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"Assignment creation time."}},"required":["id","organizationId","version","ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","ratePlanVersionId":"33333333-3333-4333-8333-333333333333","target":{"kind":"organization"},"subject":{"kind":"everyone"},"purpose":"base","priority":100,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-18T12:00:00.000Z","version":1}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_rate_assignment_get_auth"}}}}},"404":{"description":"The rate assignment was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_NOT_FOUND","message":"The rate assignment was not found.","traceId":"trace_rate_assignment_get_missing"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/rate-assignments/{rateAssignmentId}/end":{"post":{"operationId":"bookingRateAssignmentEnd","summary":"End a rate assignment","description":"Ends an open RateAssignment without deleting its history. expectedVersion provides compare-and-swap protection; effectiveUntil must be after the stored effectiveFrom and cannot be in the past. Exact clientRequestId replay returns the same ended assignment.","tags":["booking-policies"],"parameters":[{"name":"rateAssignmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"effectiveUntil":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedVersion","effectiveUntil","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"effectiveUntil":"2026-08-15T12:00:00.000Z","clientRequestId":"rate-assignment-end-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical RateAssignment UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the assignment and its referenced rate version."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Booking-owned object whose price is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Customer or audience scope eligible for the rate."},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"Assignment creation time."}},"required":["id","organizationId","version","ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","ratePlanVersionId":"33333333-3333-4333-8333-333333333333","target":{"kind":"organization"},"subject":{"kind":"everyone"},"purpose":"base","priority":100,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-08-15T12:00:00.000Z","createdAt":"2026-07-18T12:00:00.000Z","version":2}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_rate_assignment_end_auth"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rate assignment was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_NOT_FOUND","message":"The rate assignment was not found.","traceId":"trace_rate_assignment_end_missing"}}}}},"409":{"description":"The expected version is stale, the assignment is already ended, or clientRequestId conflicts with a prior request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_VERSION_CONFLICT","RATE_ASSIGNMENT_LIFECYCLE_CONFLICT","RATE_ASSIGNMENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_VERSION_CONFLICT","message":"The expected assignment version is stale.","traceId":"trace_rate_assignment_end_conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"effectiveUntil must be after the stored effectiveFrom and cannot be in the past.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["RATE_ASSIGNMENT_END_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"RATE_ASSIGNMENT_END_INVALID","message":"effectiveUntil must be after effectiveFrom and cannot be in the past.","traceId":"trace_rate_assignment_end_invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/policy-bindings":{"post":{"operationId":"bookingPolicyBindingCreate","summary":"Create a rich policy binding","description":"Creates a durable organization-scoped binding from one pinned policy or policy-set version to typed target, subject, and unique lifecycle hooks. The server owns id, organizationId, and createdAt; policy evaluation consequences remain outside this authoring runtime.","tags":["booking-policies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"policySource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"policy_version"},"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyVersionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_set_version"},"policySetVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policySetVersionId"],"additionalProperties":false}]},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Platform or Booking-owned object whose commerce behavior is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Who qualifies for an assignment or policy binding."},"hooks":{"type":"array","minItems":1,"items":{"enum":["availability_read","quote","quote_finalize","quote_acceptance","hold_create","hold_extend","hold_release","booking_direct_create","booking_commit","assignment","reschedule","cancellation","check_in","no_show","completion","event_publish","event_cancel","offer_activate","offer_pause","offer_retire","entitlement_issue","entitlement_assign","session_selection","access_authorize","access_record","access_reverse","refund_adjustment","policy_publish","policy_activate","policy_retire","rate_plan_publish","rate_plan_activate","rate_plan_retire"],"type":"string"}},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["policySource","target","subject","hooks","effectiveFrom","effectiveUntil","clientRequestId"],"additionalProperties":false},"example":{"policySource":{"kind":"policy_version","policyVersionId":"55555555-5555-4555-8555-555555555555"},"target":{"kind":"offer","offerId":"77777777-7777-4777-8777-777777777777"},"subject":{"kind":"everyone"},"hooks":["quote","booking_commit"],"priority":100,"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"clientRequestId":"policy-binding-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"policySource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"policy_version"},"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyVersionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_set_version"},"policySetVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policySetVersionId"],"additionalProperties":false}]},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Platform or Booking-owned object whose commerce behavior is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Who qualifies for an assignment or policy binding."},"hooks":{"type":"array","minItems":1,"items":{"enum":["availability_read","quote","quote_finalize","quote_acceptance","hold_create","hold_extend","hold_release","booking_direct_create","booking_commit","assignment","reschedule","cancellation","check_in","no_show","completion","event_publish","event_cancel","offer_activate","offer_pause","offer_retire","entitlement_issue","entitlement_assign","session_selection","access_authorize","access_record","access_reverse","refund_adjustment","policy_publish","policy_activate","policy_retire","rate_plan_publish","rate_plan_activate","rate_plan_retire"],"type":"string"}},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","policySource","target","subject","hooks","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"example":{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","policySource":{"kind":"policy_version","policyVersionId":"55555555-5555-4555-8555-555555555555"},"target":{"kind":"offer","offerId":"77777777-7777-4777-8777-777777777777"},"subject":{"kind":"everyone"},"hooks":["quote","booking_commit"],"priority":100,"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-18T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_policy_binding_create_auth"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The policy source or typed binding target was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POLICY_BINDING_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"POLICY_BINDING_REFERENCE_NOT_FOUND","message":"The policy source or binding target was not found.","traceId":"trace_policy_binding_create_reference"}}}}},"409":{"description":"The idempotency key or effective binding range conflicts with existing truth.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POLICY_BINDING_IDEMPOTENCY_CONFLICT","POLICY_BINDING_RANGE_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"POLICY_BINDING_IDEMPOTENCY_CONFLICT","message":"The idempotency key conflicts with an existing binding.","traceId":"trace_policy_binding_create_conflict"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich policy-binding body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POLICY_BINDING_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"POLICY_BINDING_INPUT_INVALID","message":"The rich policy-binding input is invalid.","traceId":"trace_policy_binding_create_invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingPolicyBindingList","summary":"List rich policy bindings","description":"Lists rich policy bindings with the shared opaque cursor and bounded page size only.","tags":["booking-policies"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"policyBindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"policySource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"policy_version"},"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyVersionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_set_version"},"policySetVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policySetVersionId"],"additionalProperties":false}]},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Platform or Booking-owned object whose commerce behavior is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Who qualifies for an assignment or policy binding."},"hooks":{"type":"array","minItems":1,"items":{"enum":["availability_read","quote","quote_finalize","quote_acceptance","hold_create","hold_extend","hold_release","booking_direct_create","booking_commit","assignment","reschedule","cancellation","check_in","no_show","completion","event_publish","event_cancel","offer_activate","offer_pause","offer_retire","entitlement_issue","entitlement_assign","session_selection","access_authorize","access_record","access_reverse","refund_adjustment","policy_publish","policy_activate","policy_retire","rate_plan_publish","rate_plan_activate","rate_plan_retire"],"type":"string"}},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","policySource","target","subject","hooks","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["policyBindings","nextCursor"],"additionalProperties":false},"example":{"policyBindings":[{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","policySource":{"kind":"policy_version","policyVersionId":"55555555-5555-4555-8555-555555555555"},"target":{"kind":"offer","offerId":"77777777-7777-4777-8777-777777777777"},"subject":{"kind":"everyone"},"hooks":["quote","booking_commit"],"priority":100,"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-18T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_policy_binding_list_auth"}}}}},"422":{"description":"The cursor or page limit is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POLICY_BINDING_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"POLICY_BINDING_FILTER_INVALID","message":"The policy-binding cursor or limit is invalid.","traceId":"trace_policy_binding_list_invalid"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/policy-bindings/{policyBindingId}":{"get":{"operationId":"bookingPolicyBindingGet","summary":"Get a rich policy binding","description":"Returns one exact rich PolicyBinding record by server-owned identity.","tags":["booking-policies"],"parameters":[{"name":"policyBindingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"policySource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"policy_version"},"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyVersionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_set_version"},"policySetVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policySetVersionId"],"additionalProperties":false}]},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Platform or Booking-owned object whose commerce behavior is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Who qualifies for an assignment or policy binding."},"hooks":{"type":"array","minItems":1,"items":{"enum":["availability_read","quote","quote_finalize","quote_acceptance","hold_create","hold_extend","hold_release","booking_direct_create","booking_commit","assignment","reschedule","cancellation","check_in","no_show","completion","event_publish","event_cancel","offer_activate","offer_pause","offer_retire","entitlement_issue","entitlement_assign","session_selection","access_authorize","access_record","access_reverse","refund_adjustment","policy_publish","policy_activate","policy_retire","rate_plan_publish","rate_plan_activate","rate_plan_retire"],"type":"string"}},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","policySource","target","subject","hooks","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"example":{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","policySource":{"kind":"policy_version","policyVersionId":"55555555-5555-4555-8555-555555555555"},"target":{"kind":"offer","offerId":"77777777-7777-4777-8777-777777777777"},"subject":{"kind":"everyone"},"hooks":["quote","booking_commit"],"priority":100,"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-18T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace_policy_binding_get_auth"}}}}},"404":{"description":"The policy binding was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POLICY_BINDING_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"POLICY_BINDING_NOT_FOUND","message":"The policy binding was not found.","traceId":"trace_policy_binding_get_missing"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/rate-plans":{"post":{"operationId":"bookingCommercialRatePlanCreate","summary":"Create a rich rate plan","description":"Creates the canonical RatePlan identity and its initial immutable draft version in one idempotent transaction. This is the rate authority consumed by RateAssignment and future Offer composition; the legacy /rate-plans family is compatibility-only. Server-owned identity, organization, version, status, digest, and timestamps are excluded from the strict request.","tags":["booking-commercial"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"initialVersion":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."}},"required":["currency","tax","components","rounding","effectiveFrom","effectiveUntil"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["name","initialVersion","clientRequestId"],"additionalProperties":false},"example":{"name":"General admission","initialVersion":{"currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null},"clientRequestId":"commercial-rate-plan-create-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ratePlan":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable rate-plan identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","createdAt"],"additionalProperties":false},"initialVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false}},"required":["ratePlan","initialVersion"],"additionalProperties":false},"example":{"ratePlan":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","name":"General admission","createdAt":"2026-08-01T12:00:00.000Z"},"initialVersion":{"id":"33333333-3333-4333-8333-333333333333","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":1,"status":"draft","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"668dca6e8180f58c4516a5b8c609fb081043c0e0735427451871ef6270c5b490","createdAt":"2026-08-01T12:00:00.000Z"}}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"409":{"description":"The clientRequestId was previously used for a different commercial identity request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_IDEMPOTENCY_CONFLICT","message":"The clientRequestId was already used for a different identity request.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingCommercialRatePlanList","summary":"List rich rate plans","description":"Lists rich RatePlan identities with the shared opaque cursor; no versions are embedded.","tags":["booking-commercial"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ratePlans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable rate-plan identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["ratePlans","nextCursor"],"additionalProperties":false},"example":{"ratePlans":[{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","name":"General admission","createdAt":"2026-08-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/rate-plans/{ratePlanId}":{"get":{"operationId":"bookingCommercialRatePlanGet","summary":"Get a rich rate plan","description":"Returns the exact canonical rich RatePlan identity; versions remain separate immutable resources.","tags":["booking-commercial"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable rate-plan identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","createdAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","name":"General admission","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/rate-plans/{ratePlanId}/versions":{"post":{"operationId":"bookingCommercialRatePlanVersionCreate","summary":"Create a rate-plan draft version","description":"Creates a new immutable RatePlanVersion draft under the canonical parent identity. Activation requires an explicit charge component (zero is the typed free price), exact registered evaluators, and no other active version for the plan. The server assigns version, digest, organization, status, and timestamps; no update or delete operation exists.","tags":["booking-commercial"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["currency","tax","components","rounding","effectiveFrom","effectiveUntil","clientRequestId"],"additionalProperties":false},"example":{"currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"clientRequestId":"commercial-rate-plan-version-create-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The clientRequestId conflicts with a prior request or the next immutable version could not be allocated from current truth.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_IDEMPOTENCY_CONFLICT","COMMERCIAL_VERSION_ALLOCATION_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_ALLOCATION_CONFLICT","message":"The next immutable version could not be allocated from current truth.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingCommercialRatePlanVersionList","summary":"List rate-plan versions","description":"Lists immutable rich RatePlanVersion records for one parent identity.","tags":["booking-commercial"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["versions","nextCursor"],"additionalProperties":false},"example":{"versions":[{"id":"33333333-3333-4333-8333-333333333333","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":1,"status":"draft","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"668dca6e8180f58c4516a5b8c609fb081043c0e0735427451871ef6270c5b490","createdAt":"2026-08-01T12:00:00.000Z"},{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/rate-plans/{ratePlanId}/versions/{ratePlanVersionId}":{"get":{"operationId":"bookingCommercialRatePlanVersionGet","summary":"Get a rate-plan version","description":"Returns the exact canonical immutable RatePlanVersion record.","tags":["booking-commercial"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"ratePlanVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/rate-plans/{ratePlanId}/versions/{ratePlanVersionId}/activate":{"post":{"operationId":"bookingCommercialRatePlanVersionActivate","summary":"Activate a rate-plan version","description":"Atomically activates a draft RatePlanVersion after validating its registered rate evaluators and exact configuration. Missing identities or versions are 404. A stale expectedDigest is COMMERCIAL_VERSION_DIGEST_MISMATCH (412); lifecycle, activation, and idempotency conflicts are distinct typed 409 errors; malformed input is 422. No review token is required.","tags":["booking-commercial"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"ratePlanVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"33333333-3333-4333-8333-333333333334"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact draft the caller reviewed."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedDigest","clientRequestId"],"additionalProperties":false},"example":{"expectedDigest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","clientRequestId":"commercial-rate-plan-version-activate-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"active","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The draft is no longer transitionable, another active version won allocation, evaluator/configuration activation validation failed, or clientRequestId conflicts with a prior request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_TRANSITION_CONFLICT","COMMERCIAL_VERSION_ACTIVATION_BLOCKED","COMMERCIAL_VERSION_ALLOCATION_CONFLICT","COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_ACTIVATION_BLOCKED","message":"The draft failed evaluator, configuration, canonical, or PolicySet member activation validation.","traceId":"trace-commercial-fixture"}}}}},"412":{"description":"expectedDigest does not match the immutable commercial version snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_DIGEST_MISMATCH","message":"expectedDigest does not match the immutable version snapshot.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict activation or retirement lifecycle body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID","message":"The strict commercial version lifecycle body is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/rate-plans/{ratePlanId}/versions/{ratePlanVersionId}/retire":{"post":{"operationId":"bookingCommercialRatePlanVersionRetire","summary":"Retire a rate-plan version","description":"Atomically retires a draft or active RatePlanVersion using expectedDigest and expectedStatus. A stale expectedDigest is COMMERCIAL_VERSION_DIGEST_MISMATCH (412); lifecycle or idempotency conflicts are typed 409; malformed input is 422. Retirement prevents new assignments while preserving existing pinned references for audit and replay.","tags":["booking-commercial"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"ratePlanVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"33333333-3333-4333-8333-333333333334"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact draft the caller reviewed."},"expectedStatus":{"enum":["draft","active"],"type":"string"},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedDigest","expectedStatus","clientRequestId"],"additionalProperties":false},"example":{"expectedDigest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","expectedStatus":"active","clientRequestId":"commercial-rate-plan-version-retire-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"retired","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The version is no longer in the expected draft/active state or clientRequestId conflicts with a prior request. Existing pinned references remain valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_TRANSITION_CONFLICT","COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_TRANSITION_CONFLICT","message":"The version is no longer in the expected draft or active state.","traceId":"trace-commercial-fixture"}}}}},"412":{"description":"expectedDigest does not match the immutable commercial version snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_DIGEST_MISMATCH","message":"expectedDigest does not match the immutable version snapshot.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict activation or retirement lifecycle body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID","message":"The strict commercial version lifecycle body is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policies":{"post":{"operationId":"bookingCommercialPolicyCreate","summary":"Create a rich policy","description":"Creates a stable rich Policy identity and its initial immutable draft version in one idempotent PostgreSQL transaction. Server-owned fields are excluded.","tags":["booking-commercial"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"initialVersion":{"type":"object","properties":{"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{},{}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{},{}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."}},"required":["schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["name","initialVersion","clientRequestId"],"additionalProperties":false},"example":{"name":"Party size guardrail","initialVersion":{"schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z"},"clientRequestId":"commercial-policy-create-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable policy identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","createdAt"],"additionalProperties":false},"initialVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy version id."},"policyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policyId","organizationId","version","status","schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false}},"required":["policy","initialVersion"],"additionalProperties":false},"example":{"policy":{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","name":"Party size guardrail","createdAt":"2026-08-01T12:00:00.000Z"},"initialVersion":{"id":"55555555-5555-4555-8555-555555555555","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":1,"status":"draft","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"18df9474f746724de882dfbcbbb90ff5aef3d93b322e38d02d39bf3a844e0857","createdAt":"2026-08-01T12:00:00.000Z"}}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"409":{"description":"The clientRequestId was previously used for a different commercial identity request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_IDEMPOTENCY_CONFLICT","message":"The clientRequestId was already used for a different identity request.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingCommercialPolicyList","summary":"List rich policies","description":"Lists rich Policy identities with the shared UUID keyset cursor; no versions are embedded.","tags":["booking-commercial"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"policies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable policy identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["policies","nextCursor"],"additionalProperties":false},"example":{"policies":[{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","name":"Party size guardrail","createdAt":"2026-08-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policies/{policyId}":{"get":{"operationId":"bookingCommercialPolicyGet","summary":"Get a rich policy","description":"Returns the exact canonical rich Policy identity.","tags":["booking-commercial"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable policy identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","createdAt"],"additionalProperties":false},"example":{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","name":"Party size guardrail","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policies/{policyId}/versions":{"post":{"operationId":"bookingCommercialPolicyVersionCreate","summary":"Create a policy draft version","description":"Creates a new immutable rich PolicyVersion draft. The server assigns all lifecycle and digest fields; no update or delete operation exists.","tags":["booking-commercial"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"44444444-4444-4444-8444-444444444444"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{},{}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{},{}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{},{}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{},{}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","clientRequestId"],"additionalProperties":false},"example":{"schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","clientRequestId":"commercial-policy-version-create-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy version id."},"policyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policyId","organizationId","version","status","schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"55555555-5555-4555-8555-555555555556","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The clientRequestId conflicts with a prior request or the next immutable version could not be allocated from current truth.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_IDEMPOTENCY_CONFLICT","COMMERCIAL_VERSION_ALLOCATION_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_ALLOCATION_CONFLICT","message":"The next immutable version could not be allocated from current truth.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingCommercialPolicyVersionList","summary":"List policy versions","description":"Lists immutable rich PolicyVersion records for one parent identity.","tags":["booking-commercial"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy version id."},"policyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{},{},{},{}]}},"required":["kind","factKey","operator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"null"}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policyId","organizationId","version","status","schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["versions","nextCursor"],"additionalProperties":false},"example":{"versions":[{"id":"55555555-5555-4555-8555-555555555555","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":1,"status":"active","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"18df9474f746724de882dfbcbbb90ff5aef3d93b322e38d02d39bf3a844e0857","createdAt":"2026-08-01T12:00:00.000Z"},{"id":"55555555-5555-4555-8555-555555555556","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","createdAt":"2026-08-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policies/{policyId}/versions/{policyVersionId}":{"get":{"operationId":"bookingCommercialPolicyVersionGet","summary":"Get a policy version","description":"Returns the exact canonical immutable PolicyVersion record.","tags":["booking-commercial"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"policyVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy version id."},"policyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policyId","organizationId","version","status","schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"55555555-5555-4555-8555-555555555556","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policies/{policyId}/versions/{policyVersionId}/activate":{"post":{"operationId":"bookingCommercialPolicyVersionActivate","summary":"Activate a policy version","description":"Validates registered evaluators and configuration before an atomic draft-to-active transition. Missing identities or versions are 404. A stale expectedDigest is COMMERCIAL_VERSION_DIGEST_MISMATCH (412); state or idempotency conflicts and evaluator/configuration activation failures are distinct typed 409 errors; malformed lifecycle input is 422. No review token is required.","tags":["booking-commercial"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"44444444-4444-4444-8444-444444444444"},{"name":"policyVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"55555555-5555-4555-8555-555555555556"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact draft the caller reviewed."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedDigest","clientRequestId"],"additionalProperties":false},"example":{"expectedDigest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","clientRequestId":"commercial-policy-version-activate-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy version id."},"policyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policyId","organizationId","version","status","schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"55555555-5555-4555-8555-555555555556","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"active","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The draft is no longer transitionable, another active version won allocation, evaluator/configuration activation validation failed, or clientRequestId conflicts with a prior request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_TRANSITION_CONFLICT","COMMERCIAL_VERSION_ACTIVATION_BLOCKED","COMMERCIAL_VERSION_ALLOCATION_CONFLICT","COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_ACTIVATION_BLOCKED","message":"The draft failed evaluator, configuration, canonical, or PolicySet member activation validation.","traceId":"trace-commercial-fixture"}}}}},"412":{"description":"expectedDigest does not match the immutable commercial version snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_DIGEST_MISMATCH","message":"expectedDigest does not match the immutable version snapshot.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict activation or retirement lifecycle body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID","message":"The strict commercial version lifecycle body is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policies/{policyId}/versions/{policyVersionId}/retire":{"post":{"operationId":"bookingCommercialPolicyVersionRetire","summary":"Retire a policy version","description":"Retires a draft or active version using expectedDigest and expectedStatus. A stale expectedDigest is COMMERCIAL_VERSION_DIGEST_MISMATCH (412); state or idempotency conflicts are typed 409; malformed lifecycle input is 422. Retirement prevents only new assignments, bindings, or policy-set membership; existing pinned references remain valid and auditable. No dependency scan or reference-in-use conflict is implied.","tags":["booking-commercial"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"44444444-4444-4444-8444-444444444444"},{"name":"policyVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"55555555-5555-4555-8555-555555555556"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact draft the caller reviewed."},"expectedStatus":{"enum":["draft","active"],"type":"string"},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedDigest","expectedStatus","clientRequestId"],"additionalProperties":false},"example":{"expectedDigest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","expectedStatus":"active","clientRequestId":"commercial-policy-version-retire-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy version id."},"policyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"definition":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"allowedSources":{"anyOf":[{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."}},{"type":"null"}]}},"required":["kind","minLeadMinutes","maxAdvanceDays","allowedSources"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minimum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","minimum","maximum"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"quota"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"unit":{"enum":["bookings","holds","units"],"type":"string"},"per":{"const":"customer"},"scope":{"enum":["context","organization"],"type":"string"},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["kind","limit","unit","per","scope","windowDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"due":{"enum":["hold","commit","before_start"],"type":"string"}},"required":["kind","required","amount","due"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","freeUntilHours","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"eligibility"},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]},"failureDecision":{"enum":["deny","require_approval","warn"],"type":"string"}},"required":["kind","when","failureDecision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fee_penalty"},"trigger":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"consequence":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fee"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"forfeit_deposit"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"require_approval"}},"required":["kind"],"additionalProperties":false}]}},"required":["kind","trigger","consequence"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_adjustment"},"effect":{"enum":["discount","surcharge","credit"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"amount"},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["kind","amount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0}},"required":["kind","basisPoints"],"additionalProperties":false}]},"when":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false},{"type":"object","properties":{"kind":{},"value":{}},"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{"anyOf":[{"type":"object","properties":{"kind":{"const":"all"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"any"},"predicates":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}}},"required":["kind","predicates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"not"},"predicate":{}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","predicate"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"exists"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["kind","factKey"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"compare"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["eq","neq","gt","gte","lt","lte"],"type":"string"},"value":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}},"required":["kind","factKey","operator","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"set_membership"},"factKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"operator":{"enum":["in","not_in"],"type":"string"},"values":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"string"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"number"},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"timestamp"},"value":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["kind","value"],"additionalProperties":false}]}}},"required":["kind","factKey","operator","values"],"additionalProperties":false}]}},"required":["kind","effect","value","when"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"policyKind":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"outputKinds":{"type":"array","minItems":1,"items":{"enum":["eligibility","rate_adjustment","deposit_requirement","allocation_requirement","capacity_limit","fee_penalty","obligation"],"type":"string"}}},"required":["kind","policyKind","configuration","outputKinds"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policyId","organizationId","version","status","schemaVersion","evaluator","definition","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"example":{"id":"55555555-5555-4555-8555-555555555556","policyId":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"retired","schemaVersion":1,"evaluator":{"key":"booking.policy.party","version":1,"schemaKey":"booking.policy.party.config","schemaVersion":1},"definition":{"kind":"party","minimum":1,"maximum":8},"effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":"2026-12-01T12:00:00.000Z","digest":"5a76084157d93494e7b552694f8af3c1a4f4b524ef7de5c2c018f82b58179ef0","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The version is no longer in the expected draft/active state or clientRequestId conflicts with a prior request. Existing pinned references remain valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_TRANSITION_CONFLICT","COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_TRANSITION_CONFLICT","message":"The version is no longer in the expected draft or active state.","traceId":"trace-commercial-fixture"}}}}},"412":{"description":"expectedDigest does not match the immutable commercial version snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_DIGEST_MISMATCH","message":"expectedDigest does not match the immutable version snapshot.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict activation or retirement lifecycle body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID","message":"The strict commercial version lifecycle body is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policy-sets":{"post":{"operationId":"bookingCommercialPolicySetCreate","summary":"Create a rich policy set","description":"Creates a stable rich PolicySet identity (bundle or template) and its initial immutable draft version. This is identity/version authoring, not template instantiation.","tags":["booking-commercial"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["bundle","template"],"type":"string"},"name":{"type":"string","minLength":1},"initialVersion":{"type":"object","properties":{"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false}},"required":["members","combining"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["kind","name","initialVersion","clientRequestId"],"additionalProperties":false},"example":{"kind":"bundle","name":"Admission guardrails","initialVersion":{"members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"}},"clientRequestId":"commercial-policy-set-create-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"policySet":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable policy-set/template identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["bundle","template"],"type":"string"},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","kind","name","createdAt"],"additionalProperties":false},"initialVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy-set version id."},"policySetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policySetId","organizationId","version","status","members","combining","digest","createdAt"],"additionalProperties":false}},"required":["policySet","initialVersion"],"additionalProperties":false},"example":{"policySet":{"id":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","kind":"bundle","name":"Admission guardrails","createdAt":"2026-08-01T12:00:00.000Z"},"initialVersion":{"id":"99999999-9999-4999-8999-999999999999","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":1,"status":"draft","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a87e1bd93a344f8bc0d506d2446e83b7a76585937fe8e67420f5c9cd9fe88e7","createdAt":"2026-08-01T12:00:00.000Z"}}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"An initial PolicySet member PolicyVersion was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["POLICY_VERSION_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"POLICY_VERSION_NOT_FOUND","message":"An initial PolicySet member PolicyVersion was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The clientRequestId was previously used for a different commercial identity request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_IDEMPOTENCY_CONFLICT","message":"The clientRequestId was already used for a different identity request.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingCommercialPolicySetList","summary":"List rich policy sets","description":"Lists rich PolicySet identities with the shared UUID keyset cursor; no versions are embedded.","tags":["booking-commercial"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"policySets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable policy-set/template identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["bundle","template"],"type":"string"},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","kind","name","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["policySets","nextCursor"],"additionalProperties":false},"example":{"policySets":[{"id":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","kind":"bundle","name":"Admission guardrails","createdAt":"2026-08-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policy-sets/{policySetId}":{"get":{"operationId":"bookingCommercialPolicySetGet","summary":"Get a rich policy set","description":"Returns the exact canonical rich PolicySet identity.","tags":["booking-commercial"],"parameters":[{"name":"policySetId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Stable policy-set/template identity."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["bundle","template"],"type":"string"},"name":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","kind","name","createdAt"],"additionalProperties":false},"example":{"id":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","kind":"bundle","name":"Admission guardrails","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policy-sets/{policySetId}/versions":{"post":{"operationId":"bookingCommercialPolicySetVersionCreate","summary":"Create a policy-set draft version","description":"Creates a new immutable rich PolicySetVersion draft with pinned member PolicyVersion ids and canonical combining rules. No update, delete, or template-instantiation operation exists.","tags":["booking-commercial"],"parameters":[{"name":"policySetId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"88888888-8888-4888-8888-888888888888"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["members","combining","clientRequestId"],"additionalProperties":false},"example":{"members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"clientRequestId":"commercial-policy-set-version-create-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy-set version id."},"policySetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policySetId","organizationId","version","status","members","combining","digest","createdAt"],"additionalProperties":false},"example":{"id":"99999999-9999-4999-8999-999999999990","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The clientRequestId conflicts with a prior request or the next immutable version could not be allocated from current truth.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_IDEMPOTENCY_CONFLICT","COMMERCIAL_VERSION_ALLOCATION_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_ALLOCATION_CONFLICT","message":"The next immutable version could not be allocated from current truth.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingCommercialPolicySetVersionList","summary":"List policy-set versions","description":"Lists immutable rich PolicySetVersion records for one parent identity.","tags":["booking-commercial"],"parameters":[{"name":"policySetId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"UUID keyset cursor returned by the previous commercial list page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy-set version id."},"policySetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policySetId","organizationId","version","status","members","combining","digest","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["versions","nextCursor"],"additionalProperties":false},"example":{"versions":[{"id":"99999999-9999-4999-8999-999999999999","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":1,"status":"draft","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a87e1bd93a344f8bc0d506d2446e83b7a76585937fe8e67420f5c9cd9fe88e7","createdAt":"2026-08-01T12:00:00.000Z"},{"id":"99999999-9999-4999-8999-999999999990","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","createdAt":"2026-08-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"422":{"description":"The strict rich commercial request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_INPUT_INVALID","message":"The strict commercial request is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policy-sets/{policySetId}/versions/{policySetVersionId}":{"get":{"operationId":"bookingCommercialPolicySetVersionGet","summary":"Get a policy-set version","description":"Returns the exact canonical immutable PolicySetVersion record.","tags":["booking-commercial"],"parameters":[{"name":"policySetId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"policySetVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy-set version id."},"policySetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policySetId","organizationId","version","status","members","combining","digest","createdAt"],"additionalProperties":false},"example":{"id":"99999999-9999-4999-8999-999999999990","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"draft","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policy-sets/{policySetId}/versions/{policySetVersionId}/activate":{"post":{"operationId":"bookingCommercialPolicySetVersionActivate","summary":"Activate a policy-set version","description":"Validates registered evaluators and configuration before an atomic draft-to-active transition. Missing identities or versions are 404. A stale expectedDigest is COMMERCIAL_VERSION_DIGEST_MISMATCH (412); state or idempotency conflicts and evaluator/configuration activation failures are distinct typed 409 errors; malformed lifecycle input is 422. No review token is required. Policy-set validation additionally requires the exact member resolution, one organization, active members, a non-empty common effective interval, and valid canonical combining.","tags":["booking-commercial"],"parameters":[{"name":"policySetId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"88888888-8888-4888-8888-888888888888"},{"name":"policySetVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"99999999-9999-4999-8999-999999999990"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact draft the caller reviewed."},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedDigest","clientRequestId"],"additionalProperties":false},"example":{"expectedDigest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","clientRequestId":"commercial-policy-set-version-activate-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy-set version id."},"policySetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policySetId","organizationId","version","status","members","combining","digest","createdAt"],"additionalProperties":false},"example":{"id":"99999999-9999-4999-8999-999999999990","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"active","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The draft is no longer transitionable, another active version won allocation, evaluator/configuration activation validation failed, or clientRequestId conflicts with a prior request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_TRANSITION_CONFLICT","COMMERCIAL_VERSION_ACTIVATION_BLOCKED","COMMERCIAL_VERSION_ALLOCATION_CONFLICT","COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_ACTIVATION_BLOCKED","message":"The draft failed evaluator, configuration, canonical, or PolicySet member activation validation.","traceId":"trace-commercial-fixture"}}}}},"412":{"description":"expectedDigest does not match the immutable commercial version snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_DIGEST_MISMATCH","message":"expectedDigest does not match the immutable version snapshot.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict activation or retirement lifecycle body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID","message":"The strict commercial version lifecycle body is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/commercial/policy-sets/{policySetId}/versions/{policySetVersionId}/retire":{"post":{"operationId":"bookingCommercialPolicySetVersionRetire","summary":"Retire a policy-set version","description":"Retires a draft or active version using expectedDigest and expectedStatus. A stale expectedDigest is COMMERCIAL_VERSION_DIGEST_MISMATCH (412); state or idempotency conflicts are typed 409; malformed lifecycle input is 422. Retirement prevents only new assignments, bindings, or policy-set membership; existing pinned references remain valid and auditable. No dependency scan or reference-in-use conflict is implied.","tags":["booking-commercial"],"parameters":[{"name":"policySetId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"88888888-8888-4888-8888-888888888888"},{"name":"policySetVersionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"99999999-9999-4999-8999-999999999990"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Digest of the exact draft the caller reviewed."},"expectedStatus":{"enum":["draft","active"],"type":"string"},"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Required idempotency key, capped at 128 characters for durable persistence."}},"required":["expectedDigest","expectedStatus","clientRequestId"],"additionalProperties":false},"example":{"expectedDigest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","expectedStatus":"active","clientRequestId":"commercial-policy-set-version-retire-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable policy-set version id."},"policySetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"members":{"type":"array","minItems":1,"items":{"type":"object","properties":{"policyVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyVersionId","priority"],"additionalProperties":false}},"combining":{"type":"object","properties":{"eligibility":{"const":"deny_overrides"},"adjustments":{"enum":["exclusive","stack","best_price"],"type":"string"},"deposits":{"enum":["maximum","priority_override"],"type":"string"},"capacity":{"const":"most_restrictive"},"feesAndPenalties":{"enum":["stack","maximum","priority_override"],"type":"string"},"requirements":{"const":"collect_all"}},"required":["eligibility","adjustments","deposits","capacity","feesAndPenalties","requirements"],"additionalProperties":false},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","policySetId","organizationId","version","status","members","combining","digest","createdAt"],"additionalProperties":false},"example":{"id":"99999999-9999-4999-8999-999999999990","policySetId":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","version":2,"status":"retired","members":[{"policyVersionId":"55555555-5555-4555-8555-555555555555","priority":100}],"combining":{"eligibility":"deny_overrides","adjustments":"stack","deposits":"maximum","capacity":"most_restrictive","feesAndPenalties":"maximum","requirements":"collect_all"},"digest":"9a65a7b4073cc709cb597077ad140b76cc0714ed7c805f0c7f626d627e342c43","createdAt":"2026-08-01T12:00:00.000Z"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted actor is required.","traceId":"trace-commercial-fixture"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The rich commercial identity or immutable version was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_RESOURCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_RESOURCE_NOT_FOUND","message":"The commercial identity or version was not found.","traceId":"trace-commercial-fixture"}}}}},"409":{"description":"The version is no longer in the expected draft/active state or clientRequestId conflicts with a prior request. Existing pinned references remain valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_TRANSITION_CONFLICT","COMMERCIAL_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_TRANSITION_CONFLICT","message":"The version is no longer in the expected draft or active state.","traceId":"trace-commercial-fixture"}}}}},"412":{"description":"expectedDigest does not match the immutable commercial version snapshot.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_DIGEST_MISMATCH"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_DIGEST_MISMATCH","message":"expectedDigest does not match the immutable version snapshot.","traceId":"trace-commercial-fixture"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict activation or retirement lifecycle body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"COMMERCIAL_VERSION_LIFECYCLE_INPUT_INVALID","message":"The strict commercial version lifecycle body is invalid.","traceId":"trace-commercial-fixture"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events":{"post":{"operationId":"bookingEventCreate","summary":"Create an event","description":"Creates one canonical @sonikfm/events draft. Organization identity comes from the authenticated actor; booking contexts remain downstream projections.","tags":["booking-events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"default":null},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime.","default":"private"},"format":{"enum":["in_person","online","hybrid"],"type":"string","default":"in_person"},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"default":{"kind":"tbd"}},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"default":{"kind":"tbd"}},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}]},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for Event creation."}},"required":["title","clientRequestId"],"additionalProperties":false},"example":{"title":"Summer show","description":null,"format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"clientRequestId":"event-create-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"draft","version":1,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-01T12:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"409":{"description":"The clientRequestId conflicts with an existing Event create request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_IDEMPOTENCY_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The typed event body or clone provenance is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID","EVENT_PROVENANCE_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventList","summary":"List events","description":"Lists canonical organization Events with signed cursor pagination, exact-UUID or title search, typed lifecycle/visibility/format/timing filters, date bounds, and stable sort with an Event UUID tie-break.","tags":["booking-events"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Maximum Events to return."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"search","in":"query","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive title search or exact Event UUID."},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"type":"array","items":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string"},"description":"Lifecycle states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["draft"]},{"name":"visibility","in":"query","schema":{"type":"array","items":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"description":"Future presentation eligibility states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["private"]},{"name":"format","in":"query","schema":{"type":"array","items":{"enum":["in_person","online","hybrid"],"type":"string"},"description":"Attendance formats to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"timing","in":"query","schema":{"type":"array","items":{"enum":["upcoming","past","tbd"],"type":"string"},"description":"Derived timing groups evaluated by the database at query time."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"startsAfter","in":"query","schema":{"type":"string","format":"date-time","description":"Inclusive lower bound for scheduled Event start time."},"allowEmptyValue":true,"allowReserved":true},{"name":"startsBefore","in":"query","schema":{"type":"string","format":"date-time","description":"Exclusive upper bound for scheduled Event start time."},"allowEmptyValue":true,"allowReserved":true},{"name":"sort","in":"query","schema":{"type":"object","properties":{"field":{"enum":["starts_at","updated_at","created_at","title"],"type":"string","description":"Stable Event-library sort field."},"direction":{"enum":["asc","desc"],"type":"string","description":"Sort direction before the Event UUID tie-break."}},"required":["field","direction"],"additionalProperties":false,"default":{"field":"created_at","direction":"asc"},"description":"Stable Event-library ordering. Event UUID is always the final tie-break."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."},"heroMedia":{"anyOf":[{"type":"object","properties":{"assetId":{"type":"string","format":"uuid","description":"Bound private media asset selected for this Event card."},"href":{"type":"string","minLength":1,"description":"Authenticated same-origin card-variant route; never a provider or storage URL."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Human-authored alternative text for the selected Event card image."}},"required":["assetId","href","accessibleText"],"additionalProperties":false},{"type":"null"}],"default":null,"description":"Best active ready presentation image for this Event; null when none is bound."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"description":"Event-library rows in stable cursor order."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor for the next page; null at the end."}},"required":["events","nextCursor"],"additionalProperties":false},"example":{"events":[{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"draft","version":1,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-01T12:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"422":{"description":"The event filters or cursor are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_FILTER_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}":{"get":{"operationId":"bookingEventGet","summary":"Get an event","description":"Returns one canonical Event by organization-scoped UUID.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"draft","version":1,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-01T12:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"patch":{"operationId":"bookingEventUpdate","summary":"Update an event","description":"Updates canonical Event draft fields with optimistic concurrency. Adoption must merge the patch into the current record and parse the complete EventSchema before mutation so cross-field format/location invariants remain enforced. Lifecycle changes use explicit commands.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current Event version required by CAS."},"patch":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."}},"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for this Event mutation."}},"required":["expectedVersion","patch","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"patch":{"title":"Summer show — updated","description":"Updated event details."},"clientRequestId":"event-update-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show — updated","description":"Updated event details.","visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"draft","version":2,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-02T12:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event version or clientRequestId conflicts with current event state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_VERSION_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_VERSION_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The typed event patch is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_PATCH_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_PATCH_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"delete":{"operationId":"bookingEventDelete","summary":"Delete a draft event","description":"Marks a canonical draft Event deleted; auditable non-draft Events cannot use this command.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current Event version required by CAS."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for this lifecycle command."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"event-delete-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"deleted","version":2,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-02T12:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event version conflicts or the event is not a deletable draft.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_VERSION_CONFLICT","EVENT_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_VERSION_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"expectedVersion and clientRequestId are required and must be valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/readiness":{"get":{"operationId":"bookingEventReadiness","summary":"Get event readiness","description":"Returns derived publication, sales, fulfillment, and Event access-point/scanning readiness for one exact Event version. Resource access remains fulfillment-only until a typed resource-entry checkpoint exists. A 200 response can be not_ready or not_applicable; it does not imply publication or that shadow child surfaces are mounted.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"publication":{"anyOf":[{"type":"object","properties":{"ready":{"const":true},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["ready","issues"],"additionalProperties":false},{"type":"object","properties":{"ready":{"const":false},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["schedule_tbd","location_tbd","online_channel_incomplete","physical_location_name_missing","physical_location_address_incomplete","physical_location_timezone_missing","physical_location_accessibility_missing","venue_identity_not_found","organization_space_identity_not_found"],"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","path","message","remediation"],"additionalProperties":false}}},"required":["ready","issues"],"additionalProperties":false}]},"sales":{"anyOf":[{"type":"object","properties":{"status":{"const":"not_applicable"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"ready"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_ready"},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["no_active_offer","sales_window_not_configured","sales_window_not_open","commercial_reference_unresolved","inventory_reference_unresolved"],"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","accessPointId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","rateAssignmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_binding"},"policyBindingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyBindingId"],"additionalProperties":false}]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Path relative to the issue source."},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","source","path","message","remediation"],"additionalProperties":false}}},"required":["status","issues"],"additionalProperties":false}]},"fulfillment":{"anyOf":[{"type":"object","properties":{"status":{"const":"not_applicable"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"ready"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_ready"},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["no_active_offer","entitlement_reference_unresolved","session_reference_unresolved","fulfillment_policy_reference_unresolved"],"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","accessPointId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","rateAssignmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_binding"},"policyBindingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyBindingId"],"additionalProperties":false}]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Path relative to the issue source."},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","source","path","message","remediation"],"additionalProperties":false}}},"required":["status","issues"],"additionalProperties":false}]},"access":{"anyOf":[{"type":"object","properties":{"status":{"const":"not_applicable"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"ready"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_ready"},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["access_point_not_configured","access_target_unresolved"],"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","accessPointId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","rateAssignmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_binding"},"policyBindingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyBindingId"],"additionalProperties":false}]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Path relative to the issue source."},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","source","path","message","remediation"],"additionalProperties":false}}},"required":["status","issues"],"additionalProperties":false}],"description":"Event access-point and scanning readiness. Resource access remains fulfillment-only until a typed resource-entry checkpoint exists."}},"required":["eventId","eventVersion","evaluatedAt","publication","sales","fulfillment","access"],"additionalProperties":false},"example":{"eventId":"22222222-2222-4222-8222-222222222222","eventVersion":1,"evaluatedAt":"2026-07-18T20:00:00.000Z","publication":{"ready":false,"issues":[{"code":"venue_identity_not_found","path":["location","physicalLocation","venuePlaceId"],"message":"Canonical Venue identity was not found.","remediation":"Use external_place until a separately governed Venue identity exists."}]},"sales":{"status":"not_applicable","issues":[]},"fulfillment":{"status":"not_applicable","issues":[]},"access":{"status":"not_applicable","issues":[]}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/overview":{"get":{"operationId":"bookingEventOverview","summary":"Get event operator overview","description":"Returns the canonical Event with its coherent derived readiness snapshot. It does not embed offers, sessions, tickets, orders, or other child collections.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"readiness":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"publication":{"anyOf":[{"type":"object","properties":{"ready":{"const":true},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["ready","issues"],"additionalProperties":false},{"type":"object","properties":{"ready":{"const":false},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["schedule_tbd","location_tbd","online_channel_incomplete","physical_location_name_missing","physical_location_address_incomplete","physical_location_timezone_missing","physical_location_accessibility_missing","venue_identity_not_found","organization_space_identity_not_found"],"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","path","message","remediation"],"additionalProperties":false}}},"required":["ready","issues"],"additionalProperties":false}]},"sales":{"anyOf":[{"type":"object","properties":{"status":{"const":"not_applicable"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"ready"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_ready"},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["no_active_offer","sales_window_not_configured","sales_window_not_open","commercial_reference_unresolved","inventory_reference_unresolved"],"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","accessPointId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","rateAssignmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_binding"},"policyBindingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyBindingId"],"additionalProperties":false}]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Path relative to the issue source."},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","source","path","message","remediation"],"additionalProperties":false}}},"required":["status","issues"],"additionalProperties":false}]},"fulfillment":{"anyOf":[{"type":"object","properties":{"status":{"const":"not_applicable"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"ready"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_ready"},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["no_active_offer","entitlement_reference_unresolved","session_reference_unresolved","fulfillment_policy_reference_unresolved"],"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","accessPointId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","rateAssignmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_binding"},"policyBindingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyBindingId"],"additionalProperties":false}]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Path relative to the issue source."},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","source","path","message","remediation"],"additionalProperties":false}}},"required":["status","issues"],"additionalProperties":false}]},"access":{"anyOf":[{"type":"object","properties":{"status":{"const":"not_applicable"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"ready"},"issues":{"type":"array","maxItems":0,"items":{"not":{}}}},"required":["status","issues"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_ready"},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["access_point_not_configured","access_target_unresolved"],"type":"string"},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","accessPointId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","rateAssignmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"policy_binding"},"policyBindingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","policyBindingId"],"additionalProperties":false}]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"description":"Path relative to the issue source."},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","source","path","message","remediation"],"additionalProperties":false}}},"required":["status","issues"],"additionalProperties":false}],"description":"Event access-point and scanning readiness. Resource access remains fulfillment-only until a typed resource-entry checkpoint exists."}},"required":["eventId","eventVersion","evaluatedAt","publication","sales","fulfillment","access"],"additionalProperties":false}},"required":["event","readiness"],"additionalProperties":false},"example":{"event":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"draft","version":1,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-01T12:00:00.000Z"},"readiness":{"eventId":"22222222-2222-4222-8222-222222222222","eventVersion":1,"evaluatedAt":"2026-07-18T20:00:00.000Z","publication":{"ready":false,"issues":[{"code":"venue_identity_not_found","path":["location","physicalLocation","venuePlaceId"],"message":"Canonical Venue identity was not found.","remediation":"Use external_place until a separately governed Venue identity exists."}]},"sales":{"status":"not_applicable","issues":[]},"fulfillment":{"status":"not_applicable","issues":[]},"access":{"status":"not_applicable","issues":[]}}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/history":{"get":{"operationId":"bookingEventHistoryList","summary":"List event history","description":"Returns newest-first immutable Event command evidence with signed pagination. Actor output is limited to an organization-scoped principal UUID or an explicit legacy redaction; authentication subjects and contact data are never exposed.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque signed pagination cursor."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Number of newest-first history entries to return (default 50, maximum 100)."},"allowEmptyValue":true,"allowReserved":true,"example":50}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable Event command evidence UUID."},"eventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"action":{"enum":["created","updated","published","cancelled","completed","deleted","amended"],"type":"string"},"actor":{"anyOf":[{"type":"object","properties":{"kind":{"const":"principal"},"principalId":{"type":"string","format":"uuid","description":"Organization-scoped app principal UUID. Authentication subject and contact fields are never exposed."}},"required":["kind","principalId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"redacted"},"reason":{"const":"legacy_missing","description":"Older immutable evidence did not capture an app principal UUID."}},"required":["kind","reason"],"additionalProperties":false}]},"occurredAt":{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},"sourceChannel":{"enum":["production","agent-ui-host-context","demo-harness","dev-header","legacy-unknown"],"type":"string"},"resourceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Event version produced by this command."},"reason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"Operator reason when the originating command captured one."},"commandReceiptId":{"type":"string","format":"uuid","description":"Immutable command receipt reference. Caller idempotency keys are not exposed."}},"required":["id","eventId","action","actor","occurredAt","sourceChannel","resourceVersion","reason","commandReceiptId"],"additionalProperties":false},"description":"Newest-first immutable Event lifecycle and setup history."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor for the next older page."}},"required":["entries","nextCursor"],"additionalProperties":false},"example":{"entries":[{"id":"77777777-7777-4777-8777-777777777777","eventId":"22222222-2222-4222-8222-222222222222","action":"published","actor":{"kind":"principal","principalId":"11111111-1111-4111-8111-111111111111"},"occurredAt":"2026-07-20T18:00:00.000Z","sourceChannel":"production","resourceVersion":2,"reason":null,"commandReceiptId":"77777777-7777-4777-8777-777777777777"},{"id":"66666666-6666-4666-8666-666666666666","eventId":"22222222-2222-4222-8222-222222222222","action":"created","actor":{"kind":"redacted","reason":"legacy_missing"},"occurredAt":"2026-07-01T12:00:00.000Z","sourceChannel":"legacy-unknown","resourceVersion":1,"reason":null,"commandReceiptId":"66666666-6666-4666-8666-666666666666"}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The event history cursor is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_FILTER_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/amend":{"post":{"operationId":"bookingEventAmend","summary":"Amend a published event","description":"Changes the title, description, schedule (doorsOpenAt included) or location of an active canonical Event with optimistic concurrency and a required operator reason. The patch merges into the current record and the complete EventSchema is parsed, so format/location agreement holds; format and visibility are refused, and a changed start may not be in the past. The newest history entry is `amended` and carries the reason. Buyers are not notified; the organizer resends. bookingEventUpdate stays draft-only.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current Event version required by CAS."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for this Event amendment."},"reason":{"type":"string","minLength":1,"maxLength":500,"description":"Operator reason, recorded on the amended history entry."},"patch":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."}},"additionalProperties":false}},"required":["expectedVersion","clientRequestId","reason","patch"],"additionalProperties":false},"example":{"expectedVersion":3,"clientRequestId":"event-amend-001","reason":"Venue moved the show one day later.","patch":{"schedule":{"kind":"scheduled","startsAt":"2026-07-21T20:00:00.000Z","endsAt":"2026-07-21T22:00:00.000Z","doorsOpenAt":"2026-07-21T19:00:00.000Z","timezone":"America/New_York"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":"Moved one day later.","visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-21T20:00:00.000Z","endsAt":"2026-07-21T22:00:00.000Z","doorsOpenAt":"2026-07-21T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"active","version":4,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-03T12:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event version conflicts, the event is not active, or the clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_VERSION_CONFLICT","EVENT_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_LIFECYCLE_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The amendment is invalid: a field outside title, description, schedule and location, an invalid merged Event, or a changed start in the past.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/publish":{"post":{"operationId":"bookingEventPublish","summary":"Publish an event","description":"Publishes a canonical Event only when its typed publication-readiness result is ready.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current Event version required by CAS."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for this lifecycle command."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"event-publish-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"outcome":{"const":"published"},"event":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{}},"additionalProperties":false},{"type":"object","properties":{"status":{},"wheelchairEntrance":{},"accessibleParking":{},"accessibleRestroom":{}},"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{},"externalId":{},"externalVersion":{}},"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false}},"required":["outcome","event"],"additionalProperties":false},{"type":"object","properties":{"outcome":{"const":"not_ready"},"readiness":{"type":"object","properties":{"ready":{"const":false},"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"enum":["schedule_tbd","location_tbd","online_channel_incomplete","physical_location_name_missing","physical_location_address_incomplete","physical_location_timezone_missing","physical_location_accessibility_missing","venue_identity_not_found","organization_space_identity_not_found"],"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string","minLength":1},"remediation":{"type":"string","minLength":1}},"required":["code","path","message","remediation"],"additionalProperties":false}}},"required":["ready","issues"],"additionalProperties":false}},"required":["outcome","readiness"],"additionalProperties":false}]},"example":{"outcome":"not_ready","readiness":{"ready":false,"issues":[{"code":"schedule_tbd","path":["schedule"],"message":"Event schedule is still TBD.","remediation":"Set a scheduled or date-only Event schedule before publishing."}]}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event version, draft lifecycle, or clientRequestId conflicts with current event state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_VERSION_CONFLICT","EVENT_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_VERSION_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"expectedVersion and clientRequestId are required and must be valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/cancel":{"post":{"operationId":"bookingEventCancel","summary":"Cancel an event","description":"Transitions an active canonical Event to cancelled with an optional operator reason (recorded on the cancelled history entry), and in the same transaction voids its active tickets, revokes their active entitlement grants and retires its active and paused Offers. Bookings, payments and fulfillment history are kept. The answer names the voided ticket count, the retired Offers and the orders that may owe a refund; no refund is started.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current Event version required by CAS."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for this lifecycle command."},"reason":{"type":"string","minLength":1,"maxLength":500,"description":"Operator reason, recorded on the cancelled history entry."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"event-cancel-001","reason":"Headliner withdrew"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"ticketsVoided":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active tickets this cancel voided; their active entitlement grants are revoked."},"offersRetired":{"type":"array","items":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"fromStatus":{"enum":["active","paused"],"type":"string"}},"required":["offerId","fromStatus"],"additionalProperties":false},"description":"Active and paused Offers this cancel retired. Draft Offers stay draft."},"ordersRequiringRefund":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"paymentStatus":{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."}},"required":["orderId","paymentStatus"],"additionalProperties":false},"description":"Orders whose cancellation obligation may owe money back (refund_required or manual_review), with the payment state the cancel read. Free, unsettled and already refunded orders are not listed. Nothing is refunded here."}},"required":["event","ticketsVoided","offersRetired","ordersRequiringRefund"],"additionalProperties":false},"example":{"event":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"cancelled","version":2,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-02T12:00:00.000Z"},"ticketsVoided":2,"offersRetired":[{"offerId":"44444444-4444-4444-8444-444444444444","fromStatus":"active"},{"offerId":"44444444-4444-4444-8444-444444444445","fromStatus":"paused"}],"ordersRequiringRefund":[{"orderId":"55555555-5555-4555-8555-555555555555","paymentStatus":"succeeded"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event version conflicts or the event cannot transition to cancelled.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_VERSION_CONFLICT","EVENT_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_VERSION_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"expectedVersion and clientRequestId are required and must be valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/complete":{"post":{"operationId":"bookingEventComplete","summary":"Complete an event","description":"Transitions an active canonical Event to completed.","tags":["booking-events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current Event version required by CAS."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for this lifecycle command."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"event-complete-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Human-facing Event title."},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"description":"Optional Event description; null means no description was supplied."},"visibility":{"enum":["private","unlisted","public"],"type":"string","description":"Future presentation eligibility only; visibility does not create a public URL or imply mounted publication runtime."},"format":{"enum":["in_person","online","hybrid"],"type":"string","description":"Attendance mode; must agree with the location variant."},"schedule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"scheduled"},"startsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event begins."},"endsAt":{"type":"string","format":"date-time","description":"Instant when the programmed Event ends."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"RFC 3339 timestamp with an explicit UTC offset."},{"type":"null"}],"description":"Optional instant when attendee entry begins; must not be after startsAt."},"timezone":{"type":"string","minLength":1,"description":"Display and scheduling time zone for the Event."}},"required":["kind","startsAt","endsAt","doorsOpenAt","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"date_only"},"startDate":{"type":"string","format":"date","description":"First local calendar date of a date-only Event."},"endDate":{"type":"string","format":"date","description":"Last local calendar date of a date-only Event."},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind","startDate","endDate","timezone"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"timezone":{"type":"string","minLength":1,"description":"IANA time-zone identifier used to interpret local Event time."}},"required":["kind"],"additionalProperties":false}],"description":"Scheduled, date-only, or explicitly TBD Event timing."},"location":{"anyOf":[{"type":"object","properties":{"kind":{"const":"physical"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."}},"required":["kind","physicalLocation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hybrid"},"physicalLocation":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}],"description":"Where in-person attendance occurs."},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}],"description":"Non-secret online delivery metadata."}},"required":["kind","physicalLocation","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"}},"required":["kind"],"additionalProperties":false}],"description":"Physical, online, hybrid, or explicitly TBD location."},"id":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns and governs the Event."},"status":{"enum":["draft","active","cancelled","completed","deleted"],"type":"string","description":"Canonical Event lifecycle state."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"provenance":{"anyOf":[{"type":"object","properties":{"kind":{"const":"clone"},"sourceEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"sourceEventVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable Event version."},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Server-verified digest of the exact source Event version's canonical clone-source projection."}},"required":["kind","sourceEventId","sourceEventVersion","sourceDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"template"},"templateId":{"type":"string","minLength":1,"maxLength":200},"templateVersion":{"type":"string","minLength":1,"maxLength":100},"templateSchemaVersion":{"type":"string","minLength":1,"maxLength":100},"sourceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Caller-declared template source digest. Retained as evidence but not verified until versioned Event-template authority mounts."}},"required":["kind","templateId","templateVersion","templateSchemaVersion","sourceDigest"],"additionalProperties":false}],"description":"Immutable clone or template lineage."},"source":{"enum":["luma","eventbrite"],"type":"string","description":"Organizer provider that owns the mirrored Event."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned Event identifier."},"externalUrl":{"type":"string","format":"uri","description":"Provider attribution and booking URL."},"syncedAt":{"type":"string","format":"date-time","description":"Last successful organizer synchronization."},"createdAt":{"type":"string","format":"date-time","description":"Creation time of the canonical Event record."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current Event version was written."}},"required":["title","description","visibility","format","schedule","location","id","organizationId","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"22222222-2222-4222-8222-222222222222","organizationId":"11111111-1111-4111-8111-111111111111","title":"Summer show","description":null,"visibility":"private","format":"in_person","schedule":{"kind":"scheduled","startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z","doorsOpenAt":"2026-07-20T19:00:00.000Z","timezone":"America/New_York"},"location":{"kind":"physical","physicalLocation":{"kind":"canonical_venue","venue":{"venuePlaceId":"33333333-3333-4333-8333-333333333333","snapshot":{"name":"The Hall","address":{"line1":"1 Main Street","line2":null,"locality":"New York","region":"NY","postalCode":"10001","countryCode":"US"},"coordinates":{"latitude":40.75,"longitude":-73.99},"timezone":"America/New_York","accessibility":{"status":"unknown"},"externalReferences":[{"providerKey":"google_places","externalId":"place-1"}]}}}},"status":"completed","version":2,"createdAt":"2026-07-01T12:00:00.000Z","updatedAt":"2026-07-02T12:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event version conflicts or the event cannot transition to completed.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_VERSION_CONFLICT","EVENT_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_VERSION_CONFLICT","message":"Example"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"expectedVersion and clientRequestId are required and must be valid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The configured Amplify session service could not resolve booking auth context.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/associations":{"post":{"operationId":"bookingEventAssociationPropose","summary":"Propose an Event companion association","description":"Unpublished companion-only EventAssociation projection over canonical @sonikfm/events schemas. Presentation/governance only; not mounted.","tags":["booking-event-associations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"participantEventIds":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["clientRequestId","anchorEventId","companionEventId","kind","role","visibility","requestedClaim","participantEventIds"],"additionalProperties":false},"example":{"clientRequestId":"association-propose-001","anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","kind":"companion","role":{"code":"post_event","label":null},"visibility":"public","requestedClaim":"related","participantEventIds":["10000000-0000-4000-8000-000000000001"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"const":"propose"},"outcome":{"const":"proposed"},"associationId":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"clientRequestId":{"type":"string","minLength":1},"version":{"const":1},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"status":{"const":"proposed"},"approvedParticipantEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["action","outcome","associationId","clientRequestId","version","anchorEventId","companionEventId","requiredParticipantEventIds","status","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false},"example":{"action":"propose","outcome":"proposed","associationId":"20000000-0000-4000-8000-000000000001","clientRequestId":"association-propose-001","version":1,"anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","requiredParticipantEventIds":["10000000-0000-4000-8000-000000000001","10000000-0000-4000-8000-000000000002"],"status":"proposed","approvedParticipantEventIds":[],"remainingApprovalEventIds":["10000000-0000-4000-8000-000000000001","10000000-0000-4000-8000-000000000002"]}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"AUTHENTICATION_REQUIRED"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED"}}}}},"403":{"description":"The actor lacks endpoint control or exact propose authorization evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_AUTHORITY_DENIED"},"reason":{"enum":["proposer_not_participant","endpoint_control_required","actor_authorization_invalid"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_AUTHORITY_DENIED","reason":"actor_authorization_invalid"}}}}},"404":{"description":"An endpoint Event was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_NOT_FOUND"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND"}}}}},"409":{"description":"An active association already exists or the idempotency key conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_ALREADY_EXISTS"}},"required":["code"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_IDEMPOTENCY_CONFLICT"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_IDEMPOTENCY_CONFLICT"}}}}},"422":{"description":"The endpoint or controlled participant set is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_SELF_REFERENCE"}},"required":["code"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID"},"reason":{"enum":["empty","duplicate","non_endpoint","action_ineligible"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID","reason":"non_endpoint"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventAssociationList","summary":"List disclosed association views for an Event","description":"Unpublished companion-only EventAssociation projection over canonical @sonikfm/events schemas. Presentation/governance only; not mounted.","tags":["booking-event-associations"],"parameters":[{"name":"eventId","in":"query","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"allowEmptyValue":true,"allowReserved":true,"example":"10000000-0000-4000-8000-000000000001"},{"name":"viewMode","in":"query","required":true,"schema":{"enum":["public","participant"],"type":"string","description":"Select homogeneous redacted public or authorized participant items."},"allowEmptyValue":true,"allowReserved":true,"example":"public"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"viewMode":{"const":"public"},"items":{"type":"array","items":{"type":"object","properties":{"view":{"const":"public"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"status":{"const":"accepted"},"visibility":{"const":"public"},"effectiveClaim":{"enum":["none","related","official"],"type":"string"}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","status","visibility","effectiveClaim"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["viewMode","items","nextCursor"],"additionalProperties":false},{"type":"object","properties":{"viewMode":{"const":"participant"},"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"proposed"},"effectiveClaim":{"const":"none"},"approvalSummary":{"anyOf":[{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false},{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}]}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false},{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"rejected"},"effectiveClaim":{"const":"none"},"approvalSummary":{"anyOf":[{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false},{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}]}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false},{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"accepted"},"effectiveClaim":{"enum":["none","related","official"],"type":"string"},"approvalSummary":{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false},{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"revoked"},"effectiveClaim":{"const":"none"},"approvalSummary":{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false}]}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["viewMode","items","nextCursor"],"additionalProperties":false}]},"example":{"viewMode":"public","items":[{"view":"public","id":"20000000-0000-4000-8000-000000000001","version":2,"anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","kind":"companion","role":{"code":"post_event","label":null},"status":"accepted","visibility":"public","effectiveClaim":"related","createdAt":"2026-07-18T00:00:00.000Z","updatedAt":"2026-07-18T00:05:00.000Z"}],"nextCursor":null}}}},"422":{"description":"The event-scoped list query is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_QUERY_INVALID"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_QUERY_INVALID"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]},{}]}},"/api/v1/booking/events/associations/{associationId}/accept":{"post":{"operationId":"bookingEventAssociationAccept","summary":"Approve controlled association endpoints","description":"Unpublished companion-only EventAssociation projection over canonical @sonikfm/events schemas. Presentation/governance only; not mounted.","tags":["booking-event-associations"],"parameters":[{"name":"associationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"participantEventIds":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["clientRequestId","expectedVersion","participantEventIds"],"additionalProperties":false},"example":{"clientRequestId":"association-accept-001","expectedVersion":1,"participantEventIds":["10000000-0000-4000-8000-000000000001"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"action":{"const":"accept"},"outcome":{"const":"approval_recorded"},"associationId":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"clientRequestId":{"type":"string","minLength":1},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"status":{"const":"proposed"},"approvedParticipantEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["action","outcome","associationId","clientRequestId","version","anchorEventId","companionEventId","requiredParticipantEventIds","status","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false},{"type":"object","properties":{"action":{"const":"accept"},"outcome":{"const":"accepted"},"associationId":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"clientRequestId":{"type":"string","minLength":1},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"status":{"const":"accepted"},"approvedParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["action","outcome","associationId","clientRequestId","version","anchorEventId","companionEventId","requiredParticipantEventIds","status","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}]},"example":{"action":"accept","outcome":"approval_recorded","associationId":"20000000-0000-4000-8000-000000000001","clientRequestId":"association-accept-001","version":2,"anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","requiredParticipantEventIds":["10000000-0000-4000-8000-000000000001","10000000-0000-4000-8000-000000000002"],"status":"proposed","approvedParticipantEventIds":["10000000-0000-4000-8000-000000000001"],"remainingApprovalEventIds":["10000000-0000-4000-8000-000000000002"]}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"AUTHENTICATION_REQUIRED"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED"}}}}},"403":{"description":"The actor lacks endpoint control or exact approve authorization evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_AUTHORITY_DENIED"},"reason":{"enum":["proposer_not_participant","endpoint_control_required","actor_authorization_invalid"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_AUTHORITY_DENIED","reason":"actor_authorization_invalid"}}}}},"404":{"description":"The association or an endpoint Event was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_NOT_FOUND"}},"required":["code"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_NOT_FOUND"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_NOT_FOUND"}}}}},"409":{"description":"The transition, optimistic version, or idempotency key conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_INVALID_TRANSITION"},"reason":{"enum":["invalid_status","approval_already_recorded"],"type":"string"},"fromStatus":{"enum":["proposed","accepted","rejected","revoked"],"type":"string"},"requestedAction":{"enum":["accept","reject","revoke"],"type":"string"}},"required":["code","reason","fromStatus","requestedAction"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_VERSION_CONFLICT"},"expectedVersion":{"type":"integer","minimum":1},"currentVersion":{"type":"integer","minimum":1}},"required":["code","expectedVersion","currentVersion"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_IDEMPOTENCY_CONFLICT"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_INVALID_TRANSITION","reason":"approval_already_recorded","fromStatus":"proposed","requestedAction":"accept"}}}}},"422":{"description":"The controlled participant set is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID"},"reason":{"enum":["empty","duplicate","non_endpoint","action_ineligible"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID","reason":"duplicate"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/associations/{associationId}/reject":{"post":{"operationId":"bookingEventAssociationReject","summary":"Reject a proposed association","description":"Unpublished companion-only EventAssociation projection over canonical @sonikfm/events schemas. Presentation/governance only; not mounted.","tags":["booking-event-associations"],"parameters":[{"name":"associationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"participantEventIds":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"reason":{"anyOf":[{"type":"object","properties":{"code":{"enum":["relationship_incorrect","authority_disputed","event_changed"],"type":"string"},"detail":{"type":"null"}},"required":["code","detail"],"additionalProperties":false},{"type":"object","properties":{"code":{"const":"other"},"detail":{"type":"string","minLength":1,"maxLength":1000}},"required":["code","detail"],"additionalProperties":false}]}},"required":["clientRequestId","expectedVersion","participantEventIds","reason"],"additionalProperties":false},"example":{"clientRequestId":"association-reject-001","expectedVersion":1,"participantEventIds":["10000000-0000-4000-8000-000000000001"],"reason":{"code":"relationship_incorrect","detail":null}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"const":"reject"},"outcome":{"const":"rejected"},"associationId":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"clientRequestId":{"type":"string","minLength":1},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"status":{"const":"rejected"}},"required":["action","outcome","associationId","clientRequestId","version","anchorEventId","companionEventId","requiredParticipantEventIds","status"],"additionalProperties":false},"example":{"action":"reject","outcome":"rejected","associationId":"20000000-0000-4000-8000-000000000001","clientRequestId":"association-reject-001","version":2,"anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","requiredParticipantEventIds":["10000000-0000-4000-8000-000000000001","10000000-0000-4000-8000-000000000002"],"status":"rejected"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"AUTHENTICATION_REQUIRED"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED"}}}}},"403":{"description":"The actor lacks endpoint control or exact reject authorization evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_AUTHORITY_DENIED"},"reason":{"enum":["proposer_not_participant","endpoint_control_required","actor_authorization_invalid"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_AUTHORITY_DENIED","reason":"endpoint_control_required"}}}}},"404":{"description":"The association was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_NOT_FOUND"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_NOT_FOUND"}}}}},"409":{"description":"The transition, optimistic version, or idempotency key conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_INVALID_TRANSITION"},"reason":{"enum":["invalid_status","approval_already_recorded"],"type":"string"},"fromStatus":{"enum":["proposed","accepted","rejected","revoked"],"type":"string"},"requestedAction":{"enum":["accept","reject","revoke"],"type":"string"}},"required":["code","reason","fromStatus","requestedAction"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_VERSION_CONFLICT"},"expectedVersion":{"type":"integer","minimum":1},"currentVersion":{"type":"integer","minimum":1}},"required":["code","expectedVersion","currentVersion"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_IDEMPOTENCY_CONFLICT"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_VERSION_CONFLICT","expectedVersion":1,"currentVersion":2}}}}},"422":{"description":"The controlled participant set is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID"},"reason":{"enum":["empty","duplicate","non_endpoint","action_ineligible"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID","reason":"action_ineligible"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/associations/{associationId}/revoke":{"post":{"operationId":"bookingEventAssociationRevoke","summary":"Revoke an accepted association","description":"Unpublished companion-only EventAssociation projection over canonical @sonikfm/events schemas. Presentation/governance only; not mounted.","tags":["booking-event-associations"],"parameters":[{"name":"associationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"participantEventIds":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"reason":{"anyOf":[{"type":"object","properties":{"code":{"enum":["authority_revoked","relationship_ended","evidence_invalid","event_changed"],"type":"string"},"detail":{"type":"null"}},"required":["code","detail"],"additionalProperties":false},{"type":"object","properties":{"code":{"const":"other"},"detail":{"type":"string","minLength":1,"maxLength":1000}},"required":["code","detail"],"additionalProperties":false}]}},"required":["clientRequestId","expectedVersion","participantEventIds","reason"],"additionalProperties":false},"example":{"clientRequestId":"association-revoke-001","expectedVersion":2,"participantEventIds":["10000000-0000-4000-8000-000000000002"],"reason":{"code":"relationship_ended","detail":null}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"const":"revoke"},"outcome":{"const":"revoked"},"associationId":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"clientRequestId":{"type":"string","minLength":1},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"status":{"const":"revoked"}},"required":["action","outcome","associationId","clientRequestId","version","anchorEventId","companionEventId","requiredParticipantEventIds","status"],"additionalProperties":false},"example":{"action":"revoke","outcome":"revoked","associationId":"20000000-0000-4000-8000-000000000001","clientRequestId":"association-revoke-001","version":3,"anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","requiredParticipantEventIds":["10000000-0000-4000-8000-000000000001","10000000-0000-4000-8000-000000000002"],"status":"revoked"}}}},"401":{"description":"A trusted actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"AUTHENTICATION_REQUIRED"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED"}}}}},"403":{"description":"The actor lacks endpoint control or exact revoke authorization evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_AUTHORITY_DENIED"},"reason":{"enum":["proposer_not_participant","endpoint_control_required","actor_authorization_invalid"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_AUTHORITY_DENIED","reason":"actor_authorization_invalid"}}}}},"404":{"description":"The association was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_NOT_FOUND"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_NOT_FOUND"}}}}},"409":{"description":"The transition, optimistic version, or idempotency key conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_INVALID_TRANSITION"},"reason":{"enum":["invalid_status","approval_already_recorded"],"type":"string"},"fromStatus":{"enum":["proposed","accepted","rejected","revoked"],"type":"string"},"requestedAction":{"enum":["accept","reject","revoke"],"type":"string"}},"required":["code","reason","fromStatus","requestedAction"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_VERSION_CONFLICT"},"expectedVersion":{"type":"integer","minimum":1},"currentVersion":{"type":"integer","minimum":1}},"required":["code","expectedVersion","currentVersion"]},{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_IDEMPOTENCY_CONFLICT"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_INVALID_TRANSITION","reason":"invalid_status","fromStatus":"revoked","requestedAction":"revoke"}}}}},"422":{"description":"The controlled participant set is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID"},"reason":{"enum":["empty","duplicate","non_endpoint","action_ineligible"],"type":"string"}},"required":["code","reason"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_PARTICIPANT_SET_INVALID","reason":"empty"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/associations/{associationId}":{"get":{"operationId":"bookingEventAssociationGet","summary":"Get a disclosed association view","description":"Unpublished companion-only EventAssociation projection over canonical @sonikfm/events schemas. Presentation/governance only; not mounted.","tags":["booking-event-associations"],"parameters":[{"name":"associationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"example":"20000000-0000-4000-8000-000000000001"},{"name":"viewMode","in":"query","required":true,"schema":{"enum":["public","participant"],"type":"string","description":"Select the redacted public view or authorized participant view."},"allowEmptyValue":true,"allowReserved":true,"example":"public"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"viewMode":{"const":"public"},"association":{"type":"object","properties":{"view":{"const":"public"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"status":{"const":"accepted"},"visibility":{"const":"public"},"effectiveClaim":{"enum":["none","related","official"],"type":"string"}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","status","visibility","effectiveClaim"],"additionalProperties":false}},"required":["viewMode","association"],"additionalProperties":false},{"type":"object","properties":{"viewMode":{"const":"participant"},"association":{"anyOf":[{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"proposed"},"effectiveClaim":{"const":"none"},"approvalSummary":{"anyOf":[{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false},{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}]}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false},{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"rejected"},"effectiveClaim":{"const":"none"},"approvalSummary":{"anyOf":[{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false},{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}]}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false},{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"accepted"},"effectiveClaim":{"enum":["none","related","official"],"type":"string"},"approvalSummary":{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false},{"type":"object","properties":{"view":{"const":"participant"},"id":{"type":"string","format":"uuid","description":"Canonical EventAssociation UUID."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"anchorEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"companionEventId":{"type":"string","format":"uuid","description":"Canonical Event UUID."},"kind":{"const":"companion"},"role":{"type":"object","properties":{"code":{"enum":["pre_event","post_event","vip_experience","hospitality","transportation","satellite","other"],"type":"string"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["code","label"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"proposerOrganizationId":{"type":"string","format":"uuid","description":"Canonical organization UUID."},"visibility":{"enum":["private","unlisted","public"],"type":"string"},"requestedClaim":{"enum":["related","official"],"type":"string"},"status":{"const":"revoked"},"effectiveClaim":{"const":"none"},"approvalSummary":{"type":"object","properties":{"requiredParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"approvedParticipantEventIds":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"remainingApprovalEventIds":{"type":"array","minItems":0,"maxItems":0,"items":{"type":"string","format":"uuid","description":"Canonical Event UUID."}}},"required":["requiredParticipantEventIds","approvedParticipantEventIds","remainingApprovalEventIds"],"additionalProperties":false}},"required":["view","id","version","anchorEventId","companionEventId","kind","role","createdAt","updatedAt","proposerOrganizationId","visibility","requestedClaim","status","effectiveClaim","approvalSummary"],"additionalProperties":false}]}},"required":["viewMode","association"],"additionalProperties":false}]},"example":{"viewMode":"public","association":{"view":"public","id":"20000000-0000-4000-8000-000000000001","version":2,"anchorEventId":"10000000-0000-4000-8000-000000000001","companionEventId":"10000000-0000-4000-8000-000000000002","kind":"companion","role":{"code":"post_event","label":null},"status":"accepted","visibility":"public","effectiveClaim":"related","createdAt":"2026-07-18T00:00:00.000Z","updatedAt":"2026-07-18T00:05:00.000Z"}}}}},"404":{"description":"The association is unavailable or not disclosed to the caller.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"const":"EVENT_ASSOCIATION_NOT_FOUND"}},"required":["code"]}]}},"required":["error"]},"example":{"error":{"code":"EVENT_ASSOCIATION_NOT_FOUND"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]},{}]}},"/api/v1/booking/events/{eventId}/commercial-items/configure":{"post":{"operationId":"bookingEventCommercialItemConfigure","summary":"Configure an event commercial item","description":"Creates or updates one ticket, reservation, or session Offer from organizer-facing nouns. Booking atomically compiles the command into one canonical RatePlan, active immutable RatePlanVersion, Offer, and server-owned base RateAssignment. Package composition remains unsupported until canonical parent-child Offer authority exists.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"price":{"anyOf":[{"type":"object","properties":{"kind":{"const":"free"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","currency"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"The price of ONE Offer unit (one ticket). An order of q units pays amountMinor times q."},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","amountMinor","currency"],"additionalProperties":false}]},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"purchaseLimits":{"type":"object","properties":{"minimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["minimum","maximum"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128},"fulfillmentMode":{"const":"ticketed"},"action":{"const":"create"},"item":{"anyOf":[{"type":"object","properties":{"kind":{"const":"ticket"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"ticket"},"inventoryDraft":{"type":"object","properties":{"resourceType":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","minLength":1,"maxLength":64},"section":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null}},"required":["name","kind"],"additionalProperties":false},"units":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":2147483647,"exclusiveMinimum":0}},"required":["name","capacity"],"additionalProperties":false}},"allowPartialPurchase":{"type":"boolean"},"releasedCapacity":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"default":null}},"required":["resourceType","units","allowPartialPurchase"],"additionalProperties":false}},"required":["kind","inventoryDraft"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"ticket"},"countedDraft":{"type":"object","properties":{"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":2147483647,"exclusiveMinimum":0}},"required":["quantity"],"additionalProperties":false,"description":"General-admission counted capacity. Save creates one dedicated Event-owned counted InventoryPool with hardCapacity and releasedCapacity equal to quantity, atomically with the new Offer."}},"required":["kind","countedDraft"],"additionalProperties":false}],"description":"One canonical ticket item. Ticket inventory may be an existing pool or exact staged units materialized atomically with the new Offer."}},"required":["price","visibility","presentation","salesWindows","purchaseLimits","clientRequestId","fulfillmentMode","action","item"],"additionalProperties":false},{"type":"object","properties":{"price":{"anyOf":[{"type":"object","properties":{"kind":{"const":"free"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","currency"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"The price of ONE Offer unit (one ticket). An order of q units pays amountMinor times q."},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","amountMinor","currency"],"additionalProperties":false}]},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"purchaseLimits":{"type":"object","properties":{"minimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["minimum","maximum"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128},"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"action":{"const":"create"},"item":{"anyOf":[{"type":"object","properties":{"kind":{"const":"reservation"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["kind","inventoryPoolId","resource"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId","sessionId"],"additionalProperties":false}],"description":"One canonical inventory-backed reservation or session item."}},"required":["price","visibility","presentation","salesWindows","purchaseLimits","clientRequestId","action","item"],"additionalProperties":false},{"type":"object","properties":{"price":{"anyOf":[{"type":"object","properties":{"kind":{"const":"free"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","currency"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"The price of ONE Offer unit (one ticket). An order of q units pays amountMinor times q."},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","amountMinor","currency"],"additionalProperties":false}]},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"purchaseLimits":{"type":"object","properties":{"minimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["minimum","maximum"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128},"fulfillmentMode":{"const":"ticketed"},"action":{"const":"update"},"item":{"type":"object","properties":{"kind":{"const":"ticket"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false,"description":"One existing canonical ticket item. Inventory generation is create-only."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"expectedOfferVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["price","visibility","presentation","salesWindows","purchaseLimits","clientRequestId","fulfillmentMode","action","item","offerId","expectedOfferVersion"],"additionalProperties":false},{"type":"object","properties":{"price":{"anyOf":[{"type":"object","properties":{"kind":{"const":"free"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","currency"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fixed"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"The price of ONE Offer unit (one ticket). An order of q units pays amountMinor times q."},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["kind","amountMinor","currency"],"additionalProperties":false}]},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"purchaseLimits":{"type":"object","properties":{"minimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"maximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"required":["minimum","maximum"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":128},"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"action":{"const":"update"},"item":{"anyOf":[{"type":"object","properties":{"kind":{"const":"reservation"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["kind","inventoryPoolId","resource"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId","sessionId"],"additionalProperties":false}],"description":"One existing canonical reservation or session item."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"expectedOfferVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["price","visibility","presentation","salesWindows","purchaseLimits","clientRequestId","action","item","offerId","expectedOfferVersion"],"additionalProperties":false}]},"example":{"action":"create","item":{"kind":"ticket","inventoryPoolId":"20000000-0000-4000-8000-000000000001"},"price":{"kind":"fixed","amountMinor":2500,"currency":"USD"},"fulfillmentMode":"ticketed","visibility":"visible","presentation":{"name":"General admission","description":null,"groupLabel":"Admission","badgeLabel":null,"sortOrder":0},"salesWindows":[{"kind":"public","startsAt":"2026-08-01T00:00:00.000Z","endsAt":"2026-08-31T00:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"scheduled","priority":0}],"purchaseLimits":{"minimum":1,"maximum":8},"clientRequestId":"configure-ticket-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"maxLength":128},"action":{"enum":["create","update"],"type":"string"},"itemKind":{"enum":["ticket","reservation","session"],"type":"string"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"inventoryCreation":{"anyOf":[{"type":"object","properties":{"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitIds":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["resourceTypeId","resourceUnitIds","inventoryPoolId","hardCapacity","releasedCapacity"],"additionalProperties":false},{"type":"object","properties":{"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["inventoryPoolId","hardCapacity","releasedCapacity"],"additionalProperties":false}]}},"required":["clientRequestId","action","itemKind","offerId","offerVersion"],"additionalProperties":false},"example":{"clientRequestId":"configure-ticket-001","action":"create","itemKind":"ticket","offerId":"30000000-0000-4000-8000-000000000001","offerVersion":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The Event, Offer, Session, Resource, or InventoryPool was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMMERCIAL_ITEM_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMMERCIAL_ITEM_REFERENCE_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The command conflicts with its prior idempotency key, Offer version, or commercial lifecycle.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMMERCIAL_ITEM_IDEMPOTENCY_CONFLICT","EVENT_COMMERCIAL_ITEM_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMMERCIAL_ITEM_CONFLICT","message":"Example"}}}}},"422":{"description":"The organizer-facing commercial item command is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMMERCIAL_ITEM_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMMERCIAL_ITEM_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/booking-intents/resolve":{"post":{"operationId":"bookingEventIntentResolve","summary":"Resolve event offers into booking intent","description":"Resolves exact event-offer versions into one shared, server-owned booking intent without creating a booking, hold, ticket, payment, or inventory claim. The service derives context, window, allocation, commercial snapshot, and stable intent lines; callers cannot override offer-controlled terms.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"selections":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"expectedOfferVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"resourceSelections":{"type":"array","items":{"type":"object","properties":{"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceUnitIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["requirementIndex","resourceUnitIds"],"additionalProperties":false},"default":[]}},"required":["offerId","expectedOfferVersion","quantity"],"additionalProperties":false},"description":"One to fifty unique Offer selections resolved as one canonical purchase intent."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time.","default":"web"},"clientRequestId":{"type":"string","minLength":1}},"required":["selections","clientRequestId"],"additionalProperties":false},"example":{"selections":[{"offerId":"20000000-0000-4000-8000-000000000001","expectedOfferVersion":1,"quantity":2}],"source":"web","clientRequestId":"intent-resolve-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Server-minted immutable booking-intent snapshot id."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"Service-owned canonical booking context projection."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Booking holder identity when known; null only while a held flow is collecting identity."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"clientRequestId":{"type":"string","minLength":1},"allocation":{"anyOf":[{"anyOf":[{"type":"object","properties":{"physicalTarget":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Individual resource unit to allocate, such as one table, room, seat, or court."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"Predefined combination of resource units that must be allocated together."}},"required":["kind","resourceCombinationId"],"additionalProperties":false}],"description":"Exactly one physical allocation target: a resource unit or a resource combination."},"inventoryPoolClaim":{"type":"object","properties":{"inventoryPoolId":{"type":"string","format":"uuid","description":"Counted-capacity inventory pool to claim."},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Positive quantity claimed from the pool."}},"required":["inventoryPoolId","quantity"],"additionalProperties":false,"description":"A counted-capacity claim materialized from the booking party or Offer demand."}},"additionalProperties":false,"description":"Inventory a booking intends to consume. Physical and counted-capacity claims may be used independently or together."},{"type":"object","properties":{"inventoryPoolClaims":{"type":"array","items":{"type":"object","properties":{"kind":{"const":"inventory_pool"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","intentLineId","requirementIndex","inventoryPoolId","quantity"],"additionalProperties":false},"default":[]},"physicalResourceClaims":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_unit"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","intentLineId","requirementIndex","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"requirementIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","intentLineId","requirementIndex","resourceCombinationId"],"additionalProperties":false}]},"default":[]}},"additionalProperties":false,"description":"Source-bound counted-capacity and exact physical-resource claims for every selected Event Offer requirement."}]},{"type":"null"}]},"finalizedQuoteSnapshotId":{"type":"string","format":"uuid","description":"Pinned commercial snapshot resolved from the selected offer versions."},"lines":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Server-minted stable intent-line id."},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_offer"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","eventId","offerId","offerVersion"],"additionalProperties":false}],"description":"Immutable commercial source that produced one normalized booking-intent line."},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"fulfillment":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}}},"required":["issuance","entitlementTemplates"],"additionalProperties":false,"description":"Immutable issuance and entitlement evidence copied from the accepted Offer version. Commitment never reloads mutable Offer fulfillment truth."}},"required":["id","source","quantity","fulfillment"],"additionalProperties":false}},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","window","partySize","source","clientRequestId","allocation","finalizedQuoteSnapshotId","lines","digest","expiresAt","createdAt"],"additionalProperties":false},"quote":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable finalized commercial quote snapshot; acceptance is separate evidence."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"sourceQuoteId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"bookingIntentDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"ratePlanVersionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"rateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"evaluatorVersions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."}},"factDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"lines":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"label":{"type":"string","minLength":1},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"ratePlanVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"rateComponentCode":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"policyDecisionReceiptId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"bookingIntentLineId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"default":null,"description":"Resolved booking-intent line attributed by this charge; null for whole-intent taxes, fees, or adjustments."}},"required":["code","label","effect","amount","ratePlanVersionId","rateComponentCode","policyDecisionReceiptId"],"additionalProperties":false}},"subtotal":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"adjustments":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]}},"required":["amount","behavior","category"],"additionalProperties":false},"total":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."}},"required":["id","organizationId","sourceQuoteId","bookingIntentDigest","contextId","customerId","ratePlanVersionIds","rateAssignmentIds","policyDecisionReceiptIds","evaluatorVersions","factDigest","lines","subtotal","adjustments","tax","total","rounding","expiresAt","createdAt","digest"],"additionalProperties":false},"replayed":{"type":"boolean"}},"required":["intent","quote","replayed"],"additionalProperties":false},"example":{"intent":{"id":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","organizationId":"11111111-1111-4111-8111-111111111111","contextId":"22222222-2222-4222-8222-222222222222","userId":null,"customerId":null,"window":{"startsAt":"2026-07-20T20:00:00.000Z","endsAt":"2026-07-20T22:00:00.000Z"},"partySize":1,"source":"web","clientRequestId":"intent-fixture-1","allocation":{"inventoryPoolClaim":{"inventoryPoolId":"66666666-6666-4666-8666-666666666666","quantity":1}},"finalizedQuoteSnapshotId":"44444444-4444-4444-8444-444444444444","lines":[{"id":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","source":{"kind":"event_offer","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":1},"quantity":1,"fulfillment":{"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":[]}]}}],"digest":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","expiresAt":"2026-07-20T20:15:00.000Z","createdAt":"2026-07-20T20:00:00.000Z"},"replayed":false,"quote":{"id":"44444444-4444-4444-8444-444444444444","organizationId":"11111111-1111-4111-8111-111111111111","sourceQuoteId":null,"bookingIntentDigest":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","contextId":"22222222-2222-4222-8222-222222222222","customerId":null,"ratePlanVersionIds":["55555555-5555-4555-8555-555555555555"],"rateAssignmentIds":["77777777-7777-4777-8777-777777777777"],"policyDecisionReceiptIds":[],"evaluatorVersions":[],"factDigest":"1111111111111111111111111111111111111111111111111111111111111111","lines":[{"code":"admission.bbbbbbbbbbbb4bbb8bbbbbbbbbbbbbbb","label":"Admission","effect":"charge","amount":{"amountMinor":8500,"currency":"USD"},"ratePlanVersionId":"55555555-5555-4555-8555-555555555555","rateComponentCode":"admission","policyDecisionReceiptId":null,"bookingIntentLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb"}],"subtotal":{"amountMinor":8500,"currency":"USD"},"adjustments":{"amountMinor":0,"currency":"USD"},"tax":{"amount":{"amountMinor":0,"currency":"USD"},"behavior":"unspecified","category":null},"total":{"amountMinor":8500,"currency":"USD"},"rounding":"half_up","expiresAt":"2026-07-20T20:15:00.000Z","createdAt":"2026-07-20T20:00:00.000Z","digest":"2222222222222222222222222222222222222222222222222222222222222222"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event or a selected offer was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND","EVENT_OFFER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The event is not bookable, an offer version/status conflicts, or clientRequestId conflicts. A not-ready refusal names its typed reason (EVENT_NOT_BOOKABLE, or EVENT_OFFER_NOT_ACTIVE for the offer's own status).","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_BOOKABLE","EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_NOT_ACTIVE","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1},"reason":{"type":"string","enum":["event_not_active","event_not_scheduled","event_started","sales_window_not_open","rate_plan_not_active","rate_plan_not_effective_yet","rate_plan_expired","payment_required","configuration_incomplete"]}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_BOOKABLE","message":"Example"}}}}},"422":{"description":"The event-offer selections are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INTENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INTENT_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers":{"post":{"operationId":"bookingEventOfferCreate","summary":"Create an event offer","description":"Creates a draft Offer and atomically creates its server-owned base RateAssignment from baseRatePlanVersionId. Free Offers still bind an exact zero-valued version. Names such as VIP are presentation labels only; typed inventory and grants define what the buyer receives.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercial":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Free still requires a real zero-valued RatePlanVersion."},"baseRatePlanVersionId":{"type":"string","format":"uuid","description":"Immutable RatePlanVersion used to atomically create the Offer's server-owned base RateAssignment."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Existing subject- or audience-qualified adjustment assignments."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Existing typed policy bindings evaluated for this Offer."}},"required":["commercialIntent","baseRatePlanVersionId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"clientRequestId":{"type":"string","minLength":1}},"required":["issuance","entitlementTemplates","visibility","presentation","inventoryRequirements","salesWindows","commercial","purchaseMinimum","purchaseMaximum","clientRequestId"],"additionalProperties":false},"example":{"visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercial":{"commercialIntent":"priced","baseRatePlanVersionId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"clientRequestId":"offer-create-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event or a referenced reserve, resource, rate assignment, policy binding, session, or zone was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND","EVENT_OFFER_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The clientRequestId was reused with a different offer body.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_IDEMPOTENCY_CONFLICT","message":"Example"}}}}},"422":{"description":"The typed event-offer body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventOfferList","summary":"List event offers","description":"Lists event offers in presentation order, including typed inventory, entitlement, and versioned commercial binding references.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"status","in":"query","schema":{"type":"array","items":{"enum":["draft","active","paused","retired"],"type":"string"},"description":"Offer lifecycle states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["active"]},{"name":"visibility","in":"query","schema":{"enum":["visible","hidden"],"type":"string","description":"Optional buyer-visibility filter."},"allowEmptyValue":true,"allowReserved":true,"example":"visible"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"offers":{"type":"array","items":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["offers","nextCursor"],"additionalProperties":false},"example":{"offers":[{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The offer filters or cursor are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/commercial":{"get":{"operationId":"bookingEventOfferCommercialList","summary":"List exact Event offer commercial projections","description":"Returns each Offer with its exact base RateAssignment, immutable RatePlanVersion, bounded inventory availability, and canonical readiness receipts. Resource and Session records never own price fields.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"status","in":"query","schema":{"type":"array","items":{"enum":["draft","active","paused","retired"],"type":"string"},"description":"Offer lifecycle states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["active"]},{"name":"visibility","in":"query","schema":{"enum":["visible","hidden"],"type":"string","description":"Optional buyer-visibility filter."},"allowEmptyValue":true,"allowReserved":true,"example":"visible"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"evaluatedAt":{"type":"string","format":"date-time"},"projections":{"type":"array","items":{"type":"object","properties":{"offer":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"baseRateAssignment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical RateAssignment UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the assignment and its referenced rate version."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Booking-owned object whose price is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Customer or audience scope eligible for the rate."},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"Assignment creation time."}},"required":["id","organizationId","version","ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"baseRatePlanVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"anyOf":[{},{},{},{},{},{}]},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{},{},{},{},{}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false},"inventoryPools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical InventoryPool UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the pool."},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase pool code unique within its typed owner."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Human-facing pool name."},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"Mounted canonical Event that owns the capacity."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is venue_schedule."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"contextId":{"type":"string","format":"uuid","description":"Mounted booking.bookable_context identity whose canonical kind is resource."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"Mounted ResourceType that owns pooled capacity."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"Mounted ResourceUnit that owns unique capacity."}},"required":["kind","resourceUnitId"],"additionalProperties":false}],"description":"Mounted capacity owner; existence and organization scope are verified at creation."},"hardCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Absolute capacity ceiling."},"releasedCapacity":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Capacity released for claims. It cannot exceed hardCapacity."},"heldCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in unexpired held claims."},"committedCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Quantity in committed claims."},"availableCount":{"type":"integer","minimum":0,"maximum":2147483647,"description":"releasedCapacity minus heldCount and committedCount."},"status":{"enum":["active","paused","retired"],"type":"string","description":"Pool lifecycle: active accepts holds, paused/retired do not."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version; every capacity-affecting mutation increments it."},"countsAsOf":{"type":"string","format":"date-time","description":"Time the returned capacity counters were computed."},"createdAt":{"type":"string","format":"date-time","description":"Pool creation time."},"updatedAt":{"type":"string","format":"date-time","description":"Time the current pool version was written."}},"required":["id","organizationId","code","name","owner","hardCapacity","releasedCapacity","heldCount","committedCount","availableCount","status","version","countsAsOf","createdAt","updatedAt"],"additionalProperties":false}},"availableOfferUnits":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"readiness":{"type":"object","properties":{"commercial":{"anyOf":[{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"ready"}},"required":["kind","rateAssignmentId","ratePlanVersionId","organizationId","eventId","offerId","evaluatedAt","status"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"rate_assignment"},"rateAssignmentId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"blocked"},"reason":{"enum":["not_found","wrong_organization","target_mismatch","not_effective","source_unavailable","evaluator_unavailable"],"type":"string"}},"required":["kind","rateAssignmentId","ratePlanVersionId","organizationId","eventId","offerId","evaluatedAt","status","reason"],"additionalProperties":false}]},"inventory":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"ready"}},"required":["kind","inventoryPoolId","organizationId","eventId","offerId","evaluatedAt","status"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"blocked"},"reason":{"enum":["not_found","wrong_organization","target_mismatch","source_unavailable","disabled"],"type":"string"}},"required":["kind","inventoryPoolId","organizationId","eventId","offerId","evaluatedAt","status","reason"],"additionalProperties":false}]},{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"ready"}},"required":["kind","resourceTypeId","organizationId","eventId","offerId","evaluatedAt","status"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"blocked"},"reason":{"enum":["not_found","wrong_organization","target_mismatch","source_unavailable","disabled"],"type":"string"}},"required":["kind","resourceTypeId","organizationId","eventId","offerId","evaluatedAt","status","reason"],"additionalProperties":false}]},{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"ready"}},"required":["kind","resourceUnitId","organizationId","eventId","offerId","evaluatedAt","status"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"blocked"},"reason":{"enum":["not_found","wrong_organization","target_mismatch","source_unavailable","disabled"],"type":"string"}},"required":["kind","resourceUnitId","organizationId","eventId","offerId","evaluatedAt","status","reason"],"additionalProperties":false}]},{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"ready"}},"required":["kind","resourceCombinationId","organizationId","eventId","offerId","evaluatedAt","status"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"const":"blocked"},"reason":{"enum":["not_found","wrong_organization","target_mismatch","source_unavailable","disabled"],"type":"string"}},"required":["kind","resourceCombinationId","organizationId","eventId","offerId","evaluatedAt","status","reason"],"additionalProperties":false}]}]}}},"required":["commercial","inventory"],"additionalProperties":false}},"required":["offer","baseRateAssignment","baseRatePlanVersion","inventoryPools","availableOfferUnits","readiness"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"queryEvidence":{"type":"object","properties":{"statementCount":{"type":"integer","minimum":1,"maximum":2},"bound":{"const":2}},"required":["statementCount","bound"],"additionalProperties":false}},"required":["evaluatedAt","projections","nextCursor","queryEvidence"],"additionalProperties":false},"example":{"evaluatedAt":"2026-08-05T12:00:00.000Z","projections":[{"offer":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"active","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1},"baseRateAssignment":{"id":"20000000-0000-4000-8000-000000000005","organizationId":"10000000-0000-4000-8000-000000000002","version":1,"ratePlanVersionId":"33333333-3333-4333-8333-333333333334","target":{"kind":"offer","offerId":"20000000-0000-4000-8000-000000000001"},"subject":{"kind":"everyone"},"purpose":"base","priority":0,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-17T12:05:00.000Z"},"baseRatePlanVersion":{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"10000000-0000-4000-8000-000000000002","version":2,"status":"active","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"per_quantity","code":"ticket","label":"General admission","effect":"charge","unit":"ticket","unitAmount":{"amountMinor":2500,"currency":"USD"},"minimumQuantity":0,"maximumQuantity":null}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"},"inventoryPools":[{"id":"20000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","code":"general_admission","name":"General admission","owner":{"kind":"event","eventId":"10000000-0000-4000-8000-000000000001"},"hardCapacity":500,"releasedCapacity":300,"heldCount":10,"committedCount":90,"availableCount":200,"status":"active","version":4,"countsAsOf":"2026-08-05T12:00:00.000Z","createdAt":"2026-07-19T12:00:00.000Z","updatedAt":"2026-07-19T14:00:00.000Z"}],"availableOfferUnits":200,"readiness":{"commercial":{"kind":"rate_assignment","rateAssignmentId":"20000000-0000-4000-8000-000000000005","ratePlanVersionId":"33333333-3333-4333-8333-333333333334","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","offerId":"20000000-0000-4000-8000-000000000001","evaluatedAt":"2026-08-05T12:00:00.000Z","status":"ready"},"inventory":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","offerId":"20000000-0000-4000-8000-000000000001","evaluatedAt":"2026-08-05T12:00:00.000Z","status":"ready"}]}}],"nextCursor":null,"queryEvidence":{"statementCount":2,"bound":2}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"At least one Offer does not have an exact base RateAssignment and RatePlanVersion projection.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_COMMERCIAL_NOT_READY"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_COMMERCIAL_NOT_READY","message":"Example"}}}}},"422":{"description":"The offer filters or cursor are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/{offerId}":{"get":{"operationId":"bookingEventOfferGet","summary":"Get an event offer","description":"Returns one offer. Rate and policy behavior remains enforceable because references point to typed assignments and bindings, not free-form JSON.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event offer was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The Event or Offer identifier is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"patch":{"operationId":"bookingEventOfferUpdate","summary":"Update an event offer","description":"Updates a draft or paused offer. Adoption must merge the patch into the current record and parse the complete BookingEventOfferRecordSchema before mutation so cross-field purchase limits remain enforced. Changes that would alter an issued ticket require a new offer or commercial version rather than mutating historical grants.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"patch":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercial":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Free still requires a real zero-valued RatePlanVersion."},"baseRatePlanVersionId":{"type":"string","format":"uuid","description":"Immutable RatePlanVersion used to atomically create the Offer's server-owned base RateAssignment."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Existing subject- or audience-qualified adjustment assignments."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Existing typed policy bindings evaluated for this Offer."}},"required":["commercialIntent","baseRatePlanVersionId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]}},"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1}},"required":["expectedVersion","patch","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"patch":{"visibility":"hidden"},"clientRequestId":"offer-update-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event offer or a referenced booking object was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND","EVENT_OFFER_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The offer version conflicts, issued-grant fields are immutable, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_IMMUTABLE","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The typed event-offer patch is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_PATCH_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_PATCH_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/{offerId}/base-price":{"post":{"operationId":"bookingEventOfferBasePriceUpdate","summary":"Update an event offer base price","description":"Creates a new immutable base RatePlanVersion and rotates the Offer's base RateAssignment without changing any non-price Offer behavior. Currency and commercial metadata derive from the current authoritative version.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedOfferVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"price":{"anyOf":[{"type":"object","properties":{"kind":{"const":"free"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"fixed"},"amountMinor":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The price of ONE Offer unit (one ticket). An order of q units pays amountMinor times q."}},"required":["kind","amountMinor"],"additionalProperties":false}]},"clientRequestId":{"type":"string","minLength":1,"maxLength":128}},"required":["expectedOfferVersion","price","clientRequestId"],"additionalProperties":false},"example":{"expectedOfferVersion":1,"price":{"kind":"fixed","amountMinor":4750},"clientRequestId":"offer-base-price-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"maxLength":128},"offer":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"baseRateAssignment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Canonical RateAssignment UUID."},"organizationId":{"type":"string","format":"uuid","description":"Organization that owns the assignment and its referenced rate version."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Assignment revision used for compare-and-swap."},"ratePlanVersionId":{"type":"string","format":"uuid","description":"Pinned immutable rate-plan version."},"target":{"anyOf":[{"type":"object","properties":{"kind":{"const":"platform"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"space"},"spaceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","spaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"context"},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","contextId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"venue_schedule"},"venueScheduleId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","venueScheduleId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceCombinationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","inventoryPoolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"offer"},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","offerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"hold"},"holdId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","holdId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"booking"},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","bookingId"],"additionalProperties":false}],"description":"Booking-owned object whose price is configured."},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"everyone"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"audience"},"audienceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","audienceId"],"additionalProperties":false}],"description":"Customer or audience scope eligible for the rate."},"purpose":{"enum":["base","adjustment"],"type":"string","description":"Base supplies the mandatory starting price; adjustment modifies a resolved base for an eligible subject."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"default":0,"description":"Deterministic precedence; higher-priority compatible assignments resolve first."},"stacking":{"enum":["exclusive","stack","best_price"],"type":"string","description":"How this assignment combines with overlapping eligible assignments. Base assignments must be exclusive."},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"createdAt":{"type":"string","format":"date-time","description":"Assignment creation time."}},"required":["id","organizationId","version","ratePlanVersionId","target","subject","purpose","stacking","effectiveFrom","effectiveUntil","createdAt"],"additionalProperties":false},"baseRatePlanVersion":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable rate-plan version id."},"ratePlanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Immutable version number."},"status":{"enum":["draft","active","retired"],"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."},"tax":{"type":"object","properties":{"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."}},"required":["behavior","category"],"additionalProperties":false},"components":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"fixed"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false,"description":"The price of ONE purchased unit (one Event Offer unit). A quote line of quantity q charges amount times q."}},"required":["kind","code","label","effect","amount"],"additionalProperties":false,"description":"A fixed per-unit amount: the Event Offer base price authoring writes. Charged once per purchased unit, never once per order."},{"type":"object","properties":{"kind":{"const":"per_quantity"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"minimumQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"maximumQuantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"default":null}},"required":["kind","code","label","effect","unit","unitAmount"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"percentage"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":1000000,"exclusiveMinimum":0},"basis":{"anyOf":[{"type":"object","properties":{"kind":{"const":"base"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"subtotal"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"components"},"componentCodes":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["kind","componentCodes"],"additionalProperties":false}]},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"}},"required":["kind","code","label","effect","basisPoints","basis","rounding"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tiered"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"mode":{"enum":["volume","graduated"],"type":"string"},"unit":{"enum":["person","ticket","unit","hour","night"],"type":"string"},"tiers":{"type":"array","minItems":1,"items":{"type":"object","properties":{"upTo":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"Inclusive upper bound; null means unbounded."},"unitAmount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false}},"required":["upTo","unitAmount"],"additionalProperties":false}}},"required":["kind","code","label","effect","mode","unit","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"registered_extension"},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable quote-line component code."},"label":{"type":"string","minLength":1,"description":"Human-readable component label."},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"incidence":{"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","properties":{"party":{"enum":["customer","organization","platform"],"type":"string"},"basisPoints":{"type":"integer","minimum":-9007199254740991,"maximum":10000,"exclusiveMinimum":0}},"required":["party","basisPoints"],"additionalProperties":false},"description":"Declarative allocation of economic burden; does not select a payer, remitter, provider, or payment execution path."},"evaluator":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."},"configuration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]},"description":"Declarative JSON validated by the exact registered evaluator schema; never executable code."},"output":{"const":"quote_lines"},"minimumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]},"maximumResult":{"anyOf":[{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","code","label","effect","evaluator","configuration","output","minimumResult","maximumResult"],"additionalProperties":false}],"description":"Closed, typed pricing component or an exactly registered extension."}},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"Inclusive instant when this versioned commercial binding begins to apply."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Exclusive instant when the binding stops applying; null means open-ended."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","ratePlanId","organizationId","version","status","currency","tax","components","rounding","effectiveFrom","effectiveUntil","digest","createdAt"],"additionalProperties":false}},"required":["clientRequestId","offer","baseRateAssignment","baseRatePlanVersion"],"additionalProperties":false},"example":{"clientRequestId":"offer-base-price-001","offer":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"paused","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":2},"baseRateAssignment":{"id":"20000000-0000-4000-8000-000000000005","organizationId":"10000000-0000-4000-8000-000000000002","version":1,"ratePlanVersionId":"33333333-3333-4333-8333-333333333334","target":{"kind":"offer","offerId":"20000000-0000-4000-8000-000000000001"},"subject":{"kind":"everyone"},"purpose":"base","priority":0,"stacking":"exclusive","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"createdAt":"2026-07-17T12:05:00.000Z"},"baseRatePlanVersion":{"id":"33333333-3333-4333-8333-333333333334","ratePlanId":"22222222-2222-4222-8222-222222222222","organizationId":"10000000-0000-4000-8000-000000000002","version":2,"status":"active","currency":"USD","tax":{"behavior":"unspecified","category":null},"components":[{"kind":"fixed","code":"base-price","label":"Base price","effect":"charge","amount":{"amountMinor":4750,"currency":"USD"}}],"rounding":"half_up","effectiveFrom":"2026-08-01T12:00:00.000Z","effectiveUntil":null,"digest":"6f0a8e5006baa6ec54a54f8f050896d6c0de6d9e71003e5bfe3254eceedab932","createdAt":"2026-08-01T12:00:00.000Z"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event offer was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The Offer version conflicts, its current base pricing lineage cannot be rotated, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_IMMUTABLE","EVENT_OFFER_BASE_PRICE_UNSUPPORTED","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The strict base-price request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_BASE_PRICE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_BASE_PRICE_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/{offerId}/duplicate":{"post":{"operationId":"bookingEventOfferDuplicate","summary":"Duplicate an event offer","description":"Creates a new hidden draft from an exact source Offer version. Presentation, inventory requirements, sales-window configuration, issuance, entitlements, base RatePlanVersion, and purchase limits copy; lifecycle state, buyer visibility, sales-window state, source-targeted adjustments, and policy bindings reset. Existing source orders, Tickets, assignments, and commercial snapshots are never changed.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedSourceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"name":{"type":"string","minLength":1,"maxLength":100},"clientRequestId":{"type":"string","minLength":1}},"required":["expectedSourceVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedSourceVersion":1,"name":"VIP late release","clientRequestId":"offer-duplicate-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["offerId","offerVersion"],"additionalProperties":false},"offer":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"copiedFields":{"type":"array","prefixItems":[{"const":"presentation"},{"const":"inventoryRequirements"},{"const":"salesWindows"},{"const":"fulfillmentMode"},{"const":"issuance"},{"const":"entitlementTemplates"},{"const":"baseRatePlanVersion"},{"const":"purchaseLimits"}]},"reset":{"type":"object","properties":{"lifecycle":{"const":"draft"},"visibility":{"const":"hidden"},"salesWindows":{"const":"scheduled"},"adjustmentRateAssignments":{"const":"cleared"},"policyBindings":{"const":"cleared"}},"required":["lifecycle","visibility","salesWindows","adjustmentRateAssignments","policyBindings"],"additionalProperties":false},"replayed":{"type":"boolean"}},"required":["source","offer","copiedFields","reset","replayed"],"additionalProperties":false},"example":{"source":{"offerId":"20000000-0000-4000-8000-000000000001","offerVersion":1},"offer":{"id":"20000000-0000-4000-8000-000000000011","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"hidden","presentation":{"name":"VIP late release","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"scheduled","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000012","adjustmentRateAssignmentIds":[],"policyBindingIds":[]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-26T12:05:00.000Z","updatedAt":"2026-07-26T12:05:00.000Z","version":1},"copiedFields":["presentation","inventoryRequirements","salesWindows","fulfillmentMode","issuance","entitlementTemplates","baseRatePlanVersion","purchaseLimits"],"reset":{"lifecycle":"draft","visibility":"hidden","salesWindows":"scheduled","adjustmentRateAssignments":"cleared","policyBindings":"cleared"},"replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The source event offer was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The source version conflicts, its commercial evidence cannot be reused, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_DUPLICATE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The strict Offer duplicate request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_DUPLICATE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_DUPLICATE_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/{offerId}/activate":{"post":{"operationId":"bookingEventOfferActivate","summary":"Activate an event offer","description":"Moves a draft or paused offer to active only after every referenced inventory pool/resource, rate assignment, policy binding, session, and access zone validates in the same organization and event.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"offer-activate-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event offer or an activation dependency was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND","EVENT_OFFER_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The offer version conflicts or activation validation failed.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_ACTIVATION_BLOCKED","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The strict Offer activation request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_LIFECYCLE_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/{offerId}/pause":{"post":{"operationId":"bookingEventOfferPause","summary":"Pause an event offer","description":"Stops new purchase attempts without revoking already-issued tickets or their immutable grant snapshots.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"offer-pause-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event offer was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The offer version conflicts or the offer cannot transition to paused.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The strict Offer pause request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_LIFECYCLE_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/offers/{offerId}/retire":{"post":{"operationId":"bookingEventOfferRetire","summary":"Retire an event offer","description":"Permanently retires an offer from future sale. Historical bookings, tickets, quote snapshots, and policy receipts remain addressable.","tags":["booking-event-offers"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"offer-retire-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fulfillmentMode":{"enum":["ticketed","booking_only"],"type":"string","default":"ticketed"},"issuance":{"anyOf":[{"type":"object","properties":{"ticketsPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"grantsPerEntitlementTemplatePerTicket":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1},"attendeeAssignment":{"enum":["optional","required_before_issuance","required_before_use"],"type":"string","default":"optional"}},"additionalProperties":false},{"type":"null"}]},"entitlementTemplates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_entry"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","zoneId","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["kind","eligibleSessionIds","minimumSelections","maximumSelections","label","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"session_access"},"sessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","sessionIds","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","resource","label","consumption","policyBindingIds"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"access_point_access"},"accessPointIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional earliest time this entitlement may authorize access."},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"default":null,"description":"Optional exclusive end of this entitlement's access window."},"label":{"type":"string","minLength":1},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Policy bindings evaluated when this entitlement is authorized or consumed."}},"required":["kind","accessPointIds","label","consumption","policyBindingIds"],"additionalProperties":false}],"description":"Access capability materialized onto each issued Ticket. session_access.sessionIds and session_selection.eligibleSessionIds are the sole Session eligibility authority; Session records carry no inverse Offer list. VIP is presentation only and never a discriminator."}},"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"visibility":{"enum":["visible","hidden"],"type":"string"},"presentation":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"groupLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"badgeLabel":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","description","groupLabel","badgeLabel","sortOrder"],"additionalProperties":false},"inventoryRequirements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"inventory_pool"},"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","inventoryPoolId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"selection":{"enum":["automatic","customer"],"type":"string"}},"required":["kind","resourceTypeId","quantityPerOfferUnit","selection"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceUnitId","quantityPerOfferUnit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_combination"},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quantityPerOfferUnit":{"const":1}},"required":["kind","resourceCombinationId","quantityPerOfferUnit"],"additionalProperties":false}],"description":"Finite inventory required per purchased offer unit. Inventory pools provide counted capacity; resources provide typed or exact physical inventory. Empty requirements mean the offer grants access without consuming finite inventory."}},"salesWindows":{"type":"array","minItems":1,"items":{"type":"object","properties":{"kind":{"enum":["public","presale","private"],"type":"string"},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"eligibilityPolicyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"status":{"enum":["scheduled","open","closed","cancelled"],"type":"string","description":"Organizer intent. scheduled and open both sell inside [startsAt, endsAt) with no further write; closed and cancelled never sell. The Offer's effectiveState gives the state at server time."},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","startsAt","endsAt","timezone","eligibilityPolicyBindingIds","status","priority"],"additionalProperties":false}},"commercialBinding":{"type":"object","properties":{"commercialIntent":{"enum":["free","priced"],"type":"string","description":"Organizer intent for the base price. Both variants require a base assignment; free must resolve to an exact zero-total base version before activation."},"baseRateAssignmentId":{"type":"string","format":"uuid","description":"Required base RateAssignment targeting this Offer and pinning one immutable RatePlanVersion."},"adjustmentRateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Optional subject- or audience-qualified adjustment assignments evaluated after the base assignment without mutating the Offer."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Typed policy bindings targeting this offer. Each binding pins a policy version or policy-set version and lifecycle hooks."}},"required":["commercialIntent","baseRateAssignmentId","adjustmentRateAssignmentIds","policyBindingIds"],"additionalProperties":false},"purchaseMinimum":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"purchaseMaximum":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"seatmapVersionId":{"type":"string","format":"uuid","description":"The attached published seat-map version; it does not follow a republish."},"seatmapSeatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Seat count of the attached seat-map version."},"effectiveState":{"enum":["upcoming","open","ended","closed","cancelled"],"type":"string","description":"Output only, computed at server time from salesWindows, independent of the Offer's own status. open: a scheduled or open window contains now. upcoming: none does, and one starts later. ended: every scheduled or open window has ended. closed: no window can sell and at least one is closed. cancelled: every window is cancelled. A buyer is sold only while status is active and effectiveState is open."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["issuance","entitlementTemplates","id","organizationId","eventId","status","visibility","presentation","inventoryRequirements","salesWindows","commercialBinding","purchaseMinimum","purchaseMaximum","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","status":"draft","visibility":"visible","presentation":{"name":"VIP","description":"Admission plus green-room access and one selected session.","groupLabel":"Admission","badgeLabel":"VIP","sortOrder":20},"inventoryRequirements":[{"kind":"inventory_pool","inventoryPoolId":"20000000-0000-4000-8000-000000000002","quantityPerOfferUnit":1}],"salesWindows":[{"kind":"public","startsAt":"2026-07-17T12:05:00.000Z","endsAt":"2026-08-15T20:00:00.000Z","timezone":"America/New_York","eligibilityPolicyBindingIds":[],"status":"open","priority":100}],"issuance":{"ticketsPerOfferUnit":1,"grantsPerEntitlementTemplatePerTicket":1,"attendeeAssignment":"optional"},"entitlementTemplates":[{"kind":"event_entry","label":"Venue admission","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},{"kind":"zone_access","zoneId":"20000000-0000-4000-8000-000000000003","label":"Green room","consumption":{"mode":"metered","maximumUses":4,"counterScope":"access_point","reset":"never"},"policyBindingIds":[]},{"kind":"session_selection","eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"label":"Choose one session","policyBindingIds":[]}],"commercialBinding":{"commercialIntent":"priced","baseRateAssignmentId":"20000000-0000-4000-8000-000000000005","adjustmentRateAssignmentIds":[],"policyBindingIds":["20000000-0000-4000-8000-000000000006"]},"purchaseMinimum":1,"purchaseMaximum":4,"createdAt":"2026-07-17T12:05:00.000Z","updatedAt":"2026-07-17T12:05:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event offer was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The offer version conflicts or the offer cannot transition to retired.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_VERSION_CONFLICT","EVENT_OFFER_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The strict Offer retirement request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_OFFER_LIFECYCLE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_OFFER_LIFECYCLE_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/tickets/own":{"get":{"operationId":"bookingEventTicketListOwn","summary":"List my tickets","description":"Lists tickets owned by the identity.person derived from the authenticated session. Caller-supplied owner identifiers are not accepted.","tags":["booking-event-tickets"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"eventId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"enum":["active","revoked","expired","voided"],"type":"string","description":"Optional ticket lifecycle filter."},"allowEmptyValue":true,"allowReserved":true,"example":"active"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["tickets","nextCursor"],"additionalProperties":false},"example":{"tickets":[],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"422":{"description":"The ticket filters or cursor are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/tickets":{"get":{"operationId":"bookingEventTicketList","summary":"List event tickets","description":"Lists single-admission ticket records for an event. The buyer booking/line and attending person are separate fields so purchase ownership is never inferred from attendee metadata.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"offerId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true,"example":"20000000-0000-4000-8000-000000000001"},{"name":"status","in":"query","schema":{"enum":["active","revoked","expired","voided"],"type":"string","description":"Optional ticket lifecycle filter."},"allowEmptyValue":true,"allowReserved":true,"example":"active"},{"name":"attendeeIdentityId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true},{"name":"buyerBookingId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["tickets","nextCursor"],"additionalProperties":false},"example":{"tickets":[],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The ticket filters or cursor are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/tickets/{ticketId}":{"get":{"operationId":"bookingEventTicketGet","summary":"Get an event ticket","description":"Returns one ticket with its buyer chain, attendee assignment, and concrete entitlement grants. A ticket is a credential; a booking party member is not.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000003"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false},"example":{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","buyerBookingLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","ownerPersonId":null,"attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":"2026-07-20T19:00:00.000Z","validUntil":"2026-07-20T22:00:00.000Z","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["55555555-5555-4555-8555-555555555555"],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"}],"version":1,"issuedAt":"2026-07-20T20:00:00.000Z","updatedAt":"2026-07-20T20:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event ticket was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The Event or Ticket identifier is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/complimentary-tickets":{"post":{"operationId":"bookingEventTicketIssueComplimentary","summary":"Issue complimentary tickets","description":"Issues one zero-price Ticket per recipient through the canonical Offer, inventory, Booking, and Ticket rails, on any active Offer (a priced tier is discounted to zero on that tier). Existing Identity persons become owners; a contact recipient is refused 400 EVENT_COMPLIMENTARY_RECIPIENT_UNSUPPORTED (send it with bookingEventTicketSendComplimentary, which owes the delivery). No Payment attempt or provider execution is created, and communications remain a separate concern.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"expectedOfferVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"recipients":{"type":"array","minItems":1,"maxItems":50,"items":{"anyOf":[{"type":"object","properties":{"kind":{"const":"person"},"personId":{"type":"string","format":"uuid","description":"Existing organization-scoped Sonik Identity person."}},"required":["kind","personId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"contact"},"contact":{"anyOf":[{"type":"object","properties":{"kind":{"const":"email"},"normalizedEmail":{"type":"string","description":"Normalized lower-case email evidence."}},"required":["kind","normalizedEmail"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"phone"},"e164Phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$","description":"E.164 phone evidence."}},"required":["kind","e164Phone"],"additionalProperties":false}]},"displayName":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","contact"],"additionalProperties":false}]},"description":"One complimentary Ticket owner per recipient. A contact recipient is refused 400 EVENT_COMPLIMENTARY_RECIPIENT_UNSUPPORTED: send to a phone or an email with bookingEventTicketSendComplimentary."},"reason":{"type":"string","minLength":1,"maxLength":500},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["offerId","expectedOfferVersion","recipients","reason","clientRequestId"],"additionalProperties":false},"example":{"offerId":"33333333-3333-4333-8333-333333333333","expectedOfferVersion":3,"recipients":[{"kind":"person","personId":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee"}],"reason":"Organizer guest list","clientRequestId":"complimentary-issue-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false}},"receipt":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"buyerBookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actorPrincipalId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"recipientCount":{"type":"integer","minimum":1,"maximum":50},"ticketIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"reason":{"type":"string","minLength":1,"maxLength":500},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"requestDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","actorPrincipalId","recipientCount","ticketIds","reason","clientRequestId","requestDigest","issuedAt"],"additionalProperties":false},"replayed":{"type":"boolean"}},"required":["tickets","receipt","replayed"],"additionalProperties":false},"example":{"tickets":[{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","buyerBookingLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","ownerPersonId":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","attendee":null,"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":null,"validUntil":null,"consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":[],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"}],"version":1,"issuedAt":"2026-07-26T12:00:00.000Z","updatedAt":"2026-07-26T12:00:00.000Z"}],"receipt":{"id":"66666666-6666-4666-8666-666666666666","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","actorPrincipalId":"77777777-7777-4777-8777-777777777777","recipientCount":1,"ticketIds":["99999999-9999-4999-8999-999999999999"],"reason":"Organizer guest list","clientRequestId":"complimentary-issue-001","requestDigest":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","issuedAt":"2026-07-26T12:00:00.000Z"},"replayed":false}}}},"400":{"description":"A contact recipient is not issued on this door: send comp tickets to a phone or an email with bookingEventTicketSendComplimentary (POST /api/v1/booking/events/{eventId}/complimentary-sends). Nothing was written.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_RECIPIENT_UNSUPPORTED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_RECIPIENT_UNSUPPORTED","message":"A contact recipient is not issued here: send comp tickets to a phone or an email with bookingEventTicketSendComplimentary (POST /api/v1/booking/events/{eventId}/complimentary-sends)"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot issue complimentary Tickets.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_FORBIDDEN"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_FORBIDDEN","message":"The actor cannot issue complimentary Tickets"}}}}},"404":{"description":"The Event, Offer, or recipient person was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_NOT_FOUND","message":"Event, Offer, or recipient not found"}}}}},"409":{"description":"The Offer, inventory, or clientRequestId conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_CONFLICT","message":"Offer, inventory, or idempotency state changed"}}}}},"422":{"description":"The complimentary issuance body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_INPUT_INVALID","message":"Complimentary issuance input is invalid"}}}}},"503":{"description":"The Identity authority required to resolve a person recipient is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_UNAVAILABLE","message":"Complimentary issuance authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/complimentary-sends":{"post":{"operationId":"bookingEventTicketSendComplimentary","summary":"Send comp tickets","description":"Issues 1-10 Tickets on any active Offer to one recipient under one zero-value comp order on that tier (a priced tier keeps its list price on the quote and a discount takes it to 0), links or creates the organizer's customer row (phone first, then email), and owes the delivery: the ticket email (QR codes) when an email is given, the WhatsApp ticket message when a phone is given and WhatsApp ticket messages are on (an operational template with the hosted ticket link, never consent-gated). No Payment, no Identity hop.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"Any active Offer (tier) of this Event. A priced tier is comped at zero on that tier: the order records the tier's list price and a discount to 0."},"expectedOfferVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"quantity":{"type":"integer","minimum":1,"maximum":10},"recipient":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$","description":"E.164 phone. The WhatsApp ticket message goes to it while WhatsApp ticket messages are on: an operational template, never gated on a checkout code or marketing consent."},"email":{"type":"string","maxLength":254,"description":"The address the ticket email goes to: every ticket's QR, and the hosted ticket link when a phone is given too (the link opens after that phone's code)."},"name":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"note":{"type":"string","minLength":1,"maxLength":500},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["offerId","expectedOfferVersion","quantity","recipient","clientRequestId"],"additionalProperties":false},"example":{"offerId":"33333333-3333-4333-8333-333333333333","expectedOfferVersion":3,"quantity":2,"recipient":{"phone":"+573001234567","email":"guest@example.com","name":"Ana Gómez"},"note":"Artist guest list","clientRequestId":"complimentary-send-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"The comp order (a Booking with a zero quote total)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketIds":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The organizer's customer row for the recipient, matched by phone then email, else created; null when none could be written."},"deliveries":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"object","properties":{"channel":{"enum":["email","whatsapp"],"type":"string"},"status":{"enum":["pending","skipped"],"type":"string","description":"pending: the delivery drain sends it on its next tick. skipped: nothing is sent on this channel; reason says why."},"commandId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The durable communications command; null when none was written (WhatsApp ticket messages are off)."},"reason":{"anyOf":[{"enum":["whatsapp_off","phone_not_verified"],"type":"string"},{"type":"null"}],"description":"whatsapp_off: WhatsApp ticket messages are switched off. phone_not_verified: only on a replay of a send recorded before 2026-10-30, when WhatsApp went only to phones that had passed a checkout code; never written now."}},"required":["channel","status","commandId","reason"],"additionalProperties":false}},"note":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"actorPrincipalId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"replayed":{"type":"boolean"}},"required":["orderId","eventId","offerId","ticketIds","customerId","deliveries","note","actorPrincipalId","clientRequestId","issuedAt","replayed"],"additionalProperties":false},"example":{"orderId":"44444444-4444-4444-8444-444444444444","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","ticketIds":["55555555-5555-4555-8555-555555555555","66666666-6666-4666-8666-666666666666"],"customerId":"88888888-8888-4888-8888-888888888888","deliveries":[{"channel":"email","status":"pending","commandId":"99999999-9999-4999-8999-999999999999","reason":null},{"channel":"whatsapp","status":"pending","commandId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","reason":null}],"note":"Artist guest list","actorPrincipalId":"77777777-7777-4777-8777-777777777777","clientRequestId":"complimentary-send-001","issuedAt":"2026-10-29T17:00:00.000Z","replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot send comp tickets.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_FORBIDDEN"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_FORBIDDEN","message":"The actor cannot send comp tickets"}}}}},"404":{"description":"The Event or Offer was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_NOT_FOUND","message":"Event or Offer not found"}}}}},"409":{"description":"CONFLICT: the Offer is sold out, not on sale, changed version, or the clientRequestId was used for another send. UNDELIVERABLE: no email was given and WhatsApp ticket messages are off, so nothing could reach the recipient; nothing was issued.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_CONFLICT","EVENT_COMPLIMENTARY_UNDELIVERABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_CONFLICT","message":"clientRequestId complimentary-send-001 is already bound to another Event purchase command"}}}}},"422":{"description":"The comp send body is invalid: a phone or an email is required, quantity is 1-10.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_INPUT_INVALID","message":"A phone or an email is required"}}}}},"503":{"description":"The organizer authority for comp sends is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_COMPLIMENTARY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_COMPLIMENTARY_UNAVAILABLE","message":"Event complimentary authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/tickets/{ticketId}/attendee":{"post":{"operationId":"bookingEventTicketAssignAttendee","summary":"Assign an attendee","description":"Assigns the person expected to attend while preserving the original buyer booking and booking line. Assignment alone does not transfer commercial ownership.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000003"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attendee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["attendee","expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"expectedVersion":1,"clientRequestId":"attendee-assign-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"action":{"enum":["assign","clear"],"type":"string"},"previousAttendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"actorPrincipalId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"versionBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"versionAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","ticketId","action","previousAttendee","attendee","reason","actorPrincipalId","clientRequestId","versionBefore","versionAfter","createdAt"],"additionalProperties":false},"replayed":{"type":"boolean"}},"required":["ticket","receipt","replayed"],"additionalProperties":false},"example":{"ticket":{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","buyerBookingLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","ownerPersonId":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":"2026-07-20T19:00:00.000Z","validUntil":"2026-07-20T22:00:00.000Z","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["55555555-5555-4555-8555-555555555555"],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"}],"version":2,"issuedAt":"2026-07-20T20:00:00.000Z","updatedAt":"2026-07-20T20:05:00.000Z"},"receipt":{"id":"66666666-6666-4666-8666-666666666666","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","ticketId":"99999999-9999-4999-8999-999999999999","action":"assign","previousAttendee":null,"attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"reason":null,"actorPrincipalId":"77777777-7777-4777-8777-777777777777","clientRequestId":"attendee-assign-001","versionBefore":1,"versionAfter":2,"createdAt":"2026-07-20T20:05:00.000Z"},"replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage Event attendees.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The event ticket or attendee identity was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND","EVENT_ATTENDEE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The ticket version, assignment state, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_VERSION_CONFLICT","EVENT_TICKET_ASSIGNMENT_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The attendee assignment body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ATTENDEE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ATTENDEE_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The attendee authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ATTENDEE_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ATTENDEE_UNAVAILABLE","message":"The attendee authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"delete":{"operationId":"bookingEventTicketClearAttendee","summary":"Clear an attendee assignment","description":"Clears attendee assignment with an auditable reason. It does not cancel the ticket, refund the booking, or alter the buyer chain.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000003"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["reason","expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"reason":"Attendee changed plans.","expectedVersion":1,"clientRequestId":"attendee-clear-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"action":{"enum":["assign","clear"],"type":"string"},"previousAttendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"actorPrincipalId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"versionBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"versionAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","ticketId","action","previousAttendee","attendee","reason","actorPrincipalId","clientRequestId","versionBefore","versionAfter","createdAt"],"additionalProperties":false},"replayed":{"type":"boolean"}},"required":["ticket","receipt","replayed"],"additionalProperties":false},"example":{"ticket":{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","buyerBookingLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","ownerPersonId":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","attendee":null,"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":"2026-07-20T19:00:00.000Z","validUntil":"2026-07-20T22:00:00.000Z","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["55555555-5555-4555-8555-555555555555"],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"}],"version":2,"issuedAt":"2026-07-20T20:00:00.000Z","updatedAt":"2026-07-20T20:05:00.000Z"},"receipt":{"id":"88888888-8888-4888-8888-888888888888","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","ticketId":"99999999-9999-4999-8999-999999999999","action":"clear","previousAttendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"attendee":null,"reason":"Attendee changed plans.","actorPrincipalId":"77777777-7777-4777-8777-777777777777","clientRequestId":"attendee-clear-001","versionBefore":1,"versionAfter":2,"createdAt":"2026-07-20T20:05:00.000Z"},"replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage Event attendees.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The event ticket was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The ticket version, assignment state, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_VERSION_CONFLICT","EVENT_TICKET_ASSIGNMENT_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The attendee-clear body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ATTENDEE_CLEAR_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ATTENDEE_CLEAR_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The attendee authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ATTENDEE_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ATTENDEE_UNAVAILABLE","message":"The attendee authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/ticket-claims":{"post":{"operationId":"bookingEventTicketClaim","summary":"Claim an assigned event ticket","description":"Consumes a single-use claim token to bind an assigned ticket to the identity derived from authenticated host context. The operation is race-safe and idempotent; it never accepts a caller-asserted claimant or searches by mutable email alone.","tags":["booking-event-tickets"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"claimToken":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"Single-use Identity claim grant. The caller cannot assert a claimant, owner, recipient, email, or phone."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["claimToken","clientRequestId"],"additionalProperties":false},"example":{"claimToken":"0123456789abcdef0123456789abcdef0123456789a","clientRequestId":"ticket-claim-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false},"receipt":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"sourceOwnerPersonId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ownerPersonId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"proofId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"mergeReceiptId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"claimedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","ticketId","sourceOwnerPersonId","ownerPersonId","proofId","mergeReceiptId","clientRequestId","claimedAt"],"additionalProperties":false},"replayed":{"type":"boolean"}},"required":["ticket","receipt","replayed"],"additionalProperties":false},"example":{"ticket":{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","buyerBookingLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","ownerPersonId":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":"2026-07-20T19:00:00.000Z","validUntil":"2026-07-20T22:00:00.000Z","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":[],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"}],"version":2,"issuedAt":"2026-07-20T20:00:00.000Z","updatedAt":"2026-07-26T12:00:00.000Z"},"receipt":{"id":"f1111111-1111-4111-8111-111111111111","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","ticketId":"99999999-9999-4999-8999-999999999999","sourceOwnerPersonId":"f2222222-2222-4222-8222-222222222222","ownerPersonId":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","proofId":"f3333333-3333-4333-8333-333333333333","mergeReceiptId":"f4444444-4444-4444-8444-444444444444","clientRequestId":"ticket-claim-001","claimedAt":"2026-07-26T12:00:00.000Z"},"replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The single-use ticket claim was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_CLAIM_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_CLAIM_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The claim was already consumed, identity binding changed, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_CLAIM_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_CLAIM_CONFLICT","message":"Example"}}}}},"410":{"description":"The single-use ticket claim grant has expired.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_CLAIM_EXPIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_CLAIM_EXPIRED","message":"Example"}}}}},"422":{"description":"The claim token or clientRequestId is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_CLAIM_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_CLAIM_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The Identity authority required for ticket claiming is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_CLAIM_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_CLAIM_UNAVAILABLE","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/orders":{"get":{"operationId":"bookingEventOrderList","summary":"List Event orders","description":"Lists organization/Event-scoped commercial orders from canonical Booking, Payment, refund, and Ticket rows with stable signed cursor pagination and explicit disagreement states.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"search","in":"query","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Order, buyer-reference, or Ticket identifier. Raw buyer names, email addresses, and phone numbers are not searchable here."},"allowEmptyValue":true,"allowReserved":true},{"name":"orderState","in":"query","schema":{"type":"array","maxItems":3,"items":{"enum":["created","committed","cancelled"],"type":"string","description":"Booking-owned order lifecycle state."},"description":"Order lifecycle states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"paymentState","in":"query","schema":{"type":"array","maxItems":9,"items":{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."},"description":"Redacted canonical Payment states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"refundState","in":"query","schema":{"type":"array","maxItems":5,"items":{"enum":["none","pending","partially_refunded","refunded","reconciliation_required"],"type":"string"},"description":"Derived refund states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"ticketState","in":"query","schema":{"type":"array","maxItems":4,"items":{"enum":["not_applicable","pending","issued","voided","blocked"],"type":"string","description":"Ticket-owned issuance posture derived from canonical ticket rows."},"description":"Derived Ticket issuance states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"offerId","in":"query","schema":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Orders containing at least one listed Offer ID."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"source","in":"query","schema":{"type":"array","maxItems":4,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"description":"Booking purchase channels to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"purchasedFrom","in":"query","schema":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"allowEmptyValue":true,"allowReserved":true},{"name":"purchasedTo","in":"query","schema":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"allowEmptyValue":true,"allowReserved":true},{"name":"sort","in":"query","schema":{"enum":["purchased_at_desc","purchased_at_asc"],"type":"string","description":"Stable Event-order purchase-time sort with order ID as the keyset tie-breaker.","default":"purchased_at_desc"},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Maximum Event orders returned; capped at 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque signed cursor from the preceding Event-order page."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"orderNumber":{"type":"string","minLength":1},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"buyer":{"type":"object","properties":{"userId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Booking holder identity reference."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional deprecated organization customer-context reference."}},"required":["userId","customerId"],"additionalProperties":false},"purchasedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"orderState":{"enum":["created","committed","cancelled"],"type":"string","description":"Booking-owned order lifecycle state."},"payment":{"type":"object","properties":{"intentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"intentCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."},"canonicalStatus":{"anyOf":[{"enum":["draft","awaiting_attempt","attempt_active","requires_customer_action","provider_pending","succeeded","failed","canceled","expired","reconciliation_required","refund_pending","refunded","partially_refunded"],"type":"string","description":"Canonical Sonik payment intent state."},{"type":"null"}]},"amountMinor":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"activeAttempt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"provider":{"enum":["stripe","stripe_connect","mercadopago","mercadopago_connect","wompi_connect"],"type":"string","description":"Supported payment service provider boundary."},"status":{"enum":["created","dispatching","provider_pending","requires_action","succeeded","failed","canceled","expired","unknown","reconciliation_required","reconciled_not_paid"],"type":"string","description":"Canonical provider attempt state used to enforce single-active-attempt safety."}},"required":["id","provider","status"],"additionalProperties":false},{"type":"null"}]}},"required":["intentId","intentCount","state","canonicalStatus","amountMinor","currency","activeAttempt"],"additionalProperties":false},"refund":{"type":"object","properties":{"state":{"enum":["none","pending","partially_refunded","refunded","reconciliation_required"],"type":"string"},"refundedAmountMinor":{"type":"number","minimum":0},"commandCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","refundedAmountMinor","commandCount"],"additionalProperties":false},"cancellationReconciliation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"rootCommandId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"outcome":{"enum":["refund_required","no_refund_due","manual_review"],"type":"string","description":"Booking-owned reconciliation obligation. This is not Payment refund or provider state."},"workflowState":{"enum":["pending","manual_review","complete"],"type":"string"},"reasonCode":{"enum":["zero_total","payment_not_settled","already_refunded","pinned_policy_evidence_missing","payment_reconciliation_required","payment_evidence_ambiguous"],"type":"string"},"quoteSnapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quoteDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"evidenceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner":{"enum":["booking","payment","communications"],"type":"string"},"name":{"enum":["manual_review","refund","notify"],"type":"string"},"state":{"enum":["pending","blocked","acknowledged","failed"],"type":"string"},"requestDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"attemptCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"receiptReference":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["key","owner","name","state","requestDigest","attemptCount","receiptReference","lastErrorCode"],"additionalProperties":false}}},"required":["id","rootCommandId","outcome","workflowState","reasonCode","quoteSnapshotId","quoteDigest","policyDecisionReceiptIds","evidenceDigest","createdAt","steps"],"additionalProperties":false,"description":"Durable Booking reconciliation created with Event cancellation; Payment and communications retain their own truth."},{"type":"null"}]},"tickets":{"type":"object","properties":{"state":{"enum":["not_applicable","pending","issued","voided","blocked"],"type":"string","description":"Ticket-owned issuance posture derived from canonical ticket rows."},"expectedQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"issuedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"voidedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","expectedQuantity","issuedCount","voidedCount"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["offerId","offerVersion","quantity"],"additionalProperties":false}},"total":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountMinor","currency"],"additionalProperties":false},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"disagreements":{"type":"array","items":{"enum":["multiple_payment_intents","ticket_quantity_mismatch","tickets_issued_without_resolved_payment","payment_succeeded_without_issued_tickets","cancelled_order_with_active_payment_or_tickets"],"type":"string"}}},"required":["orderId","orderNumber","eventId","buyer","purchasedAt","orderState","payment","refund","cancellationReconciliation","tickets","lineItems","total","source","disagreements"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"queryEvidence":{"type":"object","properties":{"statementCount":{"const":1},"bound":{"const":1}},"required":["statementCount","bound"],"additionalProperties":false}},"required":["orders","nextCursor","queryEvidence"],"additionalProperties":false},"example":{"orders":[{"orderId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","orderNumber":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","eventId":"22222222-2222-4222-8222-222222222222","buyer":{"userId":"buyer-user-1","customerId":null},"purchasedAt":"2026-07-20T20:00:00.000Z","orderState":"committed","payment":{"intentId":"77777777-7777-4777-8777-777777777777","intentCount":1,"state":"succeeded","canonicalStatus":"succeeded","amountMinor":8500,"currency":"USD","activeAttempt":null},"refund":{"state":"none","refundedAmountMinor":0,"commandCount":0},"cancellationReconciliation":null,"tickets":{"state":"issued","expectedQuantity":1,"issuedCount":1,"voidedCount":0},"lineItems":[{"offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"quantity":1}],"total":{"amountMinor":8500,"currency":"USD"},"source":"web","disagreements":[]}],"nextCursor":null,"queryEvidence":{"statementCount":1,"bound":1}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"422":{"description":"The Event-order page size or signed cursor is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_CURSOR_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_CURSOR_INVALID","message":"The Event-order page size or signed cursor is invalid."}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/orders/{orderId}":{"get":{"operationId":"bookingEventOrderGet","summary":"Get Event order detail","description":"Returns one read-only Event-order projection with immutable commercial snapshots, redacted Payment/refund summaries, Ticket links, buyer/customer references, and explicit cross-authority disagreements.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"orderId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"orderNumber":{"type":"string","minLength":1},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"buyer":{"type":"object","properties":{"userId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Booking holder identity reference."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional deprecated organization customer-context reference."}},"required":["userId","customerId"],"additionalProperties":false},"purchasedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"orderState":{"enum":["created","committed","cancelled"],"type":"string","description":"Booking-owned order lifecycle state."},"payment":{"type":"object","properties":{"intentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"intentCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."},"canonicalStatus":{"anyOf":[{"enum":["draft","awaiting_attempt","attempt_active","requires_customer_action","provider_pending","succeeded","failed","canceled","expired","reconciliation_required","refund_pending","refunded","partially_refunded"],"type":"string","description":"Canonical Sonik payment intent state."},{"type":"null"}]},"amountMinor":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"activeAttempt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"provider":{"enum":["stripe","stripe_connect","mercadopago","mercadopago_connect","wompi_connect"],"type":"string","description":"Supported payment service provider boundary."},"status":{"enum":["created","dispatching","provider_pending","requires_action","succeeded","failed","canceled","expired","unknown","reconciliation_required","reconciled_not_paid"],"type":"string","description":"Canonical provider attempt state used to enforce single-active-attempt safety."}},"required":["id","provider","status"],"additionalProperties":false},{"type":"null"}]}},"required":["intentId","intentCount","state","canonicalStatus","amountMinor","currency","activeAttempt"],"additionalProperties":false},"refund":{"type":"object","properties":{"state":{"enum":["none","pending","partially_refunded","refunded","reconciliation_required"],"type":"string"},"refundedAmountMinor":{"type":"number","minimum":0},"commandCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","refundedAmountMinor","commandCount"],"additionalProperties":false},"cancellationReconciliation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"rootCommandId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"outcome":{"enum":["refund_required","no_refund_due","manual_review"],"type":"string","description":"Booking-owned reconciliation obligation. This is not Payment refund or provider state."},"workflowState":{"enum":["pending","manual_review","complete"],"type":"string"},"reasonCode":{"enum":["zero_total","payment_not_settled","already_refunded","pinned_policy_evidence_missing","payment_reconciliation_required","payment_evidence_ambiguous"],"type":"string"},"quoteSnapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quoteDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"evidenceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner":{"enum":["booking","payment","communications"],"type":"string"},"name":{"enum":["manual_review","refund","notify"],"type":"string"},"state":{"enum":["pending","blocked","acknowledged","failed"],"type":"string"},"requestDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"attemptCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"receiptReference":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["key","owner","name","state","requestDigest","attemptCount","receiptReference","lastErrorCode"],"additionalProperties":false}}},"required":["id","rootCommandId","outcome","workflowState","reasonCode","quoteSnapshotId","quoteDigest","policyDecisionReceiptIds","evidenceDigest","createdAt","steps"],"additionalProperties":false,"description":"Durable Booking reconciliation created with Event cancellation; Payment and communications retain their own truth."},{"type":"null"}]},"tickets":{"type":"object","properties":{"state":{"enum":["not_applicable","pending","issued","voided","blocked"],"type":"string","description":"Ticket-owned issuance posture derived from canonical ticket rows."},"expectedQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"issuedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"voidedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","expectedQuantity","issuedCount","voidedCount"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["offerId","offerVersion","quantity"],"additionalProperties":false}},"total":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountMinor","currency"],"additionalProperties":false},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"disagreements":{"type":"array","items":{"enum":["multiple_payment_intents","ticket_quantity_mismatch","tickets_issued_without_resolved_payment","payment_succeeded_without_issued_tickets","cancelled_order_with_active_payment_or_tickets"],"type":"string"}},"queryEvidence":{"type":"object","properties":{"statementCount":{"const":1},"bound":{"const":1}},"required":["statementCount","bound"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"line":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"bookingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"intentLineId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"source":{"anyOf":[{"type":"object","properties":{"kind":{"const":"event_offer"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","eventId","offerId","offerVersion"],"additionalProperties":false}],"description":"Immutable commercial source that produced one normalized booking-intent line."},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"finalizedQuoteSnapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","bookingId","intentLineId","source","quantity","finalizedQuoteSnapshotId","createdAt"],"additionalProperties":false},"ticketIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}},"required":["line","ticketIds"],"additionalProperties":false}},"commercialSnapshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Immutable finalized commercial quote snapshot; acceptance is separate evidence."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"sourceQuoteId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"bookingIntentDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"ratePlanVersionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"rateAssignmentIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"evaluatorVersions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Evaluator registry key."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned evaluator implementation version."},"schemaKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registry key for the configuration schema."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Pinned configuration schema version."}},"required":["key","version","schemaKey","schemaVersion"],"additionalProperties":false,"description":"Exact registered evaluator and schema pair required before activation."}},"factDigest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."},"lines":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"label":{"type":"string","minLength":1},"effect":{"enum":["charge","fee","surcharge","discount","credit"],"type":"string","description":"How a component changes the quote total."},"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"ratePlanVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"rateComponentCode":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"policyDecisionReceiptId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"bookingIntentLineId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"default":null,"description":"Resolved booking-intent line attributed by this charge; null for whole-intent taxes, fees, or adjustments."}},"required":["code","label","effect","amount","ratePlanVersionId","rateComponentCode","policyDecisionReceiptId"],"additionalProperties":false}},"subtotal":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"adjustments":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amount":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"behavior":{"enum":["inclusive","exclusive","unspecified"],"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax category code interpreted by the named source."},"source":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Tax catalog or provider authority."},"version":{"type":"string","minLength":1,"description":"Pinned tax catalog version."}},"required":["code","source","version"],"additionalProperties":false},{"type":"null"}]}},"required":["amount","behavior","category"],"additionalProperties":false},"total":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer amount in the currency's minor unit; may be negative only for totals."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"Uppercase ISO 4217 currency code."}},"required":["amountMinor","currency"],"additionalProperties":false},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Lowercase SHA-256 digest of canonical JSON."}},"required":["id","organizationId","sourceQuoteId","bookingIntentDigest","contextId","customerId","ratePlanVersionIds","rateAssignmentIds","policyDecisionReceiptIds","evaluatorVersions","factDigest","lines","subtotal","adjustments","tax","total","rounding","expiresAt","createdAt","digest"],"additionalProperties":false},"ticketRecords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","offerId","status","attendee","issuedAt"],"additionalProperties":false}},"refundHistory":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"amountMinor":{"type":"number","minimum":0},"kind":{"enum":["full","partial"],"type":"string"},"status":{"enum":["queued","dispatching","provider_pending","requires_action","reconciliation_required","succeeded","failed"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","amountMinor","kind","status","createdAt"],"additionalProperties":false}},"attendeeCompletion":{"type":"object","properties":{"assigned":{"type":"integer","minimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["assigned","total"],"additionalProperties":false},"activity":{"type":"array","items":{"type":"object","properties":{"source":{"enum":["booking","payment","refund"],"type":"string"},"kind":{"type":"string","minLength":1},"occurredAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"referenceId":{"type":"string","minLength":1}},"required":["source","kind","occurredAt","referenceId"],"additionalProperties":false}}},"required":["orderId","orderNumber","eventId","buyer","purchasedAt","orderState","payment","refund","cancellationReconciliation","tickets","lineItems","total","source","disagreements","queryEvidence","lines","commercialSnapshot","ticketRecords","refundHistory","attendeeCompletion","activity"],"additionalProperties":false},"example":{"orderId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","orderNumber":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","eventId":"22222222-2222-4222-8222-222222222222","buyer":{"userId":"buyer-user-1","customerId":null},"purchasedAt":"2026-07-20T20:00:00.000Z","orderState":"committed","payment":{"intentId":"77777777-7777-4777-8777-777777777777","intentCount":1,"state":"succeeded","canonicalStatus":"succeeded","amountMinor":8500,"currency":"USD","activeAttempt":null},"refund":{"state":"none","refundedAmountMinor":0,"commandCount":0},"cancellationReconciliation":null,"tickets":{"state":"issued","expectedQuantity":1,"issuedCount":1,"voidedCount":0},"lineItems":[{"offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"quantity":1}],"total":{"amountMinor":8500,"currency":"USD"},"source":"web","disagreements":[],"queryEvidence":{"statementCount":1,"bound":1},"lines":[{"line":{"id":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","organizationId":"11111111-1111-4111-8111-111111111111","bookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","intentLineId":"12121212-1212-4212-8212-121212121212","source":{"kind":"event_offer","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3},"quantity":1,"finalizedQuoteSnapshotId":"66666666-6666-4666-8666-666666666666","createdAt":"2026-07-20T20:00:00.000Z"},"ticketIds":["99999999-9999-4999-8999-999999999999"]}],"commercialSnapshot":{"id":"66666666-6666-4666-8666-666666666666","organizationId":"11111111-1111-4111-8111-111111111111","sourceQuoteId":null,"bookingIntentDigest":"0000000000000000000000000000000000000000000000000000000000000000","contextId":"44444444-4444-4444-8444-444444444444","customerId":null,"ratePlanVersionIds":["55555555-5555-4555-8555-555555555555"],"rateAssignmentIds":[],"policyDecisionReceiptIds":[],"evaluatorVersions":[],"factDigest":"0000000000000000000000000000000000000000000000000000000000000000","lines":[{"code":"admission","label":"Admission","effect":"charge","amount":{"amountMinor":8500,"currency":"USD"},"ratePlanVersionId":"55555555-5555-4555-8555-555555555555","rateComponentCode":"admission","policyDecisionReceiptId":null}],"subtotal":{"amountMinor":8500,"currency":"USD"},"adjustments":{"amountMinor":0,"currency":"USD"},"tax":{"amount":{"amountMinor":0,"currency":"USD"},"behavior":"unspecified","category":null},"total":{"amountMinor":8500,"currency":"USD"},"rounding":"half_even","expiresAt":"2026-07-20T21:00:00.000Z","createdAt":"2026-07-20T20:00:00.000Z","digest":"0000000000000000000000000000000000000000000000000000000000000000"},"ticketRecords":[{"id":"99999999-9999-4999-8999-999999999999","offerId":"33333333-3333-4333-8333-333333333333","status":"active","attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"issuedAt":"2026-07-20T20:00:00.000Z"}],"refundHistory":[],"attendeeCompletion":{"assigned":1,"total":1},"activity":[{"source":"booking","kind":"created","occurredAt":"2026-07-20T20:00:00.000Z","referenceId":"88888888-8888-4888-8888-888888888888"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The Event order was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_NOT_FOUND","message":"The Event order was not found."}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/orders/export":{"get":{"operationId":"bookingEventOrderExport","summary":"Export Event orders","description":"Exports a bounded, filter-equivalent Event-order CSV containing Booking identifiers and redacted Payment/Ticket summaries. Raw buyer contact data and provider payloads are excluded.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"search","in":"query","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Order, buyer-reference, or Ticket identifier. Raw buyer names, email addresses, and phone numbers are not searchable here."},"allowEmptyValue":true,"allowReserved":true},{"name":"orderState","in":"query","schema":{"type":"array","maxItems":3,"items":{"enum":["created","committed","cancelled"],"type":"string","description":"Booking-owned order lifecycle state."},"description":"Order lifecycle states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["committed"]},{"name":"paymentState","in":"query","schema":{"type":"array","maxItems":9,"items":{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."},"description":"Redacted canonical Payment states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true,"example":["succeeded"]},{"name":"refundState","in":"query","schema":{"type":"array","maxItems":5,"items":{"enum":["none","pending","partially_refunded","refunded","reconciliation_required"],"type":"string"},"description":"Derived refund states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"ticketState","in":"query","schema":{"type":"array","maxItems":4,"items":{"enum":["not_applicable","pending","issued","voided","blocked"],"type":"string","description":"Ticket-owned issuance posture derived from canonical ticket rows."},"description":"Derived Ticket issuance states to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"offerId","in":"query","schema":{"type":"array","maxItems":50,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"description":"Orders containing at least one listed Offer ID."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"source","in":"query","schema":{"type":"array","maxItems":4,"items":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"description":"Booking purchase channels to include."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"purchasedFrom","in":"query","schema":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"allowEmptyValue":true,"allowReserved":true},{"name":"purchasedTo","in":"query","schema":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"allowEmptyValue":true,"allowReserved":true},{"name":"sort","in":"query","schema":{"enum":["purchased_at_desc","purchased_at_asc"],"type":"string","description":"Stable Event-order purchase-time sort with order ID as the keyset tie-breaker.","default":"purchased_at_desc"},"allowEmptyValue":true,"allowReserved":true,"example":"purchased_at_desc"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":500,"description":"Maximum rows exported. The request fails rather than silently truncating when more rows match."},"allowEmptyValue":true,"allowReserved":true,"example":500}],"responses":{"200":{"description":"OK","content":{"text/csv":{"schema":{"type":"string","minLength":1,"description":"UTF-8 CSV containing stable, allowlisted Event-order fields. It never includes raw buyer contact data or provider payloads."},"example":"order_id,order_number,buyer_user_id,customer_id,purchased_at,order_state,payment_state,refund_state,ticket_state,expected_ticket_quantity,issued_ticket_count,voided_ticket_count,amount_minor,currency,source,offer_ids,disagreements\naaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa,aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa,buyer-user-1,,2026-07-20T20:00:00.000Z,committed,succeeded,none,issued,1,1,0,8500,USD,web,33333333-3333-4333-8333-333333333333,\n"}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot export Event orders for this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot export Event orders for this organization."}}}}},"422":{"description":"The Event-order export filters or bounded row limit are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_CURSOR_INVALID","EVENT_ORDER_EXPORT_TOO_LARGE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_EXPORT_TOO_LARGE","message":"The Event-order export exceeds its bounded row limit; narrow the filters and retry."}}}}},"503":{"description":"The Event-order export or authenticated booking authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE","auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/orders/{orderId}/confirmation-resend":{"post":{"operationId":"bookingEventOrderConfirmationResend","summary":"Resend an Event order confirmation","description":"Creates an idempotent, durable communications delegation for the canonical Booking holder. The caller cannot supply a destination, and a successful response is not delivery proof.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"orderId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Idempotency key for this Event-order command."}},"required":["clientRequestId"],"additionalProperties":false},"example":{"clientRequestId":"event-order-confirmation-resend-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"delegationReference":{"type":"string","format":"uuid","description":"Durable Booking command receipt delegated to communications; it is not delivery proof."},"recipient":{"type":"object","properties":{"kind":{"const":"user"},"userId":{"type":"string","minLength":1}},"required":["kind","userId"],"additionalProperties":false},"status":{"enum":["pending","acknowledged","failed"],"type":"string","description":"Durable communications delegation state; this is not provider delivery proof."},"delegatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"replayed":{"type":"boolean"}},"required":["eventId","orderId","delegationReference","recipient","status","delegatedAt","replayed"],"additionalProperties":false},"example":{"eventId":"22222222-2222-4222-8222-222222222222","orderId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","delegationReference":"88888888-8888-4888-8888-888888888888","recipient":{"kind":"user","userId":"auth-user-1"},"status":"pending","delegatedAt":"2026-07-26T20:00:00.000Z","replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage Event-order communications.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The Event order was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_NOT_FOUND","message":"The Event order was not found."}}}}},"409":{"description":"The client request identifier was already used with different command input.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_COMMAND_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_COMMAND_CONFLICT","message":"The client request ID is already bound to another Event-order command."}}}}},"415":{"description":"Event-order commands require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The Event order has no claimable user recipient or the strict command input is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_CONFIRMATION_UNAVAILABLE","EVENT_ORDER_COMMAND_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_CONFIRMATION_UNAVAILABLE","message":"The Event order does not have a canonical Booking holder user."}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/orders/{orderId}/cancel":{"post":{"operationId":"bookingEventOrderCancel","summary":"Cancel an unpaid or refunded Event order","description":"Atomically cancels Booking-owned order obligations, releases committed inventory, voids every active Ticket of the order and records the reason on the Booking lifecycle. It passes only when Payment evidence is clearly unpaid and terminal, or the payment is fully refunded; paymentStatus names the state it read. A paid order that is not fully refunded answers 422 EVENT_ORDER_PAYMENT_ACTION_REQUIRED: refund it first, by hand in the Stripe Dashboard with Reverse transfer ticked, then cancel. It never creates refunds or provider commands.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"orderId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"maxLength":128,"description":"Idempotency key for this Event-order command."},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["clientRequestId","reason"],"additionalProperties":false},"example":{"clientRequestId":"event-order-cancel-001","reason":"Organizer cancelled this free order"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"bookingStatus":{"const":"cancelled"},"ticketVoidedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"inventoryRelease":{"const":"completed"},"paymentAction":{"const":"none","description":"Booking did not issue a Payment or provider command."},"refundOccurred":{"const":false,"description":"Booking started no refund. A refund Payment already made reads in paymentStatus."},"paymentStatus":{"anyOf":[{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."},{"type":"null"}]},"cancelledAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"replayed":{"type":"boolean"}},"required":["eventId","orderId","bookingStatus","ticketVoidedCount","inventoryRelease","paymentAction","refundOccurred","paymentStatus","cancelledAt","replayed"],"additionalProperties":false},"example":{"eventId":"22222222-2222-4222-8222-222222222222","orderId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","bookingStatus":"cancelled","ticketVoidedCount":2,"inventoryRelease":"completed","paymentAction":"none","refundOccurred":false,"paymentStatus":"refunded","cancelledAt":"2026-07-26T20:00:00.000Z","replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage Event orders.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The Event order was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_NOT_FOUND","message":"The Event order was not found."}}}}},"409":{"description":"The client request identifier was already used with different command input.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_COMMAND_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_COMMAND_CONFLICT","message":"The client request ID is already bound to another Event-order command."}}}}},"415":{"description":"Event-order commands require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The order is already cancelled, is paid and not fully refunded (refund it in Stripe first), or the strict command input is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ORDER_NOT_CANCELLABLE","EVENT_ORDER_PAYMENT_ACTION_REQUIRED","EVENT_ORDER_COMMAND_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ORDER_PAYMENT_ACTION_REQUIRED","message":"Payment-owned review or action is required before cancellation."}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"destructive","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/sales-summary":{"get":{"operationId":"bookingEventSalesSummary","summary":"Read an Event's sales summary","description":"Counts one Event's committed, uncancelled orders: tickets sold per tier, pool remaining, gross per currency from each order's quote total (never the payment amount), door admissions, and the time read. countFrom leaves earlier orders out. Counts only: no buyer and no payment row.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"countFrom","in":"query","schema":{"type":"string","format":"date-time","description":"Count only orders placed at or after this time, so earlier test buys stay out."},"allowEmptyValue":true,"allowReserved":true,"example":"2026-10-27T00:00:00.000Z"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventName":{"type":"string"},"eventStartsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"When the Event starts (its schedule's startsAt); null when the schedule is date-only or still to be decided."},"doorsOpenAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"When entry begins (the schedule's doorsOpenAt); null when it is not set."},"venueName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The venue name captured on the Event's physical location; null when the location is online or still to be decided."},"countFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"orders":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Counted orders: confirmed or committed, not cancelled, not fully refunded, with a line on this Event, placed at or after countFrom. Fully refunded = the order has payments and none still holds money. A partially refunded order stays counted with its whole total (its seats are taken, its scans count); a refunded duplicate charge never removes a paid order. sold, paidSold, comps, gross, daily and the tiers read from these."},"sold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tickets sold: the counted orders' line quantities on this Event."},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"What a buyer can buy now, summed over the Event's pools: each pool's released capacity minus its live holds and committed units (countFrom does not change it); null when no Offer draws on a pool."},"gross":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false},"description":"Per currency, the sum of each counted order's total.amountMinor (the quote total in booking minor units: whole pesos for COP): the paid totals, never netted. A partially refunded order counts its whole total, because a live partial refund stores no refunded amount yet; it is counted in partiallyRefundedOrders instead. Never the payment amount, which carries the provider's minor unit."},"admitted":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Allowed door scans that are not reversed, of tickets from the counted orders (countFrom applies): admissions, not people."},"paidSold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tickets sold in counted orders whose quote total is above 0. sold = paidSold + comps."},"comps":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tickets in counted orders whose quote total is 0: complimentary tickets (and any free tier). Kept out of paidSold and the daily series."},"paidOrders":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Counted orders whose quote total is above 0: purchases. A complimentary order is in orders and not here."},"cancelledOrders":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Orders with a line on this Event, placed at or after countFrom, that are cancelled. They are not in orders."},"refundedOrders":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Orders with a line on this Event, placed at or after countFrom, that are fully refunded (they have payments and none still holds money), cancelled or not. They are not in orders."},"partiallyRefundedOrders":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Counted orders (so in orders, with their whole total in gross) placed at or after countFrom with a partially refunded payment. A refunded duplicate charge or a refunded-then-repaid order is whole and counts in neither refund field."},"daily":{"type":"array","maxItems":120,"items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"paid":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","paid"],"additionalProperties":false},"description":"Paid tickets per America/Bogota calendar day (an order counts on the day it was placed), every day from countFrom (else the first paid sale) through the day of asOf, days with no sale included as 0; the most recent 120 days at most. Empty before the first paid sale."},"tiers":{"type":"array","items":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string"},"status":{"enum":["draft","active","paused","retired"],"type":"string"},"sold":{"type":"integer","minimum":0,"maximum":9007199254740991},"inventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The tier's pool available now (released capacity minus live holds and committed units), shared by every tier on that pool."},"paidSold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"This tier's tickets in counted orders whose quote total is above 0."},"price":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false},{"type":"null"}],"description":"The tier's current price per ticket when its base rate is one fixed or per-ticket charge; null otherwise."},"gross":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false},"description":"Per currency, the counted orders' quote lines charged to this tier's lines (discounts and credits subtract). A fee or tax charged to the whole order belongs to no tier, so the tiers can sum to less than gross."}},"required":["offerId","name","status","sold","inventoryPoolId","remaining"],"additionalProperties":false}},"pools":{"type":"array","items":{"type":"object","properties":{"inventoryPoolId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string"},"capacity":{"type":"integer","minimum":0,"maximum":9007199254740991},"sold":{"type":"integer","minimum":0,"maximum":9007199254740991},"remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Available now: released capacity minus live holds and committed units."},"held":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Units in live checkout holds now (held and not yet expired): buyers paying at this moment."},"unlimited":{"type":"boolean","description":"True when the pool's hard capacity is the ceiling 2147483647 (SALES_UNLIMITED_CAPACITY): it sells without a limit, so its capacity and remaining are not counts to show."}},"required":["inventoryPoolId","name","capacity","sold","remaining"],"additionalProperties":false}},"capacityUnlimited":{"type":"boolean","description":"True when any of the Event's pools is unlimited (pools[].unlimited): the Event can always sell one more, so its total has no capacity for sold to be a share of. A limited pool beside it keeps its own capacity, remaining and sold-out state. False when every pool has a real capacity, or there are no pools."},"promoters":{"type":"array","items":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string"},"utmSource":{"type":"string"},"state":{"enum":["active","archived"],"type":"string"},"orders":{"type":"integer","minimum":0,"maximum":9007199254740991},"tickets":{"type":"integer","minimum":0,"maximum":9007199254740991},"gross":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false}}},"required":["linkId","name","utmSource","state","orders","tickets","gross"],"additionalProperties":false},"description":"Sales per promoter link of this Event (Dan 2026-10-29): counted orders with a quote total above 0 whose checkout landed with the link's utm_source, utm_medium and utm_campaign, inside countFrom. Active links, and archived ones that have sales. Tickets and gross as paidSold and gross count them; what no link claims is direct."},"asOf":{"type":"string","format":"date-time","description":"Server time the summary was read."}},"required":["eventId","eventName","countFrom","orders","sold","remaining","gross","admitted","tiers","pools","asOf"],"additionalProperties":false},"example":{"eventId":"22222222-2222-4222-8222-222222222222","eventName":"Tarab x Cúpula","countFrom":"2026-10-27T00:00:00.000Z","orders":8,"sold":8,"remaining":92,"gross":[{"currency":"COP","amountMinor":240000}],"admitted":0,"tiers":[{"offerId":"44444444-4444-4444-8444-444444444444","name":"1ª etapa","status":"active","sold":8,"inventoryPoolId":"55555555-5555-4555-8555-555555555555","remaining":92}],"pools":[{"inventoryPoolId":"55555555-5555-4555-8555-555555555555","name":"General","capacity":100,"sold":8,"remaining":92}],"asOf":"2026-10-27T15:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The Event was not found in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The strict sales dashboard request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SALES_DASHBOARD_INPUT_INVALID","message":"The sales dashboard request is invalid"}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/sales-dashboard-links":{"post":{"operationId":"bookingEventSalesDashboardLinkCreate","summary":"Publish an Event's sales dashboard link","description":"Mints a link to a read-only sales dashboard for this Event that only the listed phones can open, each after a one-time code. The URL is answered once; only a hash of its token is stored, and a lost link is replaced by minting another. countFrom leaves earlier orders out; expiresAt is optional.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phones":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$","description":"A phone number in E.164 form, such as +573001234567."},"description":"Phones allowed to open the link after a one-time code; stored as digests."},"countFrom":{"anyOf":[{"type":"string","format":"date-time","description":"Count only orders placed at or after this time, so earlier test buys stay out."},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Optional end of the link; omitted, it stays open until revoked."}},"required":["phones"],"additionalProperties":false},"example":{"phones":["+573001234567"],"countFrom":"2026-10-27T00:00:00.000Z"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"state":{"enum":["active","revoked","expired"],"type":"string"},"phones":{"type":"array","items":{"type":"string","pattern":"^\\+\\d{1,3} \\u2022\\u2022\\u2022\\u2022 \\d{4}$","description":"A masked phone: the country code and the last four digits only."},"description":"The allowed phones, masked."},"countFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["linkId","eventId","state","phones","countFrom","expiresAt","revokedAt","createdBy","createdAt"],"additionalProperties":false},"url":{"type":"string","format":"uri","description":"The link to share. Answered once: only a hash of its token is stored."}},"required":["link","url"],"additionalProperties":false},"example":{"link":{"linkId":"33333333-3333-4333-8333-333333333333","eventId":"22222222-2222-4222-8222-222222222222","state":"active","phones":["+57 •••• 4567"],"countFrom":"2026-10-27T00:00:00.000Z","expiresAt":null,"revokedAt":null,"createdBy":"principal-organizer","createdAt":"2026-10-27T15:00:00.000Z"},"url":"https://tickets.sonik.fm/d/QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage this Event.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The Event was not found in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"415":{"description":"Sales dashboard commands require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict sales dashboard request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SALES_DASHBOARD_INPUT_INVALID","message":"The sales dashboard request is invalid"}}}}},"503":{"description":"The dashboard link base URL or the authenticated booking context is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SALES_DASHBOARD_UNAVAILABLE","auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"SALES_DASHBOARD_UNAVAILABLE","message":"The dashboard link base URL is not configured"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventSalesDashboardLinkList","summary":"List an Event's sales dashboard links","description":"Lists the Event's dashboard links, newest first, with their state and masked phones. Tokens are never stored, so no link URL can be read back.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"state":{"enum":["active","revoked","expired"],"type":"string"},"phones":{"type":"array","items":{"type":"string","pattern":"^\\+\\d{1,3} \\u2022\\u2022\\u2022\\u2022 \\d{4}$","description":"A masked phone: the country code and the last four digits only."},"description":"The allowed phones, masked."},"countFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["linkId","eventId","state","phones","countFrom","expiresAt","revokedAt","createdBy","createdAt"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false},"example":{"links":[{"linkId":"33333333-3333-4333-8333-333333333333","eventId":"22222222-2222-4222-8222-222222222222","state":"active","phones":["+57 •••• 4567"],"countFrom":"2026-10-27T00:00:00.000Z","expiresAt":null,"revokedAt":null,"createdBy":"principal-organizer","createdAt":"2026-10-27T15:00:00.000Z"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The Event was not found in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The strict sales dashboard request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SALES_DASHBOARD_INPUT_INVALID","message":"The sales dashboard request is invalid"}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/sales-dashboard-links/{linkId}/revoke":{"post":{"operationId":"bookingEventSalesDashboardLinkRevoke","summary":"Revoke a sales dashboard link","description":"Revokes the link for every viewer at once; it then answers like a link that never existed. Revoking again answers the same record.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"linkId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"33333333-3333-4333-8333-333333333333"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false},"example":{}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"state":{"enum":["active","revoked","expired"],"type":"string"},"phones":{"type":"array","items":{"type":"string","pattern":"^\\+\\d{1,3} \\u2022\\u2022\\u2022\\u2022 \\d{4}$","description":"A masked phone: the country code and the last four digits only."},"description":"The allowed phones, masked."},"countFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["linkId","eventId","state","phones","countFrom","expiresAt","revokedAt","createdBy","createdAt"],"additionalProperties":false},"example":{"linkId":"33333333-3333-4333-8333-333333333333","eventId":"22222222-2222-4222-8222-222222222222","state":"revoked","phones":["+57 •••• 4567"],"countFrom":"2026-10-27T00:00:00.000Z","expiresAt":null,"revokedAt":"2026-10-27T16:00:00.000Z","createdBy":"principal-organizer","createdAt":"2026-10-27T15:00:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage this Event.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The link is not one of this Event's in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SALES_DASHBOARD_LINK_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"SALES_DASHBOARD_LINK_NOT_FOUND","message":"Dashboard link not found"}}}}},"415":{"description":"Sales dashboard commands require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict sales dashboard request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SALES_DASHBOARD_INPUT_INVALID","message":"The sales dashboard request is invalid"}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/promoter-links":{"post":{"operationId":"bookingEventPromoterLinkCreate","summary":"Create a promoter link","description":"Creates a promoter link for this Event: the organizer's page (an origin on an active embedding of the organization) with utm_source (default: a slug of the name, unique per Event, never reused), utm_medium (default promoter) and utm_campaign (default: a slug of the Event title), plus optional utm_content and utm_term. A paid order whose checkout landed with the link's source, medium and campaign counts for it.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The promoter, as people read it."},"destinationUrl":{"type":"string","maxLength":2048,"format":"uri","description":"The organizer's https page where the Revent checkout is embedded (an origin on one of the organization's active embeddings)."},"utm":{"type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Default: a slug of name. Unique per Event."},"medium":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Default: \"promoter\"."},"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Default: a slug of the Event title."},"content":{"type":"string","minLength":1,"maxLength":100},"term":{"type":"string","minLength":1,"maxLength":100}},"additionalProperties":false}},"required":["name","destinationUrl"],"additionalProperties":false},"example":{"name":"Juan Pérez","destinationUrl":"https://tarab.sonik.fm/#events/tarab"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","format":"uri","description":"The link to share: destinationUrl with the link's utm_* tags (any it had replaced)."},"destinationUrl":{"type":"string","format":"uri","description":"The organizer's page the link opens, as given."},"utm":{"type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"medium":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["source","medium","campaign","content","term"],"additionalProperties":false},"state":{"enum":["active","archived"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"sales":{"type":"object","properties":{"orders":{"type":"integer","minimum":0,"maximum":9007199254740991},"tickets":{"type":"integer","minimum":0,"maximum":9007199254740991},"gross":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false}}},"required":["orders","tickets","gross"],"additionalProperties":false,"description":"Counted orders with a quote total above 0 whose checkout carried this link's source, medium and campaign (content and term are not matched), their tickets on this Event and their quote totals per currency."}},"required":["linkId","eventId","name","url","destinationUrl","utm","state","createdAt","archivedAt","sales"],"additionalProperties":false}},"required":["link"],"additionalProperties":false},"example":{"link":{"linkId":"33333333-3333-4333-8333-333333333333","eventId":"22222222-2222-4222-8222-222222222222","name":"Juan Pérez","url":"https://tarab.sonik.fm/?utm_source=juan-perez&utm_medium=promoter&utm_campaign=tarab#events/tarab","destinationUrl":"https://tarab.sonik.fm/#events/tarab","utm":{"source":"juan-perez","medium":"promoter","campaign":"tarab","content":null,"term":null},"state":"active","createdAt":"2026-10-29T17:00:00.000Z","archivedAt":null,"sales":{"orders":0,"tickets":0,"gross":[]}}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage this Event.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The Event was not found in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"Another link on this Event already uses this utm_source (archived links keep theirs).","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PROMOTER_LINK_SOURCE_TAKEN"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PROMOTER_LINK_SOURCE_TAKEN","message":"Another promoter link on this Event already uses this source"}}}}},"415":{"description":"Promoter link commands require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict request is invalid, the destination's origin is on no active embedding of this organization, or the name leaves no source.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID","PROMOTER_LINK_DESTINATION_NOT_EMBEDDED","PROMOTER_LINK_SOURCE_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PROMOTER_LINK_DESTINATION_NOT_EMBEDDED","message":"The destination is not an origin of an active embedding of this organization"}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventPromoterLinkList","summary":"List an Event's promoter links with their sales","description":"Lists the Event's promoter links, newest first, each with its URL and its sales: counted orders with a quote total above 0 that carried its tags, their tickets and gross per currency. countFrom leaves earlier orders out.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"countFrom","in":"query","schema":{"type":"string","format":"date-time","description":"Count only orders placed at or after this time, so earlier test buys stay out."},"allowEmptyValue":true,"allowReserved":true,"example":"2026-10-27T00:00:00.000Z"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","format":"uri","description":"The link to share: destinationUrl with the link's utm_* tags (any it had replaced)."},"destinationUrl":{"type":"string","format":"uri","description":"The organizer's page the link opens, as given."},"utm":{"type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"medium":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["source","medium","campaign","content","term"],"additionalProperties":false},"state":{"enum":["active","archived"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"sales":{"type":"object","properties":{"orders":{"type":"integer","minimum":0,"maximum":9007199254740991},"tickets":{"type":"integer","minimum":0,"maximum":9007199254740991},"gross":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false}}},"required":["orders","tickets","gross"],"additionalProperties":false,"description":"Counted orders with a quote total above 0 whose checkout carried this link's source, medium and campaign (content and term are not matched), their tickets on this Event and their quote totals per currency."}},"required":["linkId","eventId","name","url","destinationUrl","utm","state","createdAt","archivedAt","sales"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false},"example":{"links":[{"linkId":"33333333-3333-4333-8333-333333333333","eventId":"22222222-2222-4222-8222-222222222222","name":"Juan Pérez","url":"https://tarab.sonik.fm/?utm_source=juan-perez&utm_medium=promoter&utm_campaign=tarab#events/tarab","destinationUrl":"https://tarab.sonik.fm/#events/tarab","utm":{"source":"juan-perez","medium":"promoter","campaign":"tarab","content":null,"term":null},"state":"active","createdAt":"2026-10-29T17:00:00.000Z","archivedAt":null,"sales":{"orders":2,"tickets":3,"gross":[{"currency":"COP","amountMinor":150000}]}}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The Event was not found in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The strict promoter link request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SALES_DASHBOARD_INPUT_INVALID","message":"The sales dashboard request is invalid"}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/promoter-links/{linkId}/archive":{"post":{"operationId":"bookingEventPromoterLinkArchive","summary":"Archive a promoter link","description":"Moves the link out of the active list. Its sales still count for it, and its source is never reused. The URL keeps opening the organizer's page, because that page is the organizer's own. Archiving again answers the same record.","tags":["booking-event-orders"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"22222222-2222-4222-8222-222222222222"},{"name":"linkId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"33333333-3333-4333-8333-333333333333"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false},"example":{}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","format":"uri","description":"The link to share: destinationUrl with the link's utm_* tags (any it had replaced)."},"destinationUrl":{"type":"string","format":"uri","description":"The organizer's page the link opens, as given."},"utm":{"type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"medium":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"Lower case a-z, 0-9, dot, underscore or dash; starts with a letter or digit; 64 at most."},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["source","medium","campaign","content","term"],"additionalProperties":false},"state":{"enum":["active","archived"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"sales":{"type":"object","properties":{"orders":{"type":"integer","minimum":0,"maximum":9007199254740991},"tickets":{"type":"integer","minimum":0,"maximum":9007199254740991},"gross":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false}}},"required":["orders","tickets","gross"],"additionalProperties":false,"description":"Counted orders with a quote total above 0 whose checkout carried this link's source, medium and campaign (content and term are not matched), their tickets on this Event and their quote totals per currency."}},"required":["linkId","eventId","name","url","destinationUrl","utm","state","createdAt","archivedAt","sales"],"additionalProperties":false},"example":{"linkId":"33333333-3333-4333-8333-333333333333","eventId":"22222222-2222-4222-8222-222222222222","name":"Juan Pérez","url":"https://tarab.sonik.fm/?utm_source=juan-perez&utm_medium=promoter&utm_campaign=tarab#events/tarab","destinationUrl":"https://tarab.sonik.fm/#events/tarab","utm":{"source":"juan-perez","medium":"promoter","campaign":"tarab","content":null,"term":null},"state":"archived","createdAt":"2026-10-29T17:00:00.000Z","archivedAt":"2026-10-29T18:00:00.000Z","sales":{"orders":2,"tickets":3,"gross":[{"currency":"COP","amountMinor":150000}]}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"403":{"description":"The actor cannot manage this Event.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"The actor cannot manage Event attendees"}}}}},"404":{"description":"The link is not one of this Event's in this organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PROMOTER_LINK_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PROMOTER_LINK_NOT_FOUND","message":"Promoter link not found"}}}}},"415":{"description":"Promoter link commands require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The strict promoter link request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SALES_DASHBOARD_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SALES_DASHBOARD_INPUT_INVALID","message":"The sales dashboard request is invalid"}}}}},"503":{"description":"The authenticated booking context could not be resolved.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/providers/authority-profiles":{"get":{"operationId":"bookingProviderAuthorityProfileList","summary":"List provider-neutral authority profiles","description":"Shadow provider capability profiles. Contract evidence only; it does not connect providers or grant authority.","tags":["booking-event-providers"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"profiles":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Registered provider key; never a core discriminator."},"integrationMode":{"enum":["native","mirrored","federated","embedded","referred"],"type":"string"},"supportState":{"enum":["supported","conditional","unsupported"],"type":"string"},"operationCodes":{"type":"array","minItems":1,"items":{"enum":["read","create","update","publish","broadcast","hold","commit","cancel","refund","fulfill","scan","reconcile"],"type":"string"},"description":"Provider operation capabilities; presentation actions are listed separately."},"actions":{"type":"array","minItems":1,"items":{"enum":["display","control","broadcast","transact","reconcile"],"type":"string"},"description":"High-level display, control, broadcast, transact, or reconcile actions."},"authorityScopes":{"type":"array","minItems":1,"items":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"description":"Canonical target scopes for which the profile may declare capabilities."},"synthetic":{"type":"boolean"}},"required":["providerKey","integrationMode","supportState","operationCodes","actions","authorityScopes","synthetic"],"additionalProperties":false,"description":"Provider-neutral discovery profile. It advertises support but grants no connection, authority, or permission."}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["profiles","nextCursor"],"additionalProperties":false},"example":{"profiles":[{"providerKey":"cvent","integrationMode":"federated","supportState":"supported","operationCodes":["read","broadcast","reconcile"],"actions":["display","broadcast","reconcile"],"authorityScopes":["presentation","schedule","location","lifecycle"],"synthetic":false},{"providerKey":"constellation_ops","integrationMode":"native","supportState":"conditional","operationCodes":["read","create","update","publish","reconcile"],"actions":["display","control","reconcile"],"authorityScopes":["presentation","schedule","location","lifecycle","sales"],"synthetic":true}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/providers/authority/admissibility/evaluate":{"post":{"operationId":"bookingProviderAuthorityAdmissibilityEvaluate","summary":"Evaluate provider-authority admissibility evidence","description":"Pure, advisory evaluation of typed authority evidence. It does not authenticate the caller, grant permission, execute a provider operation, persist provenance, or authorize a mutation.","tags":["booking-event-providers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"admissibility":{"type":"object","properties":{"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"operation":{"enum":["read","create","update","publish","broadcast","hold","commit","cancel","refund","fulfill","scan","reconcile"],"type":"string"},"effectiveAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"actor":{"anyOf":[{"type":"object","properties":{"actorType":{"const":"user"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"identityId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"actingOnBehalfOf":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."},{"type":"null"}]}},"required":["actorType","userId","identityId","actingOnBehalfOf"],"additionalProperties":false},{"type":"object","properties":{"actorType":{"const":"service_agent"},"agentId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"actingOnBehalfOf":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."}},"required":["actorType","agentId","actingOnBehalfOf"],"additionalProperties":false},{"type":"object","properties":{"actorType":{"const":"api_key"},"apiKeyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOf":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."}},"required":["actorType","apiKeyId","actingOnBehalfOf"],"additionalProperties":false},{"type":"object","properties":{"actorType":{"const":"system"},"systemKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"actingOnBehalfOf":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."},{"type":"null"}]}},"required":["actorType","systemKey","actingOnBehalfOf"],"additionalProperties":false}]},"priorAuthorizationEvidence":{"anyOf":[{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"issuer":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"actorDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"principal":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."},"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"operation":{"enum":["read","create","update","publish","broadcast","hold","commit","cancel","refund","fulfill","scan","reconcile"],"type":"string"},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"decision":{"const":"allow"}},"required":["id","schemaVersion","issuer","actorDigest","organizationId","principal","canonicalTarget","authorityScope","operation","issuedAt","expiresAt","digest","decision"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"issuer":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"actorDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"principal":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."},"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"operation":{"enum":["read","create","update","publish","broadcast","hold","commit","cancel","refund","fulfill","scan","reconcile"],"type":"string"},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"decision":{"const":"deny"},"reasonCode":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"required":["id","schemaVersion","issuer","actorDigest","organizationId","principal","canonicalTarget","authorityScope","operation","issuedAt","expiresAt","digest","decision","reasonCode"],"additionalProperties":false}],"description":"Host-issued prior authorization bound to actor, organization, target, scope, and operation."},{"type":"null"}]},"authorityAssignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"principal":{"anyOf":[{"type":"object","properties":{"kind":{"const":"sonik"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_connection"},"connection":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."}},"required":["kind","connection"],"additionalProperties":false}]},"effectiveFrom":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"evidenceRef":{"type":"string","minLength":1}},"required":["id","schemaVersion","version","canonicalTarget","authorityScope","principal","effectiveFrom","effectiveUntil","evidenceRef"],"additionalProperties":false,"description":"Non-cascading authority for one exact canonical target and scope."}},"operationGrants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerConnection":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."},"bindingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"operation":{"enum":["read","create","update","publish","broadcast","hold","commit","cancel","refund","fulfill","scan","reconcile"],"type":"string"},"action":{"enum":["display","control","broadcast","transact","reconcile"],"type":"string"},"integrationMode":{"enum":["native","mirrored","federated","embedded","referred"],"type":"string"},"supportState":{"enum":["supported","conditional","unsupported"],"type":"string"},"conditionRefs":{"type":"array","items":{"type":"string","minLength":1}},"policyRefs":{"type":"array","items":{"type":"string","minLength":1}},"degradationBehavior":{"enum":["reject","read_only","redirect","queue_for_reconcile","manual_review"],"type":"string"},"effectiveFrom":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"effectiveUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]}},"required":["id","schemaVersion","version","providerConnection","bindingId","canonicalTarget","authorityScope","operation","action","integrationMode","supportState","conditionRefs","policyRefs","degradationBehavior","effectiveFrom","effectiveUntil"],"additionalProperties":false,"description":"Operation-specific provider capability; connection alone grants no permission."}},"conditionReceipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"grantId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"grantVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"operation":{"enum":["read","create","update","publish","broadcast","hold","commit","cancel","refund","fulfill","scan","reconcile"],"type":"string"},"decision":{"enum":["allow","deny"],"type":"string"},"evaluatorRef":{"type":"string","minLength":1},"policyRef":{"type":"string","minLength":1},"inputDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"reasonCodes":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}},"evaluatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["id","schemaVersion","grantId","grantVersion","canonicalTarget","authorityScope","operation","decision","evaluatorRef","policyRef","inputDigest","reasonCodes","evaluatedAt","expiresAt","digest"],"additionalProperties":false}},"targetVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"causalEvidenceRefs":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}}},"required":["canonicalTarget","authorityScope","operation","effectiveAt","actor","priorAuthorizationEvidence","authorityAssignments","operationGrants","conditionReceipts","targetVersion","causalEvidenceRefs"],"additionalProperties":false,"description":"Typed evidence required for a pure admissibility review; it is not a complete authorization request."},"providerConnections":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."},"description":"Provider connection evidence referenced by assignments, grants, and bindings."},"externalBindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerConnection":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."},"canonicalTarget":{"type":"object","properties":{"targetKind":{"enum":["event","event_session","venue_place","space","resource_type","resource_unit","offer","booking","ticket","entitlement"],"type":"string"},"targetId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["targetKind","targetId","organizationId"],"additionalProperties":false,"description":"Provider-neutral reference to one Sonik-owned canonical object."},"externalEntityType":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"externalId":{"type":"string","minLength":1},"providerVersion":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"providerEtag":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"providerCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectionSchemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"payload":{"type":"object","properties":{"namespace":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"reference":{"type":"string","minLength":1},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["namespace","reference","digest"],"additionalProperties":false},"lifecycleState":{"enum":["active","inactive","tombstoned"],"type":"string"},"syncState":{"enum":["pending","in_sync","reconciling","conflict","error"],"type":"string"},"lastReconciliation":{"anyOf":[{"type":"object","properties":{"status":{"enum":["matched","changed","missing","conflict","error"],"type":"string"},"reconciledAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reasonCodes":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."}}},"required":["status","reconciledAt","reasonCodes"],"additionalProperties":false},{"type":"null"}]}},"required":["id","schemaVersion","version","providerConnection","canonicalTarget","externalEntityType","externalId","providerVersion","providerEtag","providerCursor","projectionSchemaVersion","payload","lifecycleState","syncState","lastReconciliation"],"additionalProperties":false,"description":"Identity/projection mapping that grants no authority or permission."},"description":"Identity-only external bindings; bindings grant no authority."},"proposedMutationProvenance":{"anyOf":[{"type":"object","properties":{"actor":{"anyOf":[{"type":"object","properties":{"actorType":{"const":"user"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"identityId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"actingOnBehalfOf":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."},{"type":"null"}]}},"required":["actorType","userId","identityId","actingOnBehalfOf"],"additionalProperties":false},{"type":"object","properties":{"actorType":{"const":"service_agent"},"agentId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"actingOnBehalfOf":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."}},"required":["actorType","agentId","actingOnBehalfOf"],"additionalProperties":false},{"type":"object","properties":{"actorType":{"const":"api_key"},"apiKeyId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOf":{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."}},"required":["actorType","apiKeyId","actingOnBehalfOf"],"additionalProperties":false},{"type":"object","properties":{"actorType":{"const":"system"},"systemKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"actingOnBehalfOf":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"organization"},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","organizationId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false}],"description":"Concrete principal an actor is authorized to represent; audiences are never principals."},{"type":"null"}]}},"required":["actorType","systemKey","actingOnBehalfOf"],"additionalProperties":false}]},"providerCause":{"anyOf":[{"type":"object","properties":{"providerConnection":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."},"bindingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"externalRequestId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"providerVersion":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["providerConnection","bindingId","externalRequestId","providerVersion"],"additionalProperties":false},{"type":"null"}]},"correlationId":{"type":"string","minLength":1},"clientRequestId":{"type":"string","minLength":1},"commandRef":{"type":"string","minLength":1},"authorizationEvidenceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"causalEvidenceRefs":{"type":"array","items":{"type":"string","minLength":1}},"occurredAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"receivedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["actor","providerCause","correlationId","clientRequestId","commandRef","authorizationEvidenceId","causalEvidenceRefs","occurredAt","receivedAt","digest"],"additionalProperties":false,"description":"Authorized commercial actor plus immutable causal provider evidence when applicable."},{"type":"null"}],"description":"Proposed immutable mutation provenance to inspect; it is not persisted by this shadow operation."}},"required":["admissibility","providerConnections","externalBindings","proposedMutationProvenance"],"additionalProperties":false,"description":"Complete evidence envelope for a pure provider-authority admissibility review."},"example":{"admissibility":{"canonicalTarget":{"targetKind":"event","targetId":"10000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002"},"authorityScope":"schedule","operation":"update","effectiveAt":"2026-07-18T12:00:00.000Z","actor":{"actorType":"service_agent","agentId":"agent_authority_fixture","actingOnBehalfOf":{"kind":"organization","organizationId":"10000000-0000-4000-8000-000000000002"}},"priorAuthorizationEvidence":{"id":"10000000-0000-4000-8000-000000000006","schemaVersion":1,"issuer":"booking_host","actorDigest":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","organizationId":"10000000-0000-4000-8000-000000000002","principal":{"kind":"organization","organizationId":"10000000-0000-4000-8000-000000000002"},"canonicalTarget":{"targetKind":"event","targetId":"10000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002"},"authorityScope":"schedule","operation":"update","decision":"allow","issuedAt":"2026-07-18T12:00:00.000Z","expiresAt":"2026-07-19T12:00:00.000Z","digest":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"},"authorityAssignments":[{"id":"10000000-0000-4000-8000-000000000005","schemaVersion":1,"version":2,"canonicalTarget":{"targetKind":"event","targetId":"10000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002"},"authorityScope":"schedule","principal":{"kind":"sonik"},"effectiveFrom":"2026-07-18T12:00:00.000Z","effectiveUntil":"2026-07-19T12:00:00.000Z","evidenceRef":"authority:fixture"}],"operationGrants":[],"conditionReceipts":[],"targetVersion":4,"causalEvidenceRefs":["command:event-schedule-update"]},"providerConnections":[],"externalBindings":[],"proposedMutationProvenance":null}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"anyOf":[{"type":"object","properties":{"kind":{"const":"admissible"},"owningPrincipal":{"anyOf":[{"type":"object","properties":{"kind":{"const":"sonik"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_connection"},"connection":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."}},"required":["kind","connection"],"additionalProperties":false}]},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"matchedAssignment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["id","version"],"additionalProperties":false},"matchedGrant":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["id","version"],"additionalProperties":false},{"type":"null"}]},"matchedConditionReceipt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["id","version"],"additionalProperties":false},{"type":"null"}]},"executionBranch":{"enum":["sonik_native","provider_executed","provider_projection"],"type":"string"},"integrationMode":{"anyOf":[{"const":"native"},{"enum":["native","mirrored","federated","embedded","referred"],"type":"string"}]},"priorAuthorizationEvidence":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["id","schemaVersion","digest"],"additionalProperties":false},"targetVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"causalEvidenceRefs":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"decisionDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","owningPrincipal","authorityScope","matchedAssignment","matchedGrant","matchedConditionReceipt","executionBranch","integrationMode","priorAuthorizationEvidence","targetVersion","causalEvidenceRefs","decisionDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deny"},"reasonCode":{"enum":["prior_authorization_missing","prior_authorization_denied","prior_authorization_not_yet_valid","prior_authorization_expired","actor_mismatch","organization_mismatch","principal_mismatch","target_mismatch","scope_mismatch","operation_mismatch","authority_missing","provider_connection_inactive","provider_grant_missing","capability_scope_mismatch","provider_grant_unsupported","capability_condition_missing","capability_condition_mismatch","capability_condition_expired","capability_condition_denied"],"type":"string"},"owner":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"sonik"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_connection"},"connection":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"connectionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"providerAccountRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"enum":["pending","active","suspended","revoked"],"type":"string"},"configurationVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["providerKey","connectionId","organizationId","providerAccountRef","status","configurationVersion"],"additionalProperties":false,"description":"Provider configuration/provenance reference; never an actor or authorization."}},"required":["kind","connection"],"additionalProperties":false}]},{"type":"null"}]},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"},"failedCondition":{"type":"string","minLength":1},"allowedAlternatives":{"type":"array","items":{"type":"string","minLength":1}},"remediation":{"type":"string","minLength":1},"decisionDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","reasonCode","owner","authorityScope","failedCondition","allowedAlternatives","remediation","decisionDigest"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"conflict"},"conflict":{"anyOf":[{"type":"object","properties":{"conflictType":{"const":"authority_assignment"},"records":{"type":"array","minItems":2,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"authorityScope":{"enum":["presentation","schedule","location","lifecycle","session_catalog","registration_configuration","enrollment","inventory","sales","pricing_policy_binding","allocation_binding","fulfillment_template","allocation_commitment","commercial_snapshot","provider_fulfillment","issuance","assignment","status","access_rules","usage"],"type":"string"}},"required":["id","version","authorityScope"],"additionalProperties":false}}},"required":["conflictType","records"],"additionalProperties":false},{"type":"object","properties":{"conflictType":{"const":"operation_grant"},"records":{"type":"array","minItems":2,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"supportState":{"enum":["supported","conditional","unsupported"],"type":"string"},"degradationBehavior":{"enum":["reject","read_only","redirect","queue_for_reconcile","manual_review"],"type":"string"}},"required":["id","version","supportState","degradationBehavior"],"additionalProperties":false}}},"required":["conflictType","records"],"additionalProperties":false},{"type":"object","properties":{"conflictType":{"const":"condition_receipt"},"records":{"type":"array","minItems":2,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"decision":{"enum":["allow","deny"],"type":"string"}},"required":["id","version","decision"],"additionalProperties":false}}},"required":["conflictType","records"],"additionalProperties":false}]},"noMutationPermitted":{"const":true},"remediation":{"const":"manual_review"},"decisionDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["kind","conflict","noMutationPermitted","remediation","decisionDigest"],"additionalProperties":false}],"description":"Deterministic advisory decision: admissible evidence, fail-closed denial, or conflict requiring manual review."},"reviewPosture":{"const":"advisory_only"},"authorizationComplete":{"const":false},"mutationPermitted":{"const":false}},"required":["decision","reviewPosture","authorizationComplete","mutationPermitted"],"additionalProperties":false,"description":"Pure review result. Even an admissible decision is evidence only and does not complete authorization or permit mutation."},"example":{"decision":{"kind":"admissible","owningPrincipal":{"kind":"sonik"},"authorityScope":"schedule","matchedAssignment":{"id":"10000000-0000-4000-8000-000000000005","version":2},"matchedGrant":null,"matchedConditionReceipt":null,"executionBranch":"sonik_native","integrationMode":"native","priorAuthorizationEvidence":{"id":"10000000-0000-4000-8000-000000000006","schemaVersion":1,"digest":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"targetVersion":4,"causalEvidenceRefs":["command:event-schedule-update"],"decisionDigest":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"},"reviewPosture":"advisory_only","authorizationComplete":false,"mutationPermitted":false}}}},"401":{"description":"A trusted authenticated actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"422":{"description":"The provider-neutral authority evidence envelope is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PROVIDER_AUTHORITY_EVIDENCE_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PROVIDER_AUTHORITY_EVIDENCE_INVALID","message":"Example"}}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/zones":{"post":{"operationId":"bookingEventAccessZoneCreate","summary":"Create an event access zone","description":"Creates a named event-scoped access zone. The stable code is immutable after creation so issued zone entitlements remain understandable.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable event-scoped zone code."},"name":{"type":"string","minLength":1,"maxLength":200},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["code","name","clientRequestId"],"additionalProperties":false},"example":{"code":"green_room","name":"Green room","clientRequestId":"zone-create-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","code","name","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"50000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","code":"green_room","name":"Green room","status":"active","version":1,"createdAt":"2026-07-17T12:15:00.000Z","updatedAt":"2026-07-17T12:15:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The zone code or clientRequestId conflicts with existing event state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_ZONE_CODE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_ZONE_CODE_CONFLICT","message":"Example"}}}}},"422":{"description":"The access-zone body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_ZONE_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_ZONE_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventAccessZoneList","summary":"List event access zones","description":"Lists the event-scoped zones that entitlement templates and zone-entry access points may reference.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"zones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","code","name","status","version","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["zones","nextCursor"],"additionalProperties":false},"example":{"zones":[{"id":"50000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","code":"green_room","name":"Green room","status":"active","version":1,"createdAt":"2026-07-17T12:15:00.000Z","updatedAt":"2026-07-17T12:15:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The access-zone cursor is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_ZONE_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_ZONE_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/zones/{zoneId}":{"patch":{"operationId":"bookingEventAccessZoneUpdate","summary":"Update an event access zone","description":"Renames or disables a zone with optimistic concurrency. Disabling prevents new authorization but preserves issued grants and audit history.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"zoneId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"50000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"patch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"status":{"enum":["active","disabled"],"type":"string"}},"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["expectedVersion","patch","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"patch":{"name":"Green room east"},"clientRequestId":"zone-update-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"code":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","code","name","status","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"50000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","code":"green_room","name":"Green room","status":"active","version":1,"createdAt":"2026-07-17T12:15:00.000Z","updatedAt":"2026-07-17T12:15:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event access zone was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_ZONE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_ZONE_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The zone version or clientRequestId conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_ZONE_VERSION_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_ZONE_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The access-zone patch is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_ZONE_PATCH_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_ZONE_PATCH_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/points":{"post":{"operationId":"bookingEventAccessPointCreate","summary":"Create an event access point","description":"Creates one explicit venue-entry, zone-entry, or session-entry checkpoint. Purpose and target are immutable so scan meaning is never inferred from order or mutable labels.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"purpose":{"const":"venue_entry"}},"required":["name","clientRequestId","purpose"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"purpose":{"const":"zone_entry"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["name","clientRequestId","purpose","zoneId"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"clientRequestId":{"type":"string","minLength":1,"maxLength":200},"purpose":{"const":"session_entry"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["name","clientRequestId","purpose","sessionId"],"additionalProperties":false}]},"example":{"name":"Green room east entrance","purpose":"zone_entry","zoneId":"50000000-0000-4000-8000-000000000001","clientRequestId":"point-create-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"venue_entry"}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"zone_entry"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"session_entry"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose","sessionId"],"additionalProperties":false}]},"example":{"id":"50000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Green room east entrance","status":"active","purpose":"zone_entry","zoneId":"50000000-0000-4000-8000-000000000001","version":1,"createdAt":"2026-07-17T12:16:00.000Z","updatedAt":"2026-07-17T12:16:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event or referenced zone/session target was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND","EVENT_ACCESS_TARGET_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The clientRequestId was reused with a different access point.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_IDEMPOTENCY_CONFLICT","message":"Example"}}}}},"422":{"description":"The access-point body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_POINT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_POINT_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventAccessPointList","summary":"List event access points","description":"Lists configured venue, zone, and session checkpoints for scanner setup and event operations.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accessPoints":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"venue_entry"}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"zone_entry"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"session_entry"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose","sessionId"],"additionalProperties":false}]}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["accessPoints","nextCursor"],"additionalProperties":false},"example":{"accessPoints":[{"id":"50000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Green room east entrance","status":"active","purpose":"zone_entry","zoneId":"50000000-0000-4000-8000-000000000001","version":1,"createdAt":"2026-07-17T12:16:00.000Z","updatedAt":"2026-07-17T12:16:00.000Z"}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The access-point cursor is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_POINT_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_POINT_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/points/{accessPointId}":{"patch":{"operationId":"bookingEventAccessPointUpdate","summary":"Update an event access point","description":"Renames or disables an access point with optimistic concurrency. Changing its purpose or target requires a new access point.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"accessPointId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"50000000-0000-4000-8000-000000000002"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"patch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"status":{"enum":["active","disabled"],"type":"string"}},"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["expectedVersion","patch","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"patch":{"name":"Green room entrance"},"clientRequestId":"point-update-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"venue_entry"}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"zone_entry"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"status":{"enum":["active","disabled"],"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"purpose":{"const":"session_entry"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","organizationId","eventId","name","status","version","createdAt","updatedAt","purpose","sessionId"],"additionalProperties":false}]},"example":{"id":"50000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Green room east entrance","status":"active","purpose":"zone_entry","zoneId":"50000000-0000-4000-8000-000000000001","version":1,"createdAt":"2026-07-17T12:16:00.000Z","updatedAt":"2026-07-17T12:16:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event access point was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_POINT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_POINT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The access-point version or clientRequestId conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_POINT_VERSION_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_POINT_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The access-point patch is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_POINT_PATCH_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_POINT_PATCH_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/sessions":{"post":{"operationId":"bookingEventSessionCreate","summary":"Create an event session","description":"Creates one scheduled sub-session without duplicating eligibility. Offers are the sole eligibility authority through session_access.sessionIds or session_selection.eligibleSessionIds entitlement templates; finite Session capacity is represented only by an optional inventory pool.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1,"maxLength":100},"location":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event_zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}]}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"snapshot":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false},{"type":"null"}],"default":null}},"required":["kind"],"additionalProperties":false}],"description":"Typed Session sublocation. Physical snapshots preserve location evidence but grant no Venue or access authority."},"capacityInventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"zoneId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["name","description","startsAt","endsAt","timezone","location","capacityInventoryPoolId","zoneId","clientRequestId"],"additionalProperties":false},"example":{"name":"Acoustic room","description":"A separately permissioned set inside the event.","startsAt":"2026-08-15T21:00:00.000Z","endsAt":"2026-08-15T22:00:00.000Z","timezone":"America/New_York","location":{"kind":"event_zone","zoneId":"20000000-0000-4000-8000-000000000003"},"capacityInventoryPoolId":"30000000-0000-4000-8000-000000000001","zoneId":"20000000-0000-4000-8000-000000000003","clientRequestId":"session-create-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"location":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event_zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}]}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"snapshot":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false},{"type":"null"}],"default":null}},"required":["kind"],"additionalProperties":false}],"description":"Typed Session sublocation. Physical snapshots preserve location evidence but grant no Venue or access authority."},"status":{"enum":["scheduled","cancelled","completed"],"type":"string"},"capacityInventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Inventory pool used only when the Session has finite counted capacity; null means no counted-capacity claim."},"zoneId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","name","description","startsAt","endsAt","timezone","location","status","capacityInventoryPoolId","zoneId","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000004","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Acoustic room","description":"A separately permissioned set inside the event.","startsAt":"2026-08-15T21:00:00.000Z","endsAt":"2026-08-15T22:00:00.000Z","timezone":"America/New_York","location":{"kind":"event_zone","zoneId":"20000000-0000-4000-8000-000000000003"},"status":"scheduled","capacityInventoryPoolId":"30000000-0000-4000-8000-000000000001","zoneId":"20000000-0000-4000-8000-000000000003","createdAt":"2026-07-17T12:10:00.000Z","updatedAt":"2026-07-17T12:10:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event or a referenced zone or reserve was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND","EVENT_SESSION_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The clientRequestId was reused with a different session.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_IDEMPOTENCY_CONFLICT","message":"Example"}}}}},"422":{"description":"The typed event-session body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventSessionList","summary":"List event sessions","description":"Lists event sessions for Offer construction, attendee selection, and access planning. offerId is a derived filter over session_access.sessionIds and session_selection.eligibleSessionIds on Offer entitlement templates; Session records do not own an inverse Offer list.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"offerId","in":"query","schema":{"type":"string","format":"uuid","description":"Derived filter over Offer entitlement templates that reference each Session."},"allowEmptyValue":true,"allowReserved":true,"example":"20000000-0000-4000-8000-000000000001"},{"name":"status","in":"query","schema":{"enum":["scheduled","cancelled","completed"],"type":"string","description":"Optional session lifecycle filter."},"allowEmptyValue":true,"allowReserved":true,"example":"scheduled"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"location":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event_zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}]}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"snapshot":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false},{"type":"null"}],"default":null}},"required":["kind"],"additionalProperties":false}],"description":"Typed Session sublocation. Physical snapshots preserve location evidence but grant no Venue or access authority."},"status":{"enum":["scheduled","cancelled","completed"],"type":"string"},"capacityInventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Inventory pool used only when the Session has finite counted capacity; null means no counted-capacity claim."},"zoneId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","name","description","startsAt","endsAt","timezone","location","status","capacityInventoryPoolId","zoneId","version","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["sessions","nextCursor"],"additionalProperties":false},"example":{"sessions":[{"id":"20000000-0000-4000-8000-000000000004","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Acoustic room","description":"A separately permissioned set inside the event.","startsAt":"2026-08-15T21:00:00.000Z","endsAt":"2026-08-15T22:00:00.000Z","timezone":"America/New_York","location":{"kind":"event_zone","zoneId":"20000000-0000-4000-8000-000000000003"},"status":"scheduled","capacityInventoryPoolId":"30000000-0000-4000-8000-000000000001","zoneId":"20000000-0000-4000-8000-000000000003","createdAt":"2026-07-17T12:10:00.000Z","updatedAt":"2026-07-17T12:10:00.000Z","version":1}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The cursor, status, or derived Offer-entitlement filter is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/sessions/{sessionId}":{"patch":{"operationId":"bookingEventSessionUpdate","summary":"Update an event session","description":"Updates a scheduled Session without accepting inverse Offer eligibility. Adoption must merge the patch into the current record and parse the complete BookingEventSessionRecordSchema before mutation so cross-field start/end invariants remain enforced. Offer entitlement templates remain the sole eligibility authority; capacity-inventory-pool replacement is atomic when the inventory pool changes.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"sessionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000004"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"patch":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1,"maxLength":100},"location":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event_zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}]}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"snapshot":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false},{"type":"null"}],"default":null}},"required":["kind"],"additionalProperties":false}],"description":"Typed Session sublocation. Physical snapshots preserve location evidence but grant no Venue or access authority."},"capacityInventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"zoneId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["expectedVersion","patch","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"patch":{"name":"Acoustic room updated"},"clientRequestId":"session-update-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"location":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event_zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}]}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"snapshot":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false},{"type":"null"}],"default":null}},"required":["kind"],"additionalProperties":false}],"description":"Typed Session sublocation. Physical snapshots preserve location evidence but grant no Venue or access authority."},"status":{"enum":["scheduled","cancelled","completed"],"type":"string"},"capacityInventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Inventory pool used only when the Session has finite counted capacity; null means no counted-capacity claim."},"zoneId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","name","description","startsAt","endsAt","timezone","location","status","capacityInventoryPoolId","zoneId","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000004","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Acoustic room","description":"A separately permissioned set inside the event.","startsAt":"2026-08-15T21:00:00.000Z","endsAt":"2026-08-15T22:00:00.000Z","timezone":"America/New_York","location":{"kind":"event_zone","zoneId":"20000000-0000-4000-8000-000000000003"},"status":"scheduled","capacityInventoryPoolId":"30000000-0000-4000-8000-000000000001","zoneId":"20000000-0000-4000-8000-000000000003","createdAt":"2026-07-17T12:10:00.000Z","updatedAt":"2026-07-17T12:10:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event session or a referenced zone or reserve was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_NOT_FOUND","EVENT_SESSION_REFERENCE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The session version, issued grants, capacity, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_VERSION_CONFLICT","EVENT_SESSION_ALLOCATION_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The typed event-session patch is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_PATCH_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_PATCH_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/sessions/{sessionId}/cancel":{"post":{"operationId":"bookingEventSessionCancel","summary":"Cancel an event session","description":"Cancels one session without cancelling the parent event. Existing ticket grants remain auditable and access authorization denies the cancelled session.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"sessionId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"20000000-0000-4000-8000-000000000004"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"clientRequestId":"session-cancel-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"timezone":{"type":"string","minLength":1},"location":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venue":{"type":"object","properties":{"venuePlaceId":{"type":"string","format":"uuid","description":"Pre-existing canonical Venue identity; this reference cannot create one."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Immutable Venue evidence captured for the Event."}},"required":["venuePlaceId","snapshot"],"additionalProperties":false,"description":"Reference plus immutable evidence for a governed Venue."}},"required":["kind","venue"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"organization_space"},"spaceId":{"type":"string","format":"uuid","description":"Organization-scoped Space identity."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Space location evidence captured for the Event."},"venueOrigin":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical_venue"},"venuePlaceId":{"type":"string","format":"uuid","description":"Canonical Event UUID."}},"required":["kind","venuePlaceId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"unregistered_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false}},"required":["kind","externalPlace"],"additionalProperties":false}]}},"required":["kind","spaceId","snapshot","venueOrigin"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"external_place"},"externalPlace":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false,"description":"Provider-owned place reference."},"snapshot":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false,"description":"Location evidence captured for the Event."}},"required":["kind","externalPlace","snapshot"],"additionalProperties":false}]},{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"event_zone"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"online"},"channel":{"anyOf":[{"type":"object","properties":{"publicUrl":{"type":"string","format":"uri","description":"Public Event channel URL; credentials and join secrets are forbidden."},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Optional online provider registry key."}},"required":["publicUrl","displayName"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"kind":{"const":"private"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"deliveryMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret private access delivery path; join credentials remain outside the Event contract."}},"required":["kind","displayName","deliveryMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"invite"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"invitationMethod":{"anyOf":[{"enum":["email","in_app","manual"],"type":"string"},{"type":"null"}],"description":"Non-secret invitation delivery path; invitation credentials remain outside the Event contract."}},"required":["kind","displayName","invitationMethod"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"provider_delivered"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Human-facing channel label."},"providerKey":{"anyOf":[{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase registry key; not a user-facing label."},{"type":"null"}],"description":"Online provider registry key."},"externalChannelId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider-owned channel identifier; never a join secret."}},"required":["kind","displayName","providerKey","externalChannelId"],"additionalProperties":false}]}]}},"required":["kind","channel"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"tbd"},"snapshot":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Venue name captured for this Event."},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"description":"Primary street-address line."},"line2":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional secondary address line."},"locality":{"type":"string","minLength":1,"description":"City, municipality, or locality."},"region":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"State, province, or region."},"postalCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Postal or ZIP code."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country code."}},"additionalProperties":false,"description":"Partial postal evidence captured at Event authoring time; publication readiness determines whether it is sufficient."},"coordinates":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees."}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}],"description":"Optional map coordinates captured with the location snapshot."},"timezone":{"type":"string","minLength":1,"description":"Venue-local IANA time zone."},"accessibility":{"anyOf":[{"type":"object","properties":{"status":{"const":"unknown"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"known"},"wheelchairEntrance":{"type":"boolean"},"accessibleParking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"accessibleRestroom":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["status","wheelchairEntrance","accessibleParking","accessibleRestroom"],"additionalProperties":false}],"description":"Known accessibility evidence; unknown is explicit and never inferred."},"externalReferences":{"type":"array","items":{"type":"object","properties":{"providerKey":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Provider registry key."},"externalId":{"type":"string","minLength":1,"description":"Provider-owned place identifier."},"externalVersion":{"type":"string","minLength":1,"description":"Optional provider revision, ETag, or version captured with the reference."}},"required":["providerKey","externalId"],"additionalProperties":false},"description":"Provider place identifiers retained as non-authoritative evidence."}},"additionalProperties":false},{"type":"null"}],"default":null}},"required":["kind"],"additionalProperties":false}],"description":"Typed Session sublocation. Physical snapshots preserve location evidence but grant no Venue or access authority."},"status":{"enum":["scheduled","cancelled","completed"],"type":"string"},"capacityInventoryPoolId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Inventory pool used only when the Session has finite counted capacity; null means no counted-capacity claim."},"zoneId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","name","description","startsAt","endsAt","timezone","location","status","capacityInventoryPoolId","zoneId","version","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"20000000-0000-4000-8000-000000000004","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","name":"Acoustic room","description":"A separately permissioned set inside the event.","startsAt":"2026-08-15T21:00:00.000Z","endsAt":"2026-08-15T22:00:00.000Z","timezone":"America/New_York","location":{"kind":"event_zone","zoneId":"20000000-0000-4000-8000-000000000003"},"status":"scheduled","capacityInventoryPoolId":"30000000-0000-4000-8000-000000000001","zoneId":"20000000-0000-4000-8000-000000000003","createdAt":"2026-07-17T12:10:00.000Z","updatedAt":"2026-07-17T12:10:00.000Z","version":1}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event session was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The session version conflicts or the session cannot transition to cancelled.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_VERSION_CONFLICT","EVENT_SESSION_LIFECYCLE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_VERSION_CONFLICT","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/tickets/{ticketId}/session-selection":{"post":{"operationId":"bookingEventTicketSelectSessions","summary":"Select sessions for a ticket","description":"Replaces or rejects a Ticket's concrete Session grants using the pinned Offer-version authority captured in the Ticket's issuance entitlement snapshot, then materializes concrete grants. Selection bounds, overlapping windows, and capacity are validated; replacement is atomic or compensating and may not drop prior seats before success.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000003"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"conflictResolution":{"enum":["reject","replace"],"type":"string"},"expectedTicketVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["sessionIds","conflictResolution","expectedTicketVersion","clientRequestId"],"additionalProperties":false},"example":{"sessionIds":["20000000-0000-4000-8000-000000000004"],"conflictResolution":"reject","expectedTicketVersion":1,"clientRequestId":"session-select-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Offer version pinned at ticket issuance."},"buyerBookingId":{"type":"string","format":"uuid","description":"Booking that owns the commercial purchase. Attendee assignment does not change this buyer chain."},"buyerBookingLineId":{"type":"string","format":"uuid","description":"Booking line that issued this one admission unit."},"ownerPersonId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Canonical Sonik Identity person that owns this credential. Null is migration-only and cannot be claimed."},"attendee":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"const":"identity"},"identityId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","identityId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"customer"},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","customerId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"guest"},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."}},"required":["kind","userId"],"additionalProperties":false}],"description":"Person assigned to attend. This is distinct from the buyer booking."},{"type":"null"}]},"status":{"enum":["active","revoked","expired","voided"],"type":"string"},"entitlements":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}},"seat":{"type":"string","minLength":1,"description":"Reserved seat key (e.g. F-12); absent for general admission."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Optimistic concurrency version."},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","eventId","offerId","offerVersion","buyerBookingId","buyerBookingLineId","ownerPersonId","attendee","status","entitlements","version","issuedAt","updatedAt"],"additionalProperties":false},"selectedSessionIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"droppedSessionIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"replayed":{"type":"boolean"}},"required":["ticket","selectedSessionIds","droppedSessionIds","replayed"],"additionalProperties":false},"example":{"ticket":{"id":"99999999-9999-4999-8999-999999999999","organizationId":"11111111-1111-4111-8111-111111111111","eventId":"22222222-2222-4222-8222-222222222222","offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"buyerBookingId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","buyerBookingLineId":"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb","ownerPersonId":null,"attendee":{"kind":"identity","identityId":"cccccccc-cccc-4ccc-8ccc-cccccccccccc"},"status":"active","entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":"2026-07-20T19:00:00.000Z","validUntil":"2026-07-20T22:00:00.000Z","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["55555555-5555-4555-8555-555555555555"],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"},{"id":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","kind":"session_selection","status":"active","validFrom":null,"validUntil":null,"consumption":{"mode":"non_consuming"},"policyBindingIds":[],"policyDecisionReceiptIds":[],"eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"selectedSessionIds":["20000000-0000-4000-8000-000000000004"],"materializedEntitlementIds":["ffffffff-ffff-4fff-8fff-ffffffffffff"],"label":"Choose your conference session"},{"id":"ffffffff-ffff-4fff-8fff-ffffffffffff","kind":"session_access","status":"active","validFrom":null,"validUntil":null,"consumption":{"mode":"non_consuming"},"policyBindingIds":[],"policyDecisionReceiptIds":[],"sessionId":"20000000-0000-4000-8000-000000000004"}],"version":2,"issuedAt":"2026-07-20T20:00:00.000Z","updatedAt":"2026-07-20T20:00:00.000Z"},"selectedSessionIds":["20000000-0000-4000-8000-000000000004"],"droppedSessionIds":[],"replayed":false}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event ticket or requested session was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND","EVENT_SESSION_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The Ticket's pinned Offer version does not authorize the requested Sessions, or materialized-grant capacity, overlap, Ticket version, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_VERSION_CONFLICT","EVENT_SESSION_SELECTION_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_VERSION_CONFLICT","message":"Example"}}}}},"422":{"description":"The session-selection body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_SESSION_SELECTION_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_SESSION_SELECTION_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/tickets/{ticketId}/entitlements":{"get":{"operationId":"bookingEventTicketListEntitlements","summary":"List ticket entitlements","description":"Returns the Ticket's typed entitlement snapshot, including concrete access grants and any pending session-selection authority. Resource assignments and booking party members are deliberately absent.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000003"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entitlements":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"event_entry"},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eventId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"zone_access"},"zoneId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","zoneId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_access"},"sessionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","sessionId"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"session_selection"},"eligibleSessionIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"minimumSelections":{"type":"integer","minimum":0,"maximum":9007199254740991},"maximumSelections":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0},"selectedSessionIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"materializedEntitlementIds":{"type":"array","maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"label":{"type":"string","minLength":1}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","eligibleSessionIds","minimumSelections","maximumSelections","selectedSessionIds","materializedEntitlementIds","label"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"resource_access"},"resource":{"anyOf":[{"type":"object","properties":{"kind":{"const":"resource_type"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceTypeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource_unit"},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["kind","resourceUnitId"],"additionalProperties":false}]}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","resource"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["active","revoked","consumed"],"type":"string"},"validFrom":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"consumption":{"anyOf":[{"type":"object","properties":{"mode":{"const":"non_consuming"}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"const":"metered"},"maximumUses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"counterScope":{"enum":["grant","access_point"],"type":"string","description":"Whether all access points share one counter or each access point has its own."},"reset":{"enum":["never","calendar_day"],"type":"string","description":"When the metered counter resets in the event timezone."}},"required":["mode","maximumUses","counterScope","reset"],"additionalProperties":false}],"description":"Typed re-entry and use-limit rule. One metered use with reset=never is single-entry; non-consuming grants do not decrement a counter."},"policyBindingIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"kind":{"const":"access_point_access"},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["id","status","validFrom","validUntil","consumption","policyBindingIds","policyDecisionReceiptIds","kind","accessPointId"],"additionalProperties":false}]}}},"required":["entitlements"],"additionalProperties":false},"example":{"entitlements":[{"id":"dddddddd-dddd-4ddd-8ddd-dddddddddddd","kind":"event_entry","status":"active","validFrom":"2026-07-20T19:00:00.000Z","validUntil":"2026-07-20T22:00:00.000Z","consumption":{"mode":"metered","maximumUses":1,"counterScope":"grant","reset":"never"},"policyBindingIds":["55555555-5555-4555-8555-555555555555"],"policyDecisionReceiptIds":[],"eventId":"22222222-2222-4222-8222-222222222222"},{"id":"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee","kind":"session_selection","status":"active","validFrom":null,"validUntil":null,"consumption":{"mode":"non_consuming"},"policyBindingIds":[],"policyDecisionReceiptIds":[],"eligibleSessionIds":["20000000-0000-4000-8000-000000000004"],"minimumSelections":1,"maximumSelections":1,"selectedSessionIds":["20000000-0000-4000-8000-000000000004"],"materializedEntitlementIds":["ffffffff-ffff-4fff-8fff-ffffffffffff"],"label":"Choose your conference session"},{"id":"ffffffff-ffff-4fff-8fff-ffffffffffff","kind":"session_access","status":"active","validFrom":null,"validUntil":null,"consumption":{"mode":"non_consuming"},"policyBindingIds":[],"policyDecisionReceiptIds":[],"sessionId":"20000000-0000-4000-8000-000000000004"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event ticket was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/tickets/{ticketId}/credential":{"get":{"operationId":"bookingEventTicketCredentialGet","summary":"Get a ticket's QR credential","description":"Returns the signed QR credential of one active Ticket: the token the ticket email carries, which scan-qr admits. A revoked, voided or expired Ticket has no credential. The token is a bearer secret; callers must never log it.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000003"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"format":{"const":"ticket-qr.v1"},"qrToken":{"type":"string","minLength":1,"maxLength":2048},"iat":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Signed issue time in epoch seconds: the Ticket's delivery command time, so the token equals the emailed one. scan-qr refuses it as qr_expired once it is older than the validity window."}},"required":["ticketId","format","qrToken","iat"],"additionalProperties":false},"example":{"ticketId":"40000000-0000-4000-8000-000000000003","format":"ticket-qr.v1","qrToken":"eyJ0aWNrZXRJZCI6IjQwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMyIsImlhdCI6MTc5MDAwMDAwMH0.example-signature-not-a-real-mac","iat":1790000000}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event ticket was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The ticket is revoked, voided or expired, so it has no credential.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_ACTIVE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_ACTIVE","message":"Example"}}}}},"422":{"description":"The Event or Ticket identifier is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_INPUT_INVALID","message":"Example"}}}}},"503":{"description":"The ticket QR signing secret is not provisioned.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_UNAVAILABLE","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/public/ticket-access/{token}":{"get":{"operationId":"bookingPublicTicketAccessResolve","summary":"Resolve a WhatsApp ticket link","description":"Public. Resolves the signed link a WhatsApp ticket receipt carries to its order: event, start, the masked checkout phone and the active ticket count. Nothing beyond the mask. An unknown or forged link is 404; an authentic expired one answers expired: true.","tags":["booking-event-access"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":44,"maxLength":512,"pattern":"^[A-Za-z0-9_-]+$","description":"The signed ticket link token from the WhatsApp receipt's button URL."},"example":"eyJvcmRlcklkIjoiNjAwMDAwMDAtMDAwMC00MDAwLTgwMDAtMDAwMDAwMDAwMDAxIiwicGVyc29uSWQiOiI3MDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAwMDEiLCJleHAiOjE3OTMwMDAwMDB9exampleSignatureNotARealMacXXXXXXXXXXXXXX"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"embeddingId":{"type":"string","format":"uuid","description":"The embedding the buyer checked out on (a comp sent to a phone: the page this Event first sold on, else the organizer's first page, else the order id when there is no page, a neutral look): the page's theme, and the embeddingId the tickets assertion binds."},"eventName":{"type":"string","minLength":1,"maxLength":512},"startsAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"phoneMasked":{"type":"string","pattern":"^\\+\\d{1,3} \\u2022\\u2022\\u2022\\u2022 \\d{4}$","description":"The verified checkout phone (a comp: the phone it was sent to), masked: country code and last four digits."},"ticketCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Active tickets on the order."},"expired":{"type":"boolean","description":"The link is authentic but past its 24 h expiry; the tickets read refuses it (410)."}},"required":["orderId","embeddingId","eventName","startsAt","phoneMasked","ticketCount","expired"],"additionalProperties":false},"example":{"orderId":"60000000-0000-4000-8000-000000000001","embeddingId":"f133ba92-704a-4b75-9ca8-44cb77b5a069","eventName":"Tarab x Cúpula","startsAt":"2026-10-31T01:00:00.000Z","phoneMasked":"+57 •••• 4567","ticketCount":2,"expired":false}}}},"404":{"description":"The ticket link is unknown or forged.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["TICKET_ACCESS_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"TICKET_ACCESS_NOT_FOUND","message":"Example"}}}}},"503":{"description":"The ticket link signing secret is not provisioned.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["TICKET_ACCESS_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"TICKET_ACCESS_UNAVAILABLE","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/public/ticket-access/{token}/tickets":{"post":{"operationId":"bookingPublicTicketAccessTickets","summary":"Open a WhatsApp ticket link's tickets","description":"Public route, customer-session gated: answers the order's active tickets with their door QR once the body's customer checkout assertion names the link's buyer (same person, the checkout phone). Another person, a bad or absent assertion: 403. Expired link: 410. The QR tokens are bearer credentials; callers must never log them.","tags":["booking-event-access"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":44,"maxLength":512,"pattern":"^[A-Za-z0-9_-]+$","description":"The signed ticket link token from the WhatsApp receipt's button URL."},"example":"eyJvcmRlcklkIjoiNjAwMDAwMDAtMDAwMC00MDAwLTgwMDAtMDAwMDAwMDAwMDAxIiwicGVyc29uSWQiOiI3MDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAwMDEiLCJleHAiOjE3OTMwMDAwMDB9exampleSignatureNotARealMacXXXXXXXXXXXXXX"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assertion":{"type":"string","minLength":1,"maxLength":4096,"description":"The customer checkout assertion (x-sonik-customer-checkout-assertion shape, CUSTOMER_CHECKOUT_ASSERTION_SECRET) the app signs after the buyer's OTP: personId and phone from the identity session, embeddingId from the resolve answer, sessionId = the orderId, step verify."}},"required":["assertion"],"additionalProperties":false},"example":{"assertion":"eyJ2Ijoic29uaWsuY3VzdG9tZXJfY2hlY2tvdXQudjEifQ.example-assertion-signature"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"qrToken":{"type":"string","minLength":1,"maxLength":2048},"status":{"const":"active"},"tierName":{"type":"string","minLength":1,"maxLength":200}},"required":["ticketId","qrToken","status","tierName"],"additionalProperties":false}}},"required":["tickets"],"additionalProperties":false},"example":{"tickets":[{"ticketId":"40000000-0000-4000-8000-000000000003","qrToken":"eyJ0aWNrZXRJZCI6IjQwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMyIsImlhdCI6MTc5MDAwMDAwMH0.example-signature-not-a-real-mac","status":"active","tierName":"General admission"}]}}}},"403":{"description":"The customer assertion is absent, invalid, or names someone other than the link's buyer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["TICKET_ACCESS_FORBIDDEN"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"TICKET_ACCESS_FORBIDDEN","message":"Example"}}}}},"404":{"description":"The ticket link is unknown or forged.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["TICKET_ACCESS_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"TICKET_ACCESS_NOT_FOUND","message":"Example"}}}}},"410":{"description":"The ticket link is past its 24 h expiry.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["TICKET_ACCESS_EXPIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"TICKET_ACCESS_EXPIRED","message":"Example"}}}}},"503":{"description":"The ticket link or customer assertion secret is not provisioned.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["TICKET_ACCESS_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"TICKET_ACCESS_UNAVAILABLE","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/events/{eventId}/access/authorize":{"post":{"operationId":"bookingEventAccessAuthorize","summary":"Authorize event access","description":"Evaluates a ticket against an explicit venue, zone, or session access point without recording a scan. Actor identity, organization, and permission are derived from authenticated host context; event scope, grant validity, session status, venue-first policy, and duplicate state contribute typed reasons and policy receipts.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["ticketId","accessPointId","observedAt","clientRequestId"],"additionalProperties":false},"example":{"ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"50000000-0000-4000-8000-000000000002","observedAt":"2026-08-15T20:58:01.000Z","clientRequestId":"access-authorize-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"allow"},"reason":{"const":"allowed"},"matchedEntitlementId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"previousScanId":{"type":"null"},"consumesUse":{"type":"boolean"}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"deny"},"reason":{"enum":["access_point_not_found","access_point_inactive","credential_not_found","ticket_revoked","ticket_expired","wrong_event","wrong_zone","wrong_purpose","missing_entitlement","grant_revoked","grant_expired","venue_entry_required","outside_access_window","event_cancelled","session_cancelled","access_point_disabled","use_limit_reached","meter_spent","actor_forbidden","already_admitted","qr_invalid","qr_expired","qr_event_mismatch"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The first admitting scan when the reason is already_admitted; null otherwise."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"replay"},"reason":{"const":"duplicate_replay"},"replayedDecision":{"enum":["allow","deny"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","replayedDecision","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false}]},"example":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"40000000-0000-4000-8000-000000000004","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:58:02.000Z","policyDecisionReceiptIds":["40000000-0000-4000-8000-000000000006"]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event ticket or access point was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND","EVENT_ACCESS_POINT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The access authorization body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/scans":{"post":{"operationId":"bookingEventAccessRecordScan","summary":"Record an event access scan","description":"Atomically authorizes and records an access attempt. Actor identity, organization, and permission are derived from authenticated host context. The clientRequestId is organization/event scoped; duplicate delivery returns a replay decision and never consumes a second use.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["ticketId","accessPointId","observedAt","clientRequestId"],"additionalProperties":false},"example":{"ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"50000000-0000-4000-8000-000000000002","observedAt":"2026-08-15T20:58:01.000Z","clientRequestId":"access-scan-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"clientRequestId":{"type":"string","minLength":1},"actor":{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},"decision":{"anyOf":[{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"allow"},"reason":{"const":"allowed"},"matchedEntitlementId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"previousScanId":{"type":"null"},"consumesUse":{"type":"boolean"}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"deny"},"reason":{"enum":["access_point_not_found","access_point_inactive","credential_not_found","ticket_revoked","ticket_expired","wrong_event","wrong_zone","wrong_purpose","missing_entitlement","grant_revoked","grant_expired","venue_entry_required","outside_access_window","event_cancelled","session_cancelled","access_point_disabled","use_limit_reached","meter_spent","actor_forbidden","already_admitted","qr_invalid","qr_expired","qr_event_mismatch"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The first admitting scan when the reason is already_admitted; null otherwise."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"replay"},"reason":{"const":"duplicate_replay"},"replayedDecision":{"enum":["allow","deny"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","replayedDecision","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false}]},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"recordedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reversedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"reversalReason":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"reversalActor":{"anyOf":[{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},{"type":"null"}]}},"required":["id","organizationId","clientRequestId","actor","decision","observedAt","recordedAt","reversedAt","reversalReason","reversalActor"],"additionalProperties":false},"example":{"id":"40000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","clientRequestId":"scanner-7:attempt-991","actor":{"actorType":"service_agent","actorId":"40000000-0000-4000-8000-000000000002","actingOnBehalfOfOrganizationId":"10000000-0000-4000-8000-000000000002","permission":"booking.event.access.scan"},"decision":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"40000000-0000-4000-8000-000000000004","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:58:02.000Z","policyDecisionReceiptIds":["40000000-0000-4000-8000-000000000006"]},"observedAt":"2026-08-15T20:58:01.000Z","recordedAt":"2026-08-15T20:58:02.000Z","reversedAt":null,"reversalReason":null,"reversalActor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event ticket or access point was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_TICKET_NOT_FOUND","EVENT_ACCESS_POINT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_TICKET_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The scan lost a concurrent entitlement/use-limit race or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_CONCURRENCY_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_CONCURRENCY_CONFLICT","message":"Example"}}}}},"422":{"description":"The access scan body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingEventAccessScanList","summary":"List event access scans","description":"Lists the Event's recorded scans in recorded order, each the record that record-scan or reverse answered; a reversed scan carries reversedAt, its reason and actor. Filters by ticket, access point and decision; includeReversed false leaves reversed scans out. scan-qr refusals and replays are never recorded, so they never list.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque cursor from the prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size, from 1 to 100."},"allowEmptyValue":true,"allowReserved":true,"example":25},{"name":"ticketId","in":"query","schema":{"type":"string","format":"uuid","description":"Only the scans of this Ticket."},"allowEmptyValue":true,"allowReserved":true},{"name":"accessPointId","in":"query","schema":{"type":"string","format":"uuid","description":"Only the scans at this access point."},"allowEmptyValue":true,"allowReserved":true,"example":"40000000-0000-4000-8000-000000000004"},{"name":"decision","in":"query","schema":{"enum":["allow","deny"],"type":"string","description":"Only allowed or only denied scans; the two decisions a scan row records."},"allowEmptyValue":true,"allowReserved":true,"example":"allow"},{"name":"includeReversed","in":"query","schema":{"type":"boolean","default":true,"description":"Whether reversed scans (reversedAt set) are listed. Default true: the list is the door log."},"allowEmptyValue":true,"allowReserved":true,"example":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"scans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"clientRequestId":{"type":"string","minLength":1},"actor":{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},"decision":{"anyOf":[{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"allow"},"reason":{"const":"allowed"},"matchedEntitlementId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"previousScanId":{"type":"null"},"consumesUse":{"type":"boolean"}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"deny"},"reason":{"enum":["access_point_not_found","access_point_inactive","credential_not_found","ticket_revoked","ticket_expired","wrong_event","wrong_zone","wrong_purpose","missing_entitlement","grant_revoked","grant_expired","venue_entry_required","outside_access_window","event_cancelled","session_cancelled","access_point_disabled","use_limit_reached","meter_spent","actor_forbidden","already_admitted","qr_invalid","qr_expired","qr_event_mismatch"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The first admitting scan when the reason is already_admitted; null otherwise."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"replay"},"reason":{"const":"duplicate_replay"},"replayedDecision":{"enum":["allow","deny"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","replayedDecision","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false}]},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"recordedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reversedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"reversalReason":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"reversalActor":{"anyOf":[{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},{"type":"null"}]}},"required":["id","organizationId","clientRequestId","actor","decision","observedAt","recordedAt","reversedAt","reversalReason","reversalActor"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["scans","nextCursor"],"additionalProperties":false},"example":{"scans":[{"id":"40000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","clientRequestId":"scanner-7:attempt-991","actor":{"actorType":"service_agent","actorId":"40000000-0000-4000-8000-000000000002","actingOnBehalfOfOrganizationId":"10000000-0000-4000-8000-000000000002","permission":"booking.event.access.scan"},"decision":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"40000000-0000-4000-8000-000000000004","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:58:02.000Z","policyDecisionReceiptIds":["40000000-0000-4000-8000-000000000006"]},"observedAt":"2026-08-15T20:58:01.000Z","recordedAt":"2026-08-15T20:58:02.000Z","reversedAt":null,"reversalReason":null,"reversalActor":null},{"id":"40000000-0000-4000-8000-000000000007","organizationId":"10000000-0000-4000-8000-000000000002","clientRequestId":"scanner-7:attempt-992","actor":{"actorType":"service_agent","actorId":"40000000-0000-4000-8000-000000000002","actingOnBehalfOfOrganizationId":"10000000-0000-4000-8000-000000000002","permission":"booking.event.access.scan"},"decision":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"40000000-0000-4000-8000-000000000004","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:59:02.000Z","policyDecisionReceiptIds":["40000000-0000-4000-8000-000000000006"]},"observedAt":"2026-08-15T20:59:01.000Z","recordedAt":"2026-08-15T20:59:02.000Z","reversedAt":"2026-08-15T21:10:00.000Z","reversalReason":"Wrong guest admitted","reversalActor":{"actorType":"user","actorId":"40000000-0000-4000-8000-000000000008","actingOnBehalfOfOrganizationId":"10000000-0000-4000-8000-000000000002","permission":"booking.event.access.reverse"}}],"nextCursor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The scan filters, cursor or page size are invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_SCAN_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_SCAN_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/scan-qr":{"post":{"operationId":"bookingEventAccessScanQr","summary":"Admit a signed ticket QR","description":"Reads a signed ticket QR through the one evaluator and records the access decision under the caller's clientRequestId. Refusals are answered by name (qr_invalid, qr_expired, qr_event_mismatch, already_admitted) and are not recorded as scans. A same-id retry answers the first result unchanged; an admit carries the seat when the ticket has one.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qrToken":{"type":"string","minLength":1,"maxLength":2048},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["qrToken","accessPointId","observedAt","clientRequestId"],"additionalProperties":false},"example":{"qrToken":"40000000-0000-4000-8000-000000000003.1786827481.c2lnbmF0dXJl","accessPointId":"50000000-0000-4000-8000-000000000002","observedAt":"2026-08-15T20:58:01.000Z","clientRequestId":"access-scan-qr-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"allow"},"reason":{"const":"allowed"},"matchedEntitlementId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"previousScanId":{"type":"null"},"consumesUse":{"type":"boolean"},"scanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The scan row the decision was recorded as; null when the token was refused before recording."},"seat":{"type":"string","minLength":1,"description":"The ticket's seat, when it has one."}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse","scanId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"deny"},"reason":{"enum":["access_point_not_found","access_point_inactive","credential_not_found","ticket_revoked","ticket_expired","wrong_event","wrong_zone","wrong_purpose","missing_entitlement","grant_revoked","grant_expired","venue_entry_required","outside_access_window","event_cancelled","session_cancelled","access_point_disabled","use_limit_reached","meter_spent","actor_forbidden","already_admitted","qr_invalid","qr_expired","qr_event_mismatch"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The first admitting scan when the reason is already_admitted; null otherwise."},"consumesUse":{"const":false},"scanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The scan row the decision was recorded as; null when the token was refused before recording."},"seat":{"type":"string","minLength":1,"description":"The ticket's seat, when it has one."}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse","scanId"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"replay"},"reason":{"const":"duplicate_replay"},"replayedDecision":{"enum":["allow","deny"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"consumesUse":{"const":false},"scanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The scan row the decision was recorded as; null when the token was refused before recording."},"seat":{"type":"string","minLength":1,"description":"The ticket's seat, when it has one."}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","replayedDecision","matchedEntitlementId","previousScanId","consumesUse","scanId"],"additionalProperties":false}]},"example":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"50000000-0000-4000-8000-000000000002","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:58:02.000Z","policyDecisionReceiptIds":[],"scanId":"40000000-0000-4000-8000-000000000001","seat":"F-12"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event or access point was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND","EVENT_ACCESS_POINT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_POINT_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The scan lost a concurrent entitlement/use-limit race or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_CONCURRENCY_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_CONCURRENCY_CONFLICT","message":"Example"}}}}},"422":{"description":"The scan-qr body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/admitted-count":{"get":{"operationId":"bookingEventAccessAdmittedCount","summary":"Count event admissions","description":"Counts the Event's allowed scans, for the whole Event or one access point: admitted are not reversed, reversed were. Every device reads the same server count. A count of admissions, not people: a re-entry admits again.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"accessPointId","in":"query","schema":{"type":"string","format":"uuid","description":"Count only this access point's scans; omitted, the whole Event."},"allowEmptyValue":true,"allowReserved":true,"example":"40000000-0000-4000-8000-000000000004"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"admitted":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Allowed scans that are not reversed."},"reversed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Allowed scans that were later reversed."},"asOf":{"type":"string","format":"date-time","description":"Server time the count was read."}},"required":["admitted","reversed","asOf"],"additionalProperties":false},"example":{"admitted":1,"reversed":1,"asOf":"2026-08-15T21:15:00.000Z"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event was not found in the actor organization.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_NOT_FOUND","message":"Example"}}}}},"422":{"description":"The access point filter is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_SCAN_FILTER_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_SCAN_FILTER_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/scans/{scanId}/reverse":{"post":{"operationId":"bookingEventAccessReverseScan","summary":"Reverse an event access scan","description":"Reverses an allowed scan with a required reason. The authenticated host context supplies the immutable reversal actor; the original record remains append-only and a replay cannot reverse twice.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"scanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"40000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["reason","clientRequestId"],"additionalProperties":false},"example":{"reason":"Operator correction.","clientRequestId":"scan-reverse-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"clientRequestId":{"type":"string","minLength":1},"actor":{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},"decision":{"anyOf":[{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"allow"},"reason":{"const":"allowed"},"matchedEntitlementId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"previousScanId":{"type":"null"},"consumesUse":{"type":"boolean"}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"deny"},"reason":{"enum":["access_point_not_found","access_point_inactive","credential_not_found","ticket_revoked","ticket_expired","wrong_event","wrong_zone","wrong_purpose","missing_entitlement","grant_revoked","grant_expired","venue_entry_required","outside_access_window","event_cancelled","session_cancelled","access_point_disabled","use_limit_reached","meter_spent","actor_forbidden","already_admitted","qr_invalid","qr_expired","qr_event_mismatch"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The first admitting scan when the reason is already_admitted; null otherwise."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"replay"},"reason":{"const":"duplicate_replay"},"replayedDecision":{"enum":["allow","deny"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","replayedDecision","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false}]},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"recordedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reversedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"reversalReason":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"reversalActor":{"anyOf":[{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},{"type":"null"}]}},"required":["id","organizationId","clientRequestId","actor","decision","observedAt","recordedAt","reversedAt","reversalReason","reversalActor"],"additionalProperties":false},"example":{"id":"40000000-0000-4000-8000-000000000001","organizationId":"10000000-0000-4000-8000-000000000002","clientRequestId":"scanner-7:attempt-991","actor":{"actorType":"service_agent","actorId":"40000000-0000-4000-8000-000000000002","actingOnBehalfOfOrganizationId":"10000000-0000-4000-8000-000000000002","permission":"booking.event.access.scan"},"decision":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"40000000-0000-4000-8000-000000000004","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:58:02.000Z","policyDecisionReceiptIds":["40000000-0000-4000-8000-000000000006"]},"observedAt":"2026-08-15T20:58:01.000Z","recordedAt":"2026-08-15T20:58:02.000Z","reversedAt":null,"reversalReason":null,"reversalActor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"Example"}}}}},"404":{"description":"The event access scan was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_SCAN_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_SCAN_NOT_FOUND","message":"Example"}}}}},"409":{"description":"The scan was denied, already reversed, no longer reversible, or clientRequestId conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_SCAN_REVERSAL_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_SCAN_REVERSAL_CONFLICT","message":"Example"}}}}},"422":{"description":"The scan-reversal body is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_REVERSAL_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_REVERSAL_INPUT_INVALID","message":"Example"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/offline-leases":{"post":{"operationId":"bookingEventAccessOfflineLeaseIssue","summary":"Issue an offline scanner lease","description":"Registers or reuses one event-scoped scanner device key and issues a bounded signed lease. Organization, actor, evaluator revision, sequence range, and validity windows are server-owned.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device":{"type":"object","properties":{"deviceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1,"maxLength":200},"publicJwk":{"type":"object","properties":{"kty":{"const":"OKP"},"crv":{"const":"Ed25519"},"alg":{"const":"EdDSA"},"use":{"const":"sig"},"kid":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"x":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","description":"Unpadded base64url Ed25519 public key material."}},"required":["kty","crv","alg","use","kid","x"],"additionalProperties":false}},"required":["deviceId","name","publicJwk"],"additionalProperties":false},"accessPointIds":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"requestedTtlSeconds":{"type":"integer","minimum":900,"maximum":43200,"default":14400},"maximumAttempts":{"type":"integer","minimum":1,"maximum":10000},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["device","accessPointIds","maximumAttempts","clientRequestId"],"additionalProperties":false},"example":{"device":{"deviceId":"50000000-0000-4000-8000-000000000001","name":"North gate iPad","publicJwk":{"kty":"OKP","crv":"Ed25519","alg":"EdDSA","use":"sig","kid":"north-gate-1","x":"11qYAYafhZM1ERnT-v3R1xUDhBRmQ8hB4R2pX1Rmds4"}},"accessPointIds":["40000000-0000-4000-8000-000000000004"],"requestedTtlSeconds":14400,"maximumAttempts":100,"clientRequestId":"offline-lease-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deviceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deviceKeyId":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"snapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointIds":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"counterStart":{"type":"integer","minimum":0,"maximum":9007199254740991},"counterEnd":{"type":"integer","minimum":0,"maximum":9007199254740991},"evaluatorRevision":{"type":"string","minLength":1,"maxLength":100},"snapshotVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"notBefore":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reconcileBy":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"refreshAfter":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"mandatoryRefreshAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"enum":["active","revoked"],"type":"string"},"signedLease":{"type":"string","minLength":1,"maxLength":32768},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"revocationReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"revocationActor":{"anyOf":[{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},{"type":"null"}]}},"required":["id","organizationId","eventId","deviceId","deviceKeyId","snapshotId","accessPointIds","counterStart","counterEnd","evaluatorRevision","snapshotVersion","issuedAt","notBefore","expiresAt","reconcileBy","refreshAfter","mandatoryRefreshAt","status","signedLease","revokedAt","revocationReason","revocationActor"],"additionalProperties":false},"example":{"id":"50000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","deviceId":"50000000-0000-4000-8000-000000000001","deviceKeyId":"north-gate-1","snapshotId":"50000000-0000-4000-8000-000000000003","accessPointIds":["40000000-0000-4000-8000-000000000004"],"counterStart":1,"counterEnd":100,"evaluatorRevision":"booking-event-access.v1","snapshotVersion":1,"issuedAt":"2026-08-15T16:00:00.000Z","notBefore":"2026-08-15T16:00:00.000Z","expiresAt":"2026-08-15T20:00:00.000Z","reconcileBy":"2026-08-16T20:00:00.000Z","refreshAfter":"2026-08-15T16:15:00.000Z","mandatoryRefreshAt":"2026-08-15T19:00:00.000Z","status":"active","signedLease":"signed-lease-header.signed-lease-payload","revokedAt":null,"revocationReason":null,"revocationActor":null}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted authenticated booking actor is required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The Event or one of the requested active access points was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_LEASE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_LEASE_NOT_FOUND","message":"The Event or requested active access point was not found"}}}}},"409":{"description":"The scanner device or clientRequestId conflicts with existing immutable evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_DEVICE_CONFLICT","EVENT_ACCESS_OFFLINE_LEASE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_DEVICE_CONFLICT","message":"The scanner device is already registered differently"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The device key, access-point scope, or bounded lease request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_LEASE_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_LEASE_INVALID","message":"The bounded offline access lease request is invalid"}}}}},"503":{"description":"The booking auth context or offline Event-access cryptographic authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable","EVENT_ACCESS_OFFLINE_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/offline-leases/{leaseId}/revoke":{"post":{"operationId":"bookingEventAccessOfflineLeaseRevoke","summary":"Revoke an offline scanner lease","description":"Appends a revocation to one scanner lease. Attempts observed before revocation remain eligible for authoritative reconciliation; later attempts are retained for manual review.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"},{"name":"leaseId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"50000000-0000-4000-8000-000000000002"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["reason","clientRequestId"],"additionalProperties":false},"example":{"reason":"Scanner device was lost","clientRequestId":"offline-lease-revoke-001"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deviceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deviceKeyId":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Stable lowercase machine code."},"snapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointIds":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"counterStart":{"type":"integer","minimum":0,"maximum":9007199254740991},"counterEnd":{"type":"integer","minimum":0,"maximum":9007199254740991},"evaluatorRevision":{"type":"string","minLength":1,"maxLength":100},"snapshotVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"issuedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"notBefore":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reconcileBy":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"refreshAfter":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"mandatoryRefreshAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"status":{"enum":["active","revoked"],"type":"string"},"signedLease":{"type":"string","minLength":1,"maxLength":32768},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"revocationReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"revocationActor":{"anyOf":[{"type":"object","properties":{"actorType":{"enum":["user","service_agent"],"type":"string"},"actorId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"actingOnBehalfOfOrganizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"permission":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","description":"Permission proven for this event-scoped access action."}},"required":["actorType","actorId","actingOnBehalfOfOrganizationId","permission"],"additionalProperties":false,"description":"Immutable actor snapshot retained on every access decision and reversal."},{"type":"null"}]}},"required":["id","organizationId","eventId","deviceId","deviceKeyId","snapshotId","accessPointIds","counterStart","counterEnd","evaluatorRevision","snapshotVersion","issuedAt","notBefore","expiresAt","reconcileBy","refreshAfter","mandatoryRefreshAt","status","signedLease","revokedAt","revocationReason","revocationActor"],"additionalProperties":false},"example":{"id":"50000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","deviceId":"50000000-0000-4000-8000-000000000001","deviceKeyId":"north-gate-1","snapshotId":"50000000-0000-4000-8000-000000000003","accessPointIds":["40000000-0000-4000-8000-000000000004"],"counterStart":1,"counterEnd":100,"evaluatorRevision":"booking-event-access.v1","snapshotVersion":1,"issuedAt":"2026-08-15T16:00:00.000Z","notBefore":"2026-08-15T16:00:00.000Z","expiresAt":"2026-08-15T20:00:00.000Z","reconcileBy":"2026-08-16T20:00:00.000Z","refreshAfter":"2026-08-15T16:15:00.000Z","mandatoryRefreshAt":"2026-08-15T19:00:00.000Z","status":"revoked","signedLease":"signed-lease-header.signed-lease-payload","revokedAt":"2026-08-15T18:00:00.000Z","revocationReason":"Scanner device was lost","revocationActor":{"actorType":"user","actorId":"80000000-0000-4000-8000-000000000001","actingOnBehalfOfOrganizationId":"10000000-0000-4000-8000-000000000002","permission":"booking.event.manage"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted authenticated booking actor is required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event-scoped offline access lease was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_LEASE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_LEASE_NOT_FOUND","message":"The event-scoped offline access lease was not found"}}}}},"409":{"description":"The lease is already revoked or clientRequestId conflicts with prior evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_LEASE_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_LEASE_CONFLICT","message":"The offline access lease is already revoked"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The lease revocation request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_LEASE_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_LEASE_INVALID","message":"The lease revocation request is invalid"}}}}},"503":{"description":"The booking auth context or offline Event-access cryptographic authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable","EVENT_ACCESS_OFFLINE_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/access/scan-batches/reconcile":{"post":{"operationId":"bookingEventAccessReconcileScanBatch","summary":"Reconcile offline access attempts","description":"Verifies the signed server lease and device attempts, then re-runs the canonical online evaluator in device-sequence order. Offline results remain evidence; server results are final and exact replay cannot consume twice.","tags":["booking-event-access"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"example":"10000000-0000-4000-8000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"leaseToken":{"type":"string","minLength":1,"maxLength":32768},"attemptTokens":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","minLength":1,"maxLength":16384}},"clientRequestId":{"type":"string","minLength":1,"maxLength":200}},"required":["batchId","leaseToken","attemptTokens","clientRequestId"],"additionalProperties":false},"example":{"batchId":"92000000-0000-4000-8000-000000000001","leaseToken":"signed-lease-header.signed-lease-payload","attemptTokens":["signed-attempt-header.signed-attempt-payload"],"clientRequestId":"offline-batch-001"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"leaseId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deviceId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"evaluatorRevision":{"type":"string","minLength":1,"maxLength":100},"submittedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"reconciledAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"replayed":{"type":"boolean"},"items":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"sequence":{"type":"integer","minimum":0,"maximum":9007199254740991},"observedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"submittedDecision":{"enum":["allow","deny"],"type":"string"},"submittedReason":{"type":"string","minLength":1,"maxLength":100},"authoritativeDecision":{"anyOf":[{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"allow"},"reason":{"const":"allowed"},"matchedEntitlementId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"previousScanId":{"type":"null"},"consumesUse":{"type":"boolean"}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"deny"},"reason":{"enum":["access_point_not_found","access_point_inactive","credential_not_found","ticket_revoked","ticket_expired","wrong_event","wrong_zone","wrong_purpose","missing_entitlement","grant_revoked","grant_expired","venue_entry_required","outside_access_window","event_cancelled","session_cancelled","access_point_disabled","use_limit_reached","meter_spent","actor_forbidden","already_admitted","qr_invalid","qr_expired","qr_event_mismatch"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The first admitting scan when the reason is already_admitted; null otherwise."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false},{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"ticketId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"accessPointId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"decision":{"const":"replay"},"reason":{"const":"duplicate_replay"},"replayedDecision":{"enum":["allow","deny"],"type":"string"},"matchedEntitlementId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"previousScanId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"consumesUse":{"const":false}},"required":["eventId","ticketId","accessPointId","decidedAt","policyDecisionReceiptIds","decision","reason","replayedDecision","matchedEntitlementId","previousScanId","consumesUse"],"additionalProperties":false}]},"state":{"enum":["accepted","denied","duplicate","conflict","manual_review"],"type":"string"},"reconciliationReason":{"enum":["committed","authoritative_denial","duplicate_replay","attempt_collision","outside_lease_window","lease_revoked","reconciliation_window_elapsed"],"type":"string"},"decisionDrift":{"type":"boolean"},"evaluatorDrift":{"type":"boolean"},"scanId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["requestId","sequence","observedAt","submittedDecision","submittedReason","authoritativeDecision","state","reconciliationReason","decisionDrift","evaluatorDrift","scanId"],"additionalProperties":false}}},"required":["batchId","leaseId","organizationId","eventId","deviceId","evaluatorRevision","submittedAt","reconciledAt","replayed","items"],"additionalProperties":false},"example":{"batchId":"92000000-0000-4000-8000-000000000001","leaseId":"50000000-0000-4000-8000-000000000002","organizationId":"10000000-0000-4000-8000-000000000002","eventId":"10000000-0000-4000-8000-000000000001","deviceId":"50000000-0000-4000-8000-000000000001","evaluatorRevision":"booking-event-access.v1","submittedAt":"2026-08-15T20:05:00.000Z","reconciledAt":"2026-08-15T20:05:01.000Z","replayed":false,"items":[{"requestId":"93000000-0000-4000-8000-000000000001","sequence":1,"observedAt":"2026-08-15T20:05:00.000Z","submittedDecision":"allow","submittedReason":"credential_valid","authoritativeDecision":{"decision":"allow","reason":"allowed","eventId":"10000000-0000-4000-8000-000000000001","ticketId":"40000000-0000-4000-8000-000000000003","accessPointId":"40000000-0000-4000-8000-000000000004","matchedEntitlementId":"40000000-0000-4000-8000-000000000005","previousScanId":null,"consumesUse":true,"decidedAt":"2026-08-15T20:05:01.000Z","policyDecisionReceiptIds":[]},"state":"accepted","reconciliationReason":"committed","decisionDrift":false,"evaluatorDrift":false,"scanId":"50000000-0000-4000-8000-000000000006"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted authenticated booking actor is required"}}}}},"403":{"description":"Cookie-authenticated cross-origin booking mutations are forbidden.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"forbidden","message":"Cross-origin booking mutations are forbidden"}}}}},"404":{"description":"The event-scoped offline access lease was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_LEASE_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_LEASE_NOT_FOUND","message":"The event-scoped offline access lease was not found"}}}}},"409":{"description":"The batch, device sequence, signed attempt, or clientRequestId conflicts with retained evidence.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_BATCH_CONFLICT","EVENT_ACCESS_OFFLINE_ATTEMPT_CONFLICT","EVENT_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_BATCH_CONFLICT","message":"The batch is already bound to different retained evidence"}}}}},"415":{"description":"Booking JSON mutations require application/json.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unsupported_media_type"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unsupported_media_type","message":"Booking mutations require application/json"}}}}},"422":{"description":"The signed lease, attempt batch, or event scope is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_ACCESS_OFFLINE_BATCH_INVALID","EVENT_ACCESS_OFFLINE_LEASE_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_ACCESS_OFFLINE_BATCH_INVALID","message":"The signed lease or attempt batch is invalid"}}}}},"503":{"description":"The booking auth context or offline Event-access cryptographic authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["auth_context_unavailable","EVENT_ACCESS_OFFLINE_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"auth_context_unavailable","message":"Booking auth context could not be resolved from the configured Amplify session service."}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/guests":{"get":{"operationId":"bookingSearchGuests","summary":"Search guests/users for a reservation","description":"Searches persistent auth/user records already claimed into the current organization by name/email for reservation creation. This is the booking holder identity lookup; it does not search or create org-scoped customer marketing rows.","tags":["booking-guests"],"parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":120,"description":"Free-text search over user name/email (max 120 chars). Omitted = recent users."},"allowEmptyValue":true,"allowReserved":true},{"name":"page","in":"query","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"default":1,"description":"1-based page index (default 1)."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":-9007199254740991,"maximum":100,"exclusiveMinimum":0,"default":25,"description":"Page size (default 25, max 100)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"guests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"name":{"type":"string","description":"Auth/user display name."},"email":{"type":"string","format":"email","description":"Auth/user email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reserved for future canonical user-phone support; null today."},"createdAt":{"type":"string","description":"When the user record was created (ISO 8601)."},"updatedAt":{"type":"string","description":"When the user record was last edited (ISO 8601)."}},"required":["id","name","email","phone","createdAt","updatedAt"],"additionalProperties":false,"description":"Persistent auth/user record that can hold a booking."}},"page":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["page","limit","total"],"additionalProperties":false}},"required":["guests","page"],"additionalProperties":false,"description":"Paginated auth/user guest lookup for reservation creation."},"example":{"guests":[{"id":"user_018f9c10_7a1e_7c44_9b2a_3d5e6f701122","name":"Mateo Gómez","email":"mateo.gomez@example.com","phone":null,"createdAt":"2026-05-02T14:10:00.000Z","updatedAt":"2026-06-01T09:30:00.000Z"},{"id":"user_018f9c10_9b2f_7d55_ac3b_4e6f70812233","name":"Camila Torres","email":"guest-018f9c10@example.com","phone":null,"createdAt":"2026-05-18T17:45:00.000Z","updatedAt":"2026-05-18T17:45:00.000Z"},{"id":"user_018f9c10_ac30_7e66_bd4c_5f7081923344","name":"Mateo Restrepo","email":"m.restrepo@example.com","phone":null,"createdAt":"2026-06-05T11:20:00.000Z","updatedAt":"2026-06-05T11:20:00.000Z"}],"page":{"page":1,"limit":25,"total":3}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingCreateGuest","summary":"Create or return a guest/user","description":"Creates a persistent auth/user record for a reservation holder, or returns the existing user for the submitted email, then claims that user into the current organization. This writes booking identity, not customer CRM context.","tags":["booking-guests"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Guest/user display name."},"email":{"type":"string","format":"email","description":"Guest/user email. If it already exists, the existing user is returned and claimed into the current organization."},"phone":{"type":"string","maxLength":32,"description":"Accepted by the UI for operator entry but not persisted until canonical user-phone support lands."}},"required":["name","email"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"name":{"type":"string","description":"Auth/user display name."},"email":{"type":"string","format":"email","description":"Auth/user email."},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reserved for future canonical user-phone support; null today."},"createdAt":{"type":"string","description":"When the user record was created (ISO 8601)."},"updatedAt":{"type":"string","description":"When the user record was last edited (ISO 8601)."}},"required":["id","name","email","phone","createdAt","updatedAt"],"additionalProperties":false,"description":"Persistent auth/user record that can hold a booking."},"example":{"id":"user_018f9c10_7a1e_7c44_9b2a_3d5e6f701122","name":"Mateo Gómez","email":"mateo.gomez@example.com","phone":null,"createdAt":"2026-05-02T14:10:00.000Z","updatedAt":"2026-06-01T09:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: name and valid email required; phone optional; exact existing email is claimed into the current org.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/guests/{guestId}/context":{"get":{"operationId":"bookingGetGuestContext","summary":"Read one guest's bookings and orders","description":"Returns one guest's bookings and their Event orders across every Event in one read, so a caller need not know which Events to ask. The guest must be claimed into the caller's organization; any other guest is not found. Needs the same orders-read authority as eventOrderList.","tags":["booking-guests"],"parameters":[{"name":"guestId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"The guest (auth/user) id, claimed into the caller's organization."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"guestId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Booking id (booking.id)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (booking.organization_id, NOT NULL, RLS-scoped). Resolved from the session, never the request body."},"contextId":{"type":"string","format":"uuid","description":"The bookable_context this booking belongs to (booking.context_id → bookable_context.id). A tee time and a dinner reservation are the SAME shape, differing only in their context's kind/config."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}],"description":"Persistent auth/user id for the person holding the booking (booking.user_id). Null only for legacy/imported rows written before the identity transition."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional/deprecated org-scoped customer-context id (booking.customer_id). Not the booking holder identity."},"startsAt":{"type":"string","format":"date-time","description":"Window start (booking.starts_at)."},"endsAt":{"type":"string","format":"date-time","description":"Window end (booking.ends_at). Always strictly after startsAt."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of people in the party (booking.party_size, default 1, always >= 1)."},"status":{"enum":["booked","confirmed","cancelled","no_show","completed"],"type":"string","description":"Booking lifecycle status. text + CHECK open set (schema.ts:118-121); starts 'booked'. 'no_show' and 'completed' (attended) are the terminal attendance outcomes written by the attendance door (migration 0071 widened the CHECK). See BookingBookingsContractCompatibility.statusModel."},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"User who created the booking (booking.created_by, NULLable for system-originated rows)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Idempotency key echoed back (booking.client_request_id, NULLable). See BookingBookingsContractCompatibility.idempotency."},"createdAt":{"type":"string","format":"date-time","description":"Row creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last-modified timestamp (bumped by confirm / cancel / reschedule)."}},"required":["id","organizationId","contextId","userId","customerId","startsAt","endsAt","partySize","status","source","createdBy","clientRequestId","createdAt","updatedAt"],"additionalProperties":false,"description":"The unified booking object — one shape for tee times, table reservations, and every other venue_schedule/resource booking (spec AC #6). Mirrors the frozen `booking` table."},"description":"Every booking this guest holds in the organization."},"orders":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"orderNumber":{"type":"string","minLength":1},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"buyer":{"type":"object","properties":{"userId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Booking holder identity reference."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Optional deprecated organization customer-context reference."}},"required":["userId","customerId"],"additionalProperties":false},"purchasedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"orderState":{"enum":["created","committed","cancelled"],"type":"string","description":"Booking-owned order lifecycle state."},"payment":{"type":"object","properties":{"intentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"intentCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"enum":["not_started","awaiting_action","pending","succeeded","failed","expired","refunded","partially_refunded","reconciliation_required"],"type":"string","description":"Payment-owned state. Pending, unknown, queued, and reconciliation states are never paid."},"canonicalStatus":{"anyOf":[{"enum":["draft","awaiting_attempt","attempt_active","requires_customer_action","provider_pending","succeeded","failed","canceled","expired","reconciliation_required","refund_pending","refunded","partially_refunded"],"type":"string","description":"Canonical Sonik payment intent state."},{"type":"null"}]},"amountMinor":{"type":"number","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"activeAttempt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"provider":{"enum":["stripe","stripe_connect","mercadopago","mercadopago_connect","wompi_connect"],"type":"string","description":"Supported payment service provider boundary."},"status":{"enum":["created","dispatching","provider_pending","requires_action","succeeded","failed","canceled","expired","unknown","reconciliation_required","reconciled_not_paid"],"type":"string","description":"Canonical provider attempt state used to enforce single-active-attempt safety."}},"required":["id","provider","status"],"additionalProperties":false},{"type":"null"}]}},"required":["intentId","intentCount","state","canonicalStatus","amountMinor","currency","activeAttempt"],"additionalProperties":false},"refund":{"type":"object","properties":{"state":{"enum":["none","pending","partially_refunded","refunded","reconciliation_required"],"type":"string"},"refundedAmountMinor":{"type":"number","minimum":0},"commandCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","refundedAmountMinor","commandCount"],"additionalProperties":false},"cancellationReconciliation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"rootCommandId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"outcome":{"enum":["refund_required","no_refund_due","manual_review"],"type":"string","description":"Booking-owned reconciliation obligation. This is not Payment refund or provider state."},"workflowState":{"enum":["pending","manual_review","complete"],"type":"string"},"reasonCode":{"enum":["zero_total","payment_not_settled","already_refunded","pinned_policy_evidence_missing","payment_reconciliation_required","payment_evidence_ambiguous"],"type":"string"},"quoteSnapshotId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"quoteDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"policyDecisionReceiptIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"evidenceDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-f0-9]{64}$"},"owner":{"enum":["booking","payment","communications"],"type":"string"},"name":{"enum":["manual_review","refund","notify"],"type":"string"},"state":{"enum":["pending","blocked","acknowledged","failed"],"type":"string"},"requestDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"attemptCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"receiptReference":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["key","owner","name","state","requestDigest","attemptCount","receiptReference","lastErrorCode"],"additionalProperties":false}}},"required":["id","rootCommandId","outcome","workflowState","reasonCode","quoteSnapshotId","quoteDigest","policyDecisionReceiptIds","evidenceDigest","createdAt","steps"],"additionalProperties":false,"description":"Durable Booking reconciliation created with Event cancellation; Payment and communications retain their own truth."},{"type":"null"}]},"tickets":{"type":"object","properties":{"state":{"enum":["not_applicable","pending","issued","voided","blocked"],"type":"string","description":"Ticket-owned issuance posture derived from canonical ticket rows."},"expectedQuantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"issuedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"voidedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["state","expectedQuantity","issuedCount","voidedCount"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"offerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offerVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["offerId","offerVersion","quantity"],"additionalProperties":false}},"total":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountMinor","currency"],"additionalProperties":false},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"disagreements":{"type":"array","items":{"enum":["multiple_payment_intents","ticket_quantity_mismatch","tickets_issued_without_resolved_payment","payment_succeeded_without_issued_tickets","cancelled_order_with_active_payment_or_tickets"],"type":"string"}}},"required":["orderId","orderNumber","eventId","buyer","purchasedAt","orderState","payment","refund","cancellationReconciliation","tickets","lineItems","total","source","disagreements"],"additionalProperties":false},"description":"This guest's Event orders across every Event of the organization."},"ordersTruncated":{"type":"boolean","description":"true when an Event held more of this guest's orders than one page (100); read that Event's orders with eventOrderList for the rest."}},"required":["guestId","bookings","orders","ordersTruncated"],"additionalProperties":false,"description":"One guest's bookings beside their Event orders across every Event, inside the caller's organization."},"example":{"guestId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c","bookings":[{"id":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","organizationId":"b3c1f0a2-1d4e-4a7b-9c8d-2e3f4a5b6c7d","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"9b2fa1c4-3d5e-4f6a-8b7c-0d1e2f3a4b5c","startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z","partySize":4,"status":"confirmed","source":"web","createdBy":"1a2b3c4d-5e6f-4071-8293-a4b5c6d7e8f9","clientRequestId":"tee-2026-06-20-1500-pebble-9f3a","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:05:00.000Z","userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c"}],"orders":[{"orderId":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","orderNumber":"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa","eventId":"22222222-2222-4222-8222-222222222222","buyer":{"userId":"user_9b2fa1c4_3d5e_4f6a_8b7c_0d1e2f3a4b5c","customerId":null},"purchasedAt":"2026-07-20T20:00:00.000Z","orderState":"committed","payment":{"intentId":"77777777-7777-4777-8777-777777777777","intentCount":1,"state":"succeeded","canonicalStatus":"succeeded","amountMinor":8500,"currency":"USD","activeAttempt":null},"refund":{"state":"none","refundedAmountMinor":0,"commandCount":0},"cancellationReconciliation":null,"tickets":{"state":"issued","expectedQuantity":1,"issuedCount":1,"voidedCount":0},"lineItems":[{"offerId":"33333333-3333-4333-8333-333333333333","offerVersion":3,"quantity":1}],"total":{"amountMinor":8500,"currency":"USD"},"source":"web","disagreements":[]}],"ordersTruncated":false}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Guest not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"Event-order authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["SERVICE_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/customers/{customerId}":{"get":{"operationId":"bookingGetCustomer","summary":"Get one customer context by id","description":"Shadow CRM/customer context route. Customer rows are optional per-organization marketing/import records, not the reservation holder identity.","tags":["booking-customers"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Optional/deprecated org-scoped customer-context id (public.customers.id). Not the booking holder identity."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Optional/deprecated org-scoped customer-context id (public.customers.id). Not the booking holder identity."},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"type":"string","minLength":1,"maxLength":32},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","firstName","lastName","phone","email","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","organizationId":"018f9b00-1111-7000-8000-000000000abc","name":"Mateo Gómez","firstName":"Mateo","lastName":"Gómez","phone":"+573001112233","email":"mateo.gomez@example.com","createdAt":"2026-05-02T14:10:00.000Z","updatedAt":"2026-06-01T09:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Customer not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]},"patch":{"operationId":"bookingUpdateCustomer","summary":"Update a customer context","description":"Shadow CRM/customer context update. Does not mutate auth/user identity.","tags":["booking-customers"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Optional/deprecated org-scoped customer-context id (public.customers.id). Not the booking holder identity."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"phone":{"type":"string","minLength":1,"maxLength":32},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Optional/deprecated org-scoped customer-context id (public.customers.id). Not the booking holder identity."},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"type":"string","minLength":1,"maxLength":32},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","firstName","lastName","phone","email","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","organizationId":"018f9b00-1111-7000-8000-000000000abc","name":"Mateo Gómez","firstName":"Mateo","lastName":"Gómez","phone":"+573001112233","email":"mateo.gomez@example.com","createdAt":"2026-05-02T14:10:00.000Z","updatedAt":"2026-06-01T09:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Customer not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: phone, if supplied, stays non-empty; unknown keys rejected.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/house-accounts":{"post":{"operationId":"bookingOpenHouseAccount","summary":"Open (or fetch) a member's house account","description":"Operator op. Opens a house account — a member's 'tab' — for a customer, or returns the existing one. Idempotent by the one-account-per-(org, customer) rule: calling it twice for the same member returns the same account with 200, never a conflict. Responds with the account and its computed balance. Shadow contract: no adapter is mounted yet.","tags":["booking-house-accounts"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","description":"The member to open (or fetch) a tab for. One account per (org, customer)."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency for a newly opened tab (defaults to USD). Ignored when an account already exists."}},"required":["customerId"],"additionalProperties":false,"description":"get-or-open input — idempotent against the (org, customer) UNIQUE constraint."}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"House-account id."},"organizationId":{"type":"string","format":"uuid","description":"Org that owns the account (RLS-scoped)."},"customerId":{"type":"string","format":"uuid","description":"The single member this tab belongs to (FK → public.customers.id). One account per (org, customer) — see oneAccountPerPerson."},"status":{"enum":["active","closed"],"type":"string","description":"House-account lifecycle status (house_account.status, default 'active'). 'active' tabs accept new entries; 'closed' tabs are read-only."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code for the ledger (house_account.currency, default USD)."},"createdAt":{"type":"string","description":"Account open timestamp (ISO 8601)."},"updatedAt":{"type":"string","description":"Last-updated timestamp (ISO 8601)."},"balanceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Computed running balance = SUM(amount_cents) over all entries. Positive = member owes the house; negative = house owes the member (credit). Never stored (see computedBalance)."}},"required":["id","organizationId","customerId","status","currency","createdAt","updatedAt","balanceCents"],"additionalProperties":false,"description":"A house account plus its computed balance (see BookingHouseAccountsContractCompatibility.computedBalance)."},"example":{"id":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","organizationId":"018f8e4b-44b9-7d0e-8f9d-000000000001","customerId":"018f8e4b-44b9-7d0e-8f9d-000000000c01","status":"active","currency":"USD","createdAt":"2026-06-01T17:00:00.000Z","updatedAt":"2026-06-11T22:30:00.000Z","balanceCents":14500}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Customer not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: customerId UUID; currency 3-char.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/house-accounts/{accountId}":{"get":{"operationId":"bookingGetHouseAccount","summary":"Get a house account with its balance","description":"Operator op. Returns a member's house account plus its running balance. The balance is computed live as the sum of all ledger entries — it is never stored — so it is always consistent with the tab. Shadow contract: no adapter is mounted yet.","tags":["booking-house-accounts"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"House-account id."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"House-account id."},"organizationId":{"type":"string","format":"uuid","description":"Org that owns the account (RLS-scoped)."},"customerId":{"type":"string","format":"uuid","description":"The single member this tab belongs to (FK → public.customers.id). One account per (org, customer) — see oneAccountPerPerson."},"status":{"enum":["active","closed"],"type":"string","description":"House-account lifecycle status (house_account.status, default 'active'). 'active' tabs accept new entries; 'closed' tabs are read-only."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code for the ledger (house_account.currency, default USD)."},"createdAt":{"type":"string","description":"Account open timestamp (ISO 8601)."},"updatedAt":{"type":"string","description":"Last-updated timestamp (ISO 8601)."},"balanceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Computed running balance = SUM(amount_cents) over all entries. Positive = member owes the house; negative = house owes the member (credit). Never stored (see computedBalance)."}},"required":["id","organizationId","customerId","status","currency","createdAt","updatedAt","balanceCents"],"additionalProperties":false,"description":"A house account plus its computed balance (see BookingHouseAccountsContractCompatibility.computedBalance)."},"example":{"id":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","organizationId":"018f8e4b-44b9-7d0e-8f9d-000000000001","customerId":"018f8e4b-44b9-7d0e-8f9d-000000000c01","status":"active","currency":"USD","createdAt":"2026-06-01T17:00:00.000Z","updatedAt":"2026-06-11T22:30:00.000Z","balanceCents":14500}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Account not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/house-accounts/{accountId}/entries":{"get":{"operationId":"bookingListHouseAccountEntries","summary":"List a house account's ledger entries","description":"Operator op. Returns a paginated page of a member's ledger entries, newest first, filterable by kind (charge / payment / adjustment), occurred-at window, and linked booking. A tee time and a dinner both appear here as charges against the one tab. Shadow contract: no adapter is mounted yet.","tags":["booking-house-accounts"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"House-account id."}},{"name":"kind","in":"query","schema":{"enum":["charge","payment","adjustment"],"type":"string","description":"Filter to one entry kind."},"allowEmptyValue":true,"allowReserved":true},{"name":"bookingId","in":"query","schema":{"type":"string","format":"uuid","description":"Filter to entries tied to a specific booking."},"allowEmptyValue":true,"allowReserved":true},{"name":"from","in":"query","schema":{"type":"string","format":"date-time","description":"Inclusive occurred-at lower bound (ISO 8601)."},"allowEmptyValue":true,"allowReserved":true},{"name":"to","in":"query","schema":{"type":"string","format":"date-time","description":"Exclusive occurred-at upper bound (ISO 8601)."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"Page size (1-200, default 50)."},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0,"description":"Rows to skip (default 0)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Ledger entry id."},"organizationId":{"type":"string","format":"uuid","description":"Org that owns the entry (RLS-scoped)."},"accountId":{"type":"string","format":"uuid","description":"House account this entry posts to (FK → house_account.id)."},"bookingId":{"type":"string","format":"uuid","description":"Booking that produced this entry (e.g. a tee time or dinner), if any. Null for account-level payments/adjustments; nulled (not deleted) if the booking is removed — see bookingLink."},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed entry amount in minor units. Charges positive, payments negative, adjustments either sign — always nonzero (see signConventions)."},"kind":{"enum":["charge","payment","adjustment"],"type":"string","description":"Ledger entry kind (house_account_entry_kind_check): 'charge' (member owes more, positive), 'payment' (member paid down, negative), or 'adjustment' (comp/credit/correction, either sign)."},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text note on the entry (house_account_entry.memo, nullable)."},"occurredAt":{"type":"string","description":"When the charge/payment actually occurred (ISO 8601) — the business date, distinct from createdAt (when the row was written)."},"createdAt":{"type":"string","description":"Row creation timestamp (ISO 8601)."}},"required":["id","organizationId","accountId","amountCents","kind","occurredAt","createdAt"],"additionalProperties":false,"description":"A single house-account ledger entry (charge / payment / adjustment)."},"description":"The page of ledger entries, newest occurred-at first."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Page size that was applied."},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offset that was applied."},"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total entries matching the filter (across all pages)."}},"required":["entries","limit","offset","total"],"additionalProperties":false,"description":"A page of house-account ledger entries."},"example":{"entries":[{"id":"018f8e4b-44b9-7d0e-8f9d-0000000000e3","organizationId":"018f8e4b-44b9-7d0e-8f9d-000000000001","accountId":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","bookingId":"018f8e4b-44b9-7d0e-8f9d-0000000000b2","amountCents":9000,"kind":"charge","memo":"Clubhouse dinner — table for four","occurredAt":"2026-06-11T01:30:00.000Z","createdAt":"2026-06-11T01:31:12.000Z"},{"id":"018f8e4b-44b9-7d0e-8f9d-0000000000e2","organizationId":"018f8e4b-44b9-7d0e-8f9d-000000000001","accountId":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","bookingId":"018f8e4b-44b9-7d0e-8f9d-0000000000b1","amountCents":12500,"kind":"charge","memo":"Tee time — 18 holes, twosome","occurredAt":"2026-06-10T16:00:00.000Z","createdAt":"2026-06-10T16:02:45.000Z"},{"id":"018f8e4b-44b9-7d0e-8f9d-0000000000e1","organizationId":"018f8e4b-44b9-7d0e-8f9d-000000000001","accountId":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","amountCents":-7000,"kind":"payment","memo":"Payment on account","occurredAt":"2026-06-09T18:00:00.000Z","createdAt":"2026-06-09T18:00:30.000Z"}],"limit":50,"offset":0,"total":3}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Account not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: kind enum; bookingId UUID; from/to ISO; limit 1-200; offset >= 0.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingAddHouseAccountEntry","summary":"Post a charge, payment, or adjustment","description":"Operator op. Records one ledger entry on a member's tab: a charge (positive — they owe more, e.g. a tee time or dinner), a payment (negative — they paid the tab down), or an adjustment (either sign — a comp or correction). amount_cents must be nonzero. Optionally links the entry to the booking that produced it. Ledger-only: this records money, it does not capture or settle any payment (no payment rails are integrated). Intended as the future Layer-1 monetary-signal emission point (capture-only). Responds with the created entry. Shadow contract: no adapter is mounted yet.","tags":["booking-house-accounts"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"House-account id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["charge","payment","adjustment"],"type":"string","description":"Ledger entry kind (house_account_entry_kind_check): 'charge' (member owes more, positive), 'payment' (member paid down, negative), or 'adjustment' (comp/credit/correction, either sign)."},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed entry amount in minor units; must be a nonzero integer. Charges positive, payments negative, adjustments either sign (see signConventions)."},"bookingId":{"type":"string","format":"uuid","description":"Booking this entry is tied to (e.g. the tee time or dinner being charged), if any."},"memo":{"type":"string","minLength":1,"maxLength":500,"description":"Optional free-text note (1-500 chars)."},"occurredAt":{"type":"string","format":"date-time","description":"When the charge/payment occurred (ISO 8601); defaults to now() server-side (house_account_entry.occurred_at default)."}},"required":["kind","amountCents"],"additionalProperties":false,"description":"add-entry input — records one ledger row. Layer-1 monetary-signal seam (capture-only, not yet wired; see monetarySignalIntent)."}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Ledger entry id."},"organizationId":{"type":"string","format":"uuid","description":"Org that owns the entry (RLS-scoped)."},"accountId":{"type":"string","format":"uuid","description":"House account this entry posts to (FK → house_account.id)."},"bookingId":{"type":"string","format":"uuid","description":"Booking that produced this entry (e.g. a tee time or dinner), if any. Null for account-level payments/adjustments; nulled (not deleted) if the booking is removed — see bookingLink."},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed entry amount in minor units. Charges positive, payments negative, adjustments either sign — always nonzero (see signConventions)."},"kind":{"enum":["charge","payment","adjustment"],"type":"string","description":"Ledger entry kind (house_account_entry_kind_check): 'charge' (member owes more, positive), 'payment' (member paid down, negative), or 'adjustment' (comp/credit/correction, either sign)."},"memo":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text note on the entry (house_account_entry.memo, nullable)."},"occurredAt":{"type":"string","description":"When the charge/payment actually occurred (ISO 8601) — the business date, distinct from createdAt (when the row was written)."},"createdAt":{"type":"string","description":"Row creation timestamp (ISO 8601)."}},"required":["id","organizationId","accountId","amountCents","kind","occurredAt","createdAt"],"additionalProperties":false,"description":"A single house-account ledger entry (charge / payment / adjustment)."},"example":{"id":"018f8e4b-44b9-7d0e-8f9d-0000000000e3","organizationId":"018f8e4b-44b9-7d0e-8f9d-000000000001","accountId":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","bookingId":"018f8e4b-44b9-7d0e-8f9d-0000000000b2","amountCents":9000,"kind":"charge","memo":"Clubhouse dinner — table for four","occurredAt":"2026-06-11T01:30:00.000Z","createdAt":"2026-06-11T01:31:12.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Account not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: amountCents nonzero integer; kind enum; occurredAt ISO; bookingId UUID; memo <= 500.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/house-accounts/{accountId}/statement":{"get":{"operationId":"bookingGetHouseAccountStatement","summary":"Read a member's statement / F&B-minimum progress","description":"Operator op. Returns a computed statement for a member's tab over an optional occurred-at period: the net balance, per-kind subtotals (charges, payments, adjustments), and an entry count. The charge subtotal over a billing period is the food-and-beverage-minimum progress number — how much the member has spent toward their minimum. Every figure is a read-time aggregate over the ledger; nothing here is stored. Shadow contract: no adapter is mounted yet.","tags":["booking-house-accounts"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"House-account id."}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time","description":"Inclusive period start (ISO 8601); omit for all-time."},"allowEmptyValue":true,"allowReserved":true},{"name":"to","in":"query","schema":{"type":"string","format":"date-time","description":"Exclusive period end (ISO 8601); omit for all-time."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid","description":"Account the statement is for."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency of the ledger."},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Net balance over the (optionally period-filtered) entries = SUM(amount_cents). Positive = member owes the house."},"byKind":{"type":"object","properties":{"chargeCents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Sum of charge amounts (positive). Over a billing period this IS the F&B-minimum progress number — see fbMinimumProgress."},"paymentCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sum of payment amounts (negative or zero) — how much the member has paid the tab down."},"adjustmentCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Net of adjustments (comps/credits negative, corrections positive)."}},"required":["chargeCents","paymentCents","adjustmentCents"],"additionalProperties":false,"description":"Per-kind subtotals (the F&B-minimum-progress breakdown)."},"entryCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of entries included in the statement."},"period":{"type":"object","properties":{"from":{"type":"string","description":"Inclusive period start (ISO 8601)."},"to":{"type":"string","description":"Exclusive period end (ISO 8601)."}},"required":["from","to"],"additionalProperties":false,"description":"The occurred-at window the statement was computed over; absent for an all-time statement."}},"required":["accountId","currency","totalCents","byKind","entryCount"],"additionalProperties":false,"description":"A computed house-account statement / F&B-minimum-progress read (see BookingHouseAccountsContractCompatibility.fbMinimumProgress). Every figure is a read-time aggregate — never stored."},"example":{"accountId":"018f8e4b-44b9-7d0e-8f9d-0000000000a1","currency":"USD","totalCents":14500,"byKind":{"chargeCents":21500,"paymentCents":-7000,"adjustmentCents":0},"entryCount":3,"period":{"from":"2026-06-01T00:00:00.000Z","to":"2026-07-01T00:00:00.000Z"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Account not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: from/to ISO.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/customers/{customerId}/profile":{"get":{"operationId":"bookingGetCustomerProfile","summary":"Get a customer profile","description":"Returns the future shadow CRM/profile projection for an existing booking customer. Booking does not own this persistence; a mounted implementation must proxy/project Amplify-owned CRM truth or remain read-only.","tags":["booking-customer-profiles"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"displayName":{"type":"string"},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"preferences":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["customerId","organizationId","displayName","contactIntent","notes","preferences","updatedAt"],"additionalProperties":false},"example":{"customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","organizationId":"018f9b00-1111-7000-8000-000000000abc","displayName":"Mateo Gómez","contactIntent":"sms","notes":"Prefers afternoon starts.","preferences":{"preferredStartWindow":"afternoon"},"updatedAt":"2026-06-12T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]},"patch":{"operationId":"bookingUpdateCustomerProfile","summary":"Update a customer profile","description":"Shadow-only boundary for future profile preference updates. Booking must not persist CRM-owned profile data here unless a later RAL plan delegates the write to Amplify or reframes the payload as booking operational participant metadata; it never mutates an auth user.","tags":["booking-customer-profiles"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"preferences":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"displayName":{"type":"string"},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"preferences":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["customerId","organizationId","displayName","contactIntent","notes","preferences","updatedAt"],"additionalProperties":false},"example":{"customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","organizationId":"018f9b00-1111-7000-8000-000000000abc","displayName":"Mateo Gómez","contactIntent":"whatsapp","notes":"Prefers afternoon starts and WhatsApp reminders.","preferences":{"preferredStartWindow":"afternoon"},"updatedAt":"2026-06-12T12:15:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/customers/{customerId}/insights":{"get":{"operationId":"bookingGetCustomerInsights","summary":"Get customer insights","description":"Returns future shadow booking insights projected from booking activity for an existing customer.","tags":["booking-customer-profiles"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"lifetimeBookings":{"type":"integer","minimum":0,"maximum":9007199254740991},"noShowCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"preferredDemand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"lastBookedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}}},"required":["customerId","organizationId","lifetimeBookings","noShowCount","lastBookedAt","tags"],"additionalProperties":false},"example":{"customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","organizationId":"018f9b00-1111-7000-8000-000000000abc","lifetimeBookings":12,"noShowCount":0,"lastBookedAt":"2026-06-05T15:00:00.000Z","tags":["vip","golf","high_repeat_probability"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/resources/types":{"post":{"operationId":"bookingCreateResourceType","summary":"Create a resource type","description":"Creates a persisted operational resource type in the booking schema. Resource types are inventory categories such as tee, cart, simulator bay, table, room, or instructor; they are scoped to the caller organization and optionally to a bookable context.","tags":["booking-resources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1,"default":"generic"},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"capacityModel":{"type":"string","minLength":1,"default":"unit"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}}},"required":["name","capacity"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"capacityModel":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","name","code","kind","capacity","capacityModel","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000007","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"018fa100-0000-4000-8000-000000000001","name":"Simulator bay","code":"sim-bay","kind":"simulator_bay","capacity":4,"capacityModel":"unit","metadata":{"category":"golf","bookableKind":"simulator_bay"},"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListResourceTypes","summary":"List resource types","description":"Lists persisted resource types for the caller organization, optionally filtered by bookable context.","tags":["booking-resources"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional bookable context filter."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string"},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"capacityModel":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","name","code","kind","capacity","capacityModel","metadata","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000007","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"018fa100-0000-4000-8000-000000000001","name":"Simulator bay","code":"sim-bay","kind":"simulator_bay","capacity":4,"capacityModel":"unit","metadata":{"category":"golf","bookableKind":"simulator_bay"},"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/resources/units":{"post":{"operationId":"bookingCreateResourceUnit","summary":"Create a resource unit","description":"Creates a persisted resource unit under a resource type. Units are individual bookable inventory items such as Tee 1, Cart 42, Bay A, or Table 12.","tags":["booking-resources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"typeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991,"default":1},"status":{"enum":["active","inactive","maintenance"],"type":"string","default":"active"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}}},"required":["typeId","name"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"typeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","inactive","maintenance"],"type":"string"},"active":{"type":"boolean"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","typeId","contextId","name","code","capacity","status","active","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000008","organizationId":"018f9b00-1111-7000-8000-000000000abc","typeId":"018fa100-0000-4000-8000-000000000007","contextId":"018fa100-0000-4000-8000-000000000001","name":"Bay 1","code":"bay-1","capacity":4,"status":"active","active":true,"metadata":{"location":"north wing","simulatorVendor":"TrackMan"},"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListResourceUnits","summary":"List resource units","description":"Lists persisted resource units for the caller organization, optionally filtered by type, context, status, or legacy active flag.","tags":["booking-resources"],"parameters":[{"name":"typeId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional resource type filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional bookable context filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"enum":["active","inactive","maintenance"],"type":"string","description":"Optional resource unit status filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"active","in":"query","schema":{"type":"boolean","description":"Legacy active/inactive resource unit filter; maps to status=active when true."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"typeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","inactive","maintenance"],"type":"string"},"active":{"type":"boolean"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","typeId","contextId","name","code","capacity","status","active","metadata","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000008","organizationId":"018f9b00-1111-7000-8000-000000000abc","typeId":"018fa100-0000-4000-8000-000000000007","contextId":"018fa100-0000-4000-8000-000000000001","name":"Bay 1","code":"bay-1","capacity":4,"status":"active","active":true,"metadata":{"location":"north wing","simulatorVendor":"TrackMan"},"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/resources/blocks":{"post":{"operationId":"bookingCreateResourceBlock","summary":"Create a resource block","description":"Creates a persisted operational block over a context, resource type, or resource unit. Blocks are inventory facts for later availability/hold conflict checks; this slice persists them but does not implement the hold conflict engine.","tags":["booking-resources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"reason":{"type":"string","minLength":1,"maxLength":240},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","default":"admin"}},"required":["window","reason"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"reason":{"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","window","reason","source","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000009","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"018fa100-0000-4000-8000-000000000001","resourceTypeId":"018fa100-0000-4000-8000-000000000007","resourceUnitId":"018fa100-0000-4000-8000-000000000008","window":{"startsAt":"2026-06-20T12:00:00.000Z","endsAt":"2026-06-20T13:00:00.000Z"},"reason":"maintenance","source":"admin","createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: future shadow lifecycle or availability conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListResourceBlocks","summary":"List resource blocks","description":"Lists persisted resource blocks for the caller organization.","tags":["booking-resources"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceTypeId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceUnitId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"reason":{"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","window","reason","source","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000009","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"018fa100-0000-4000-8000-000000000001","resourceTypeId":"018fa100-0000-4000-8000-000000000007","resourceUnitId":"018fa100-0000-4000-8000-000000000008","window":{"startsAt":"2026-06-20T12:00:00.000Z","endsAt":"2026-06-20T13:00:00.000Z"},"reason":"maintenance","source":"admin","createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/resources/combinations":{"post":{"operationId":"bookingCreateResourceCombination","summary":"Create a resource combination","description":"Creates a persisted combination of resource units, such as adjacent simulator bays, tee-plus-cart bundles, or joined tables. Combination members stay operational inventory, not CRM data.","tags":["booking-resources"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"resourceUnitIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","inactive","maintenance"],"type":"string","default":"active"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}}},"required":["contextId","name","resourceUnitIds","capacity"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"resourceUnitIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","inactive","maintenance"],"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","name","code","resourceUnitIds","capacity","status","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000010","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"018fa100-0000-4000-8000-000000000001","name":"Two adjacent bays","code":"two-bays","resourceUnitIds":["018fa100-0000-4000-8000-000000000008","018fa100-0000-4000-8000-000000000011"],"capacity":8,"status":"active","metadata":{"package":"adjacent"},"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: future shadow lifecycle or availability conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListResourceCombinations","summary":"List resource combinations","description":"Lists persisted resource combinations for the caller organization, optionally filtered by bookable context.","tags":["booking-resources"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string"},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"resourceUnitIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"capacity":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","inactive","maintenance"],"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","name","code","resourceUnitIds","capacity","status","metadata","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000010","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"018fa100-0000-4000-8000-000000000001","name":"Two adjacent bays","code":"two-bays","resourceUnitIds":["018fa100-0000-4000-8000-000000000008","018fa100-0000-4000-8000-000000000011"],"capacity":8,"status":"active","metadata":{"package":"adjacent"},"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-01T12:00:00.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/waitlist":{"post":{"operationId":"bookingCreateWaitlistEntry","summary":"Create a waitlist entry","description":"Creates a waiting entry for a requested booking window in a bookable context.","tags":["booking-waitlist"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id (see /api/v1/booking/guests); needed before the entry can be offered a freed slot or claim."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications.","default":"sms"}},"required":["contextId","customerId","requestedWindow","demand"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id the claim books for. An entry without one is never offered a freed slot and cannot claim (409)."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"status":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string"},"offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false,"description":"Present once the entry has been offered."},"claimedBookingId":{"type":"string","format":"uuid","description":"The booking the claim created (hold commit or direct create); present on a claimed entry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","requestedWindow","demand","contactIntent","status","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000005","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","requestedWindow":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T18:00:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"contactIntent":"sms","status":"waiting","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListWaitlistEntries","summary":"List waitlist entries","description":"Lists waitlist entries in the caller organization, best priority first.","tags":["booking-waitlist"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional bookable context filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string","description":"Optional waitlist lifecycle status filter."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id the claim books for. An entry without one is never offered a freed slot and cannot claim (409)."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"status":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string"},"offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false,"description":"Present once the entry has been offered."},"claimedBookingId":{"type":"string","format":"uuid","description":"The booking the claim created (hold commit or direct create); present on a claimed entry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","requestedWindow","demand","contactIntent","status","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000005","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","requestedWindow":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T18:00:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"contactIntent":"sms","status":"waiting","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z"}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/waitlist/{entryId}":{"get":{"operationId":"bookingGetWaitlistEntry","summary":"Get a waitlist entry","description":"Returns one waitlist entry. Cross-org entries are 404.","tags":["booking-waitlist"],"parameters":[{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id the claim books for. An entry without one is never offered a freed slot and cannot claim (409)."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"status":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string"},"offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false,"description":"Present once the entry has been offered."},"claimedBookingId":{"type":"string","format":"uuid","description":"The booking the claim created (hold commit or direct create); present on a claimed entry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","requestedWindow","demand","contactIntent","status","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000005","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","requestedWindow":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T18:00:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"contactIntent":"sms","status":"waiting","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Waitlist entry not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"delete":{"operationId":"bookingDeleteWaitlistEntry","summary":"Delete a waitlist entry","description":"Removes a waiting or offered entry from consideration (→ deleted). 409 on a terminal entry.","tags":["booking-waitlist"],"parameters":[{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id the claim books for. An entry without one is never offered a freed slot and cannot claim (409)."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"status":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string"},"offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false,"description":"Present once the entry has been offered."},"claimedBookingId":{"type":"string","format":"uuid","description":"The booking the claim created (hold commit or direct create); present on a claimed entry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","requestedWindow","demand","contactIntent","status","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000005","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","requestedWindow":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T18:00:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"contactIntent":"sms","status":"deleted","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Waitlist entry not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: entry is terminal (claimed, expired or deleted).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/waitlist/{entryId}/offer":{"post":{"operationId":"bookingOfferWaitlistEntry","summary":"Offer a waitlist entry","description":"Offers a window to a waiting entry (waiting → offered) and emits one waitlist.offered outbox row. 409 when the entry is not waiting.","tags":["booking-waitlist"],"parameters":[{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string","minLength":1,"maxLength":500}},"required":["offeredWindow","expiresAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000006","entryId":"018fa100-0000-4000-8000-000000000005","offeredWindow":{"startsAt":"2026-06-20T16:00:00.000Z","endsAt":"2026-06-20T17:30:00.000Z"},"expiresAt":"2026-06-12T19:00:00.000Z","message":"A matching tee time is available until 19:00 UTC."}}}},"400":{"description":"Bad request: offer expiresAt is not in the future.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Waitlist entry not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: entry is not waiting (already offered, claimed, expired or deleted).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/waitlist/{entryId}/claim":{"post":{"operationId":"bookingClaimWaitlistOffer","summary":"Claim a waitlist offer","description":"Claims an offer (offered → claimed): commits the offer's hold through the hold lane, or books through the capacity-gated direct lane for a unit-less manual offer. 409 offer_taken when another claim won, 409 offer_expired when the window lapsed. No payment capture occurs.","tags":["booking-waitlist"],"parameters":[{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id the claim books for. An entry without one is never offered a freed slot and cannot claim (409)."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"status":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string"},"offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false,"description":"Present once the entry has been offered."},"claimedBookingId":{"type":"string","format":"uuid","description":"The booking the claim created (hold commit or direct create); present on a claimed entry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","requestedWindow","demand","contactIntent","status","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000005","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","requestedWindow":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T18:00:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"contactIntent":"sms","status":"claimed","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Waitlist entry not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: offer_taken (another claim won), offer_expired (the 15-minute window lapsed; the entry flips to expired), the entry has no userId, or the hold lane / capacity-gated direct lane refused the window.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/waitlist/{entryId}/expire":{"post":{"operationId":"bookingExpireWaitlistEntry","summary":"Expire a waitlist entry","description":"Expires an offered entry (offered → expired) and re-offers the freed window to the next waiting entry.","tags":["booking-waitlist"],"parameters":[{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent user id the claim books for. An entry without one is never offered a freed slot and cannot claim (409)."},"requestedWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."},"status":{"enum":["waiting","offered","claimed","expired","deleted"],"type":"string"},"offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"entryId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"offeredWindow":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"message":{"type":"string"}},"required":["id","entryId","offeredWindow","expiresAt","message"],"additionalProperties":false,"description":"Present once the entry has been offered."},"claimedBookingId":{"type":"string","format":"uuid","description":"The booking the claim created (hold commit or direct create); present on a claimed entry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","requestedWindow","demand","contactIntent","status","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000005","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","requestedWindow":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T18:00:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"contactIntent":"sms","status":"expired","createdAt":"2026-06-12T18:00:00.000Z","updatedAt":"2026-06-12T18:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Waitlist entry not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: entry is not offered.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/policies":{"post":{"operationId":"bookingCreatePolicy","summary":"Create a booking policy","description":"Creates a mounted-narrow booking policy for the caller organization. Catalog/binding truth is persisted; active booking-window and party policies are enforced by hold/create-booking/reschedule/assignment service gates, while money-bearing settlement remains a later slice.","tags":["booking-policies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["booking_window","cancellation","deposit","no_show","party","pace","resource"],"type":"string"},"name":{"type":"string","minLength":1},"rule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxAdvanceDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"allowedSources":{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string"}}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","freeUntilHours"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","required"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"intervalMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false}]},"active":{"type":"boolean","default":true},"binding":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"additionalProperties":false,"default":{}}},"required":["kind","name","rule"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"kind":{"enum":["booking_window","cancellation","deposit","no_show","party","pace","resource"],"type":"string"},"name":{"type":"string"},"rule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxAdvanceDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"allowedSources":{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string"}}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","freeUntilHours"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","required"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"intervalMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false}]},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","kind","name","rule","active","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000003","organizationId":"018f9b00-1111-7000-8000-000000000abc","kind":"cancellation","name":"Standard cancellation","rule":{"kind":"cancellation","freeUntilHours":24,"fee":{"amountCents":6000,"currency":"USD"}},"active":true,"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-12T12:00:00.000Z","contextId":null,"resourceTypeId":null,"resourceUnitId":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Policy binding or referenced resource type not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListPolicies","summary":"List booking policies","description":"Lists mounted booking policies for the caller organization with optional active/kind/binding filters.","tags":["booking-policies"],"parameters":[{"name":"kind","in":"query","schema":{"enum":["booking_window","cancellation","deposit","no_show","party","pace","resource"],"type":"string","description":"Optional policy kind filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"active","in":"query","schema":{"type":"boolean","description":"Optional active/inactive policy filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional context binding filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceTypeId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional resource-type binding filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceUnitId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional resource-unit binding filter."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"kind":{"enum":["booking_window","cancellation","deposit","no_show","party","pace","resource"],"type":"string"},"name":{"type":"string"},"rule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxAdvanceDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"allowedSources":{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string"}}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","freeUntilHours"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","required"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"intervalMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false}]},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","kind","name","rule","active","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000003","organizationId":"018f9b00-1111-7000-8000-000000000abc","kind":"cancellation","name":"Standard cancellation","rule":{"kind":"cancellation","freeUntilHours":24,"fee":{"amountCents":6000,"currency":"USD"}},"active":true,"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-12T12:00:00.000Z","contextId":null,"resourceTypeId":null,"resourceUnitId":null}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/policies/{policyId}":{"patch":{"operationId":"bookingUpdatePolicy","summary":"Update a booking policy","description":"Updates a mounted booking policy. 404 is used for unknown or cross-org policies.","tags":["booking-policies"],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"rule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxAdvanceDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"allowedSources":{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string"}}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","freeUntilHours"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","required"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"intervalMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false}]},"active":{"type":"boolean"},"binding":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"kind":{"enum":["booking_window","cancellation","deposit","no_show","party","pace","resource"],"type":"string"},"name":{"type":"string"},"rule":{"anyOf":[{"type":"object","properties":{"kind":{"const":"booking_window"},"minLeadMinutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxAdvanceDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"allowedSources":{"type":"array","minItems":1,"items":{"enum":["admin","web","mcp","microsite"],"type":"string"}}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"cancellation"},"freeUntilHours":{"type":"integer","minimum":0,"maximum":9007199254740991},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","freeUntilHours"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"deposit"},"required":{"type":"boolean"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","required"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"no_show"},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["kind","fee"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"party"},"minPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"pace"},"maxPartySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"intervalMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","maxPartySize","intervalMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"resource"},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"minimumUnits":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","resourceTypeId","minimumUnits"],"additionalProperties":false}]},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","kind","name","rule","active","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000003","organizationId":"018f9b00-1111-7000-8000-000000000abc","kind":"cancellation","name":"Standard cancellation","rule":{"kind":"cancellation","freeUntilHours":24,"fee":{"amountCents":6000,"currency":"USD"}},"active":true,"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-12T12:00:00.000Z","contextId":null,"resourceTypeId":null,"resourceUnitId":null}}}},"400":{"description":"Bad request: policy rule.kind mismatch.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Policy, binding target, or referenced resource type not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/rate-plans":{"post":{"operationId":"bookingCreateRatePlan","summary":"Create a legacy compatibility rate plan","description":"Deprecated compatibility surface for the original mutable booking.rate_plan catalog. New Offer and RateAssignment composition must use the canonical versioned /commercial/rate-plans authority. Money remains catalog/quote truth, not payment settlement.","deprecated":true,"tags":["booking-policies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":3,"maxLength":3},"components":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"active":{"type":"boolean","default":true},"binding":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"additionalProperties":false,"default":{}}},"required":["name","currency","components"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"components":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","name","currency","components","active","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000004","organizationId":"018f9b00-1111-7000-8000-000000000abc","name":"Weekend peak","currency":"USD","components":[{"code":"base_rate","label":"Base rate","amount":{"amountCents":12000,"currency":"USD"}}],"active":true,"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-12T12:00:00.000Z","contextId":null,"resourceTypeId":null,"resourceUnitId":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Rate-plan binding target not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListRatePlans","summary":"List legacy compatibility rate plans","description":"Deprecated compatibility read for booking.rate_plan. New integrations should use /commercial/rate-plans and immutable versions.","deprecated":true,"tags":["booking-policies"],"parameters":[{"name":"active","in":"query","schema":{"type":"boolean","description":"Optional active/inactive rate-plan filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional context binding filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceTypeId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional resource-type binding filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"resourceUnitId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional resource-unit binding filter."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"components":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","name","currency","components","active","createdAt","updatedAt"],"additionalProperties":false}},"example":[{"id":"018fa100-0000-4000-8000-000000000004","organizationId":"018f9b00-1111-7000-8000-000000000abc","name":"Weekend peak","currency":"USD","components":[{"code":"base_rate","label":"Base rate","amount":{"amountCents":12000,"currency":"USD"}}],"active":true,"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-12T12:00:00.000Z","contextId":null,"resourceTypeId":null,"resourceUnitId":null}]}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/rate-plans/{ratePlanId}":{"patch":{"operationId":"bookingUpdateRatePlan","summary":"Update a legacy compatibility rate plan","description":"Deprecated compatibility mutation for booking.rate_plan. It is not consumed by canonical RateAssignment and must not be used for new Offer composition.","deprecated":true,"tags":["booking-policies"],"parameters":[{"name":"ratePlanId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"currency":{"type":"string","minLength":3,"maxLength":3},"components":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"active":{"type":"boolean"},"binding":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceTypeId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceTypeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"name":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3},"components":{"type":"array","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","resourceTypeId","resourceUnitId","name","currency","components","active","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000004","organizationId":"018f9b00-1111-7000-8000-000000000abc","name":"Weekend peak","currency":"USD","components":[{"code":"base_rate","label":"Base rate","amount":{"amountCents":12000,"currency":"USD"}}],"active":true,"createdAt":"2026-06-01T12:00:00.000Z","updatedAt":"2026-06-12T12:00:00.000Z","contextId":null,"resourceTypeId":null,"resourceUnitId":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Rate plan or binding target not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/holds":{"post":{"operationId":"bookingCreateHold","summary":"Create a booking hold","description":"Creates a temporary hold against a bookable context and required constrained resource target. Mounted runtime checks resource blocks, active bookings/assignments, and active unexpired holds before writing. No payment/deposit behavior is performed.","tags":["booking-holds"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent guest/user id for the held inventory claim. Required before commit; createHold can store it up front."},"customerId":{"type":"string","format":"uuid","description":"Optional/deprecated CRM customer context metadata; not the booking holder identity."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"default":1},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time.","default":"web"},"clientRequestId":{"type":"string","minLength":1},"ttlSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":600},"resourceUnitId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"resourceCombinationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}}},"required":["contextId","window"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","converted","released","expired"],"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedBookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"convertedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","createdBy","window","partySize","status","source","expiresAt","clientRequestId","convertedBookingId","convertedAt","resourceUnitId","resourceCombinationId","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000002","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","createdBy":"2fa85f64-5717-4562-b3fc-2c963f66afa6","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"partySize":4,"status":"active","source":"web","expiresAt":"2026-06-20T14:45:00.000Z","clientRequestId":"hold-demo-1","resourceUnitId":"018fa100-0000-4000-8000-000000000006","resourceCombinationId":null,"metadata":{},"createdAt":"2026-06-12T18:05:00.000Z","updatedAt":"2026-06-12T18:10:00.000Z","convertedBookingId":null,"convertedAt":null,"userId":"2fa85f64-5717-4562-b3fc-2c963f66afa6"}}}},"400":{"description":"Bad request: active booking-window or party policy rejects the hold request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: resource target is blocked, booked, assigned, held, inactive, or cross-context.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: contextId UUID; required resourceUnitId/resourceCombinationId; TTL/source/window schema.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/holds/{holdId}":{"get":{"operationId":"bookingGetHold","summary":"Get a booking hold","description":"Returns a hold in the caller organization, or 404 for unknown/cross-org holds.","tags":["booking-holds"],"parameters":[{"name":"holdId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","converted","released","expired"],"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedBookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"convertedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","createdBy","window","partySize","status","source","expiresAt","clientRequestId","convertedBookingId","convertedAt","resourceUnitId","resourceCombinationId","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000002","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","createdBy":"2fa85f64-5717-4562-b3fc-2c963f66afa6","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"partySize":4,"status":"active","source":"web","expiresAt":"2026-06-20T14:45:00.000Z","clientRequestId":"hold-demo-1","resourceUnitId":"018fa100-0000-4000-8000-000000000006","resourceCombinationId":null,"metadata":{},"createdAt":"2026-06-12T18:05:00.000Z","updatedAt":"2026-06-12T18:10:00.000Z","convertedBookingId":null,"convertedAt":null,"userId":"2fa85f64-5717-4562-b3fc-2c963f66afa6"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Hold not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/holds/{holdId}/commit":{"post":{"operationId":"bookingCommitHold","summary":"Commit a booking hold","description":"Atomically converts an active unexpired hold with a claimed guest/user identity into a durable booking, copies the constrained resource target into booking_resource, marks the hold converted, and writes booking lifecycle audit evidence. 409 covers lifecycle/conflict failures, including expired holds at the oRPC boundary; REST keeps a 410 expired-hold response. No payment settlement is performed.","tags":["booking-holds"],"parameters":[{"name":"holdId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":128,"description":"Persistent guest/user id to use when committing an older/draft hold that does not already carry userId."},"clientRequestId":{"type":"string","minLength":1}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hold":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","converted","released","expired"],"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedBookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"convertedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","createdBy","window","partySize","status","source","expiresAt","clientRequestId","convertedBookingId","convertedAt","resourceUnitId","resourceCombinationId","metadata","createdAt","updatedAt"],"additionalProperties":false},"bookingId":{"type":"string","format":"uuid","description":"Booking id created by commit."}},"required":["hold","bookingId"],"additionalProperties":false},"example":{"hold":{"id":"018fa100-0000-4000-8000-000000000002","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","createdBy":"2fa85f64-5717-4562-b3fc-2c963f66afa6","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"partySize":4,"status":"converted","source":"web","expiresAt":"2026-06-20T14:45:00.000Z","clientRequestId":"hold-demo-1","resourceUnitId":"018fa100-0000-4000-8000-000000000006","resourceCombinationId":null,"metadata":{},"createdAt":"2026-06-12T18:05:00.000Z","updatedAt":"2026-06-12T18:12:00.000Z","convertedBookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301","convertedAt":"2026-06-12T18:12:00.000Z","userId":"2fa85f64-5717-4562-b3fc-2c963f66afa6"},"bookingId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301"}}}},"400":{"description":"Bad request: claimed guest/user required before durable booking.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Hold or held resource target not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: hold lifecycle state or commit-time availability conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"410":{"description":"Gone: expired hold.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/holds/{holdId}/release":{"post":{"operationId":"bookingReleaseHold","summary":"Release a booking hold","description":"Releases an active hold so it no longer blocks inventory. 409 covers illegal transitions; expired holds are returned as expired truth by the service.","tags":["booking-holds"],"parameters":[{"name":"holdId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":240}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","converted","released","expired"],"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedBookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"convertedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","createdBy","window","partySize","status","source","expiresAt","clientRequestId","convertedBookingId","convertedAt","resourceUnitId","resourceCombinationId","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000002","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","createdBy":"2fa85f64-5717-4562-b3fc-2c963f66afa6","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"partySize":4,"status":"released","source":"web","expiresAt":"2026-06-20T14:45:00.000Z","clientRequestId":"hold-demo-1","resourceUnitId":"018fa100-0000-4000-8000-000000000006","resourceCombinationId":null,"metadata":{},"createdAt":"2026-06-12T18:05:00.000Z","updatedAt":"2026-06-12T18:12:00.000Z","convertedBookingId":null,"convertedAt":null,"userId":"2fa85f64-5717-4562-b3fc-2c963f66afa6"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Hold not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: hold is not releasable from its current lifecycle state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/holds/{holdId}/extend":{"post":{"operationId":"bookingExtendHold","summary":"Extend a booking hold","description":"Extends an active unexpired hold expiry while keeping the same conflict footprint. 409 covers illegal transitions; expired holds are returned as expired truth by the service.","tags":["booking-holds"],"parameters":[{"name":"holdId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ttlSeconds":{"type":"integer","minimum":60,"maximum":86400}},"required":["ttlSeconds"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"description":"Persistent auth/user id for the person holding a booking. Stored as booking.user_id because Better Auth/Amplify ids may be UUID or text across deployments."},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"enum":["active","converted","released","expired"],"type":"string"},"source":{"enum":["admin","web","mcp","microsite"],"type":"string","description":"Channel the booking originated from (text + CHECK, schema.ts:122-125). Carried into the v4 attribution signal at capture time."},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"clientRequestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedBookingId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"convertedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}]},"resourceUnitId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"resourceCombinationId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","userId","customerId","createdBy","window","partySize","status","source","expiresAt","clientRequestId","convertedBookingId","convertedAt","resourceUnitId","resourceCombinationId","metadata","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000002","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","createdBy":"2fa85f64-5717-4562-b3fc-2c963f66afa6","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"partySize":4,"status":"active","source":"web","expiresAt":"2026-06-20T15:15:00.000Z","clientRequestId":"hold-demo-1","resourceUnitId":"018fa100-0000-4000-8000-000000000006","resourceCombinationId":null,"metadata":{},"createdAt":"2026-06-12T18:05:00.000Z","updatedAt":"2026-06-12T18:12:00.000Z","convertedBookingId":null,"convertedAt":null,"userId":"2fa85f64-5717-4562-b3fc-2c963f66afa6"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Hold not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: hold is not extendable from its current lifecycle state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: ttlSeconds 60-86400.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/quotes":{"post":{"operationId":"bookingCreateQuote","summary":"Create a booking quote","description":"Creates a future shadow quote from a context, requested window, demand, and optional customer. This is contract truth only: no adapter, DB table, payment capture, or settlement behavior is mounted.","tags":["booking-quotes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"Bookable context to quote."},"customerId":{"type":"string","format":"uuid","description":"Known customer, if available."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"contactIntent":{"enum":["sms","email","phone","whatsapp","none"],"type":"string","description":"Preferred contact intent for future booking communications."}},"required":["contextId","window","demand"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Future quote id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization from session."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"components":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."},"expiresAt":{"type":"string","format":"date-time","description":"Quote expiry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","window","demand","components","total","expiresAt","createdAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000001","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"components":[{"code":"green_fee","label":"Green fee","amount":{"amountCents":12000,"currency":"USD"}},{"code":"sales_tax","label":"Estimated tax","amount":{"amountCents":960,"currency":"USD"}}],"total":{"amountCents":12960,"currency":"USD"},"expiresAt":"2026-06-20T14:45:00.000Z","createdAt":"2026-06-12T18:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: future shadow lifecycle or availability conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: Zod schema validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/quotes/{quoteId}":{"get":{"operationId":"bookingGetQuote","summary":"Get a booking quote","description":"Returns one future shadow quote within the caller organization. Cross-org and unknown quotes are both 404 under future org-scoped invisibility semantics.","tags":["booking-quotes"],"parameters":[{"name":"quoteId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Future quote id."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization from session."},"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"customerId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Requested window start."},"endsAt":{"type":"string","format":"date-time","description":"Requested window end; must be after startsAt."}},"required":["startsAt","endsAt"],"additionalProperties":false,"description":"Bookable time window."},"demand":{"type":"object","properties":{"partySize":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Requested party size."},"resourceTypeId":{"type":"string","format":"uuid","description":"Optional requested resource type."},"resourceUnitIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Preferred resource units."}},"required":["partySize"],"additionalProperties":false,"description":"Demand signal used by quote, hold, waitlist, and resource projections."},"components":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Price component code."},"label":{"type":"string","minLength":1,"description":"Human label."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."}},"required":["code","label","amount"],"additionalProperties":false,"description":"One quote/rate-plan price component."}},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."},"expiresAt":{"type":"string","format":"date-time","description":"Quote expiry."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","contextId","customerId","window","demand","components","total","expiresAt","createdAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-000000000001","organizationId":"018f9b00-1111-7000-8000-000000000abc","contextId":"7c9e6679-7425-40de-944b-e07fc1f90ae7","customerId":"018f9c10-7a1e-7c44-9b2a-3d5e6f701122","window":{"startsAt":"2026-06-20T15:00:00.000Z","endsAt":"2026-06-20T16:30:00.000Z"},"demand":{"partySize":4,"resourceTypeId":"018fa100-0000-4000-8000-000000000005","resourceUnitIds":["018fa100-0000-4000-8000-000000000006"]},"components":[{"code":"green_fee","label":"Green fee","amount":{"amountCents":12000,"currency":"USD"}},{"code":"sales_tax","label":"Estimated tax","amount":{"amountCents":960,"currency":"USD"}}],"total":{"amountCents":12960,"currency":"USD"},"expiresAt":"2026-06-20T14:45:00.000Z","createdAt":"2026-06-12T18:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow resource not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/templates":{"get":{"operationId":"bookingListOrganizerTemplates","summary":"List organizer templates","description":"Lists public capability-first organizer starter templates. Templates are bundle/config descriptors only; they do not create vertical runtime types and do not execute install mutations.","tags":["booking-templates"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"proofTier":{"enum":["docs-only","fixture-backed","local-demo","staging-live"],"type":"string"},"runtimeMode":{"enum":["bundle_only","descriptor_only"],"type":"string"},"capabilities":{"type":"array","items":{"type":"string","minLength":1}},"contexts":{"type":"integer","minimum":0,"maximum":9007199254740991},"unsupportedSeams":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","slug","name","version","proofTier","runtimeMode","capabilities","contexts","unsupportedSeams"],"additionalProperties":false}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/templates/{slug}":{"get":{"operationId":"bookingGetOrganizerTemplate","summary":"Inspect an organizer template manifest","description":"Returns the full organizer template manifest for a public starter. The manifest describes capability bundles, bookable-context kinds, proof surfaces, and non-live unsupported seams without claiming production install readiness.","tags":["booking-templates"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"const":"organizer-template.v0"},"id":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"hostScope":{"enum":["sonik","shared"],"type":"string"},"kind":{"enum":["organizer_template","bundle"],"type":"string"},"proofTier":{"enum":["docs-only","fixture-backed","local-demo","staging-live"],"type":"string"},"runtimeMode":{"enum":["bundle_only","descriptor_only"],"type":"string"},"runtimeEffects":{"type":"array","items":{"type":"string","minLength":1}},"hostPrimitiveRefs":{"type":"array","items":{"type":"string","minLength":1}},"capabilities":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"install":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Template install descriptor for contexts, schedules, resources, policies, and rates. Descriptor only; this public endpoint does not mutate persistence."},"surfaces":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"cliProof":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"browserProof":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"externalSeams":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"unsupportedClaims":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["schemaVersion","id","slug","name","version","hostScope","kind","proofTier","runtimeMode","runtimeEffects","hostPrimitiveRefs","capabilities","install","surfaces","cliProof","browserProof","externalSeams","unsupportedClaims"],"additionalProperties":{}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/templates/{slug}/dry-run":{"get":{"operationId":"bookingDryRunOrganizerTemplate","summary":"Dry-run organizer template install","description":"Returns a deterministic install report for the template and organization slug. This endpoint is read-only: executedMutations is false, venueProductionReady is false, and install mutations remain guarded/deferred.","tags":["booking-templates"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."}},{"name":"organizationSlug","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Optional demo organization slug used to produce deterministic dry-run ids."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"const":"organizer-template-install-plan.v0"},"ok":{"type":"boolean"},"mode":{"const":"dry-run"},"executedMutations":{"const":false},"venueProductionReady":{"const":false},"template":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"proofTier":{"enum":["docs-only","fixture-backed","local-demo","staging-live"],"type":"string"},"runtimeMode":{"enum":["bundle_only","descriptor_only"],"type":"string"}},"required":["id","slug","name","version","proofTier","runtimeMode"],"additionalProperties":false},"organization":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"externalRef":{"type":"string","minLength":1}},"required":["slug","name","externalRef"],"additionalProperties":false},"counts":{"type":"object","properties":{"contexts":{"type":"integer","minimum":0,"maximum":9007199254740991},"scheduleRules":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceTypes":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceBlocks":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceCombinations":{"type":"integer","minimum":0,"maximum":9007199254740991},"resourceCombinationMembers":{"type":"integer","minimum":0,"maximum":9007199254740991},"policies":{"type":"integer","minimum":0,"maximum":9007199254740991},"ratePlans":{"type":"integer","minimum":0,"maximum":9007199254740991},"externalSeams":{"type":"integer","minimum":0,"maximum":9007199254740991},"unsupportedClaims":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["contexts","scheduleRules","resourceTypes","resourceUnits","resourceBlocks","resourceCombinations","resourceCombinationMembers","policies","ratePlans","externalSeams","unsupportedClaims"],"additionalProperties":false},"plannedRows":{"type":"array","items":{"type":"object","properties":{"primitive":{"enum":["bookable_context","schedule_rule","resource_type","resource_unit","resource_block","resource_combination","resource_combination_member","booking_policy","rate_plan"],"type":"string"},"key":{"type":"string","minLength":1},"operation":{"const":"upsert"},"sourceTemplateId":{"type":"string","minLength":1},"sourceTemplateSlug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"payload":{},"references":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["primitive","key","operation","sourceTemplateId","sourceTemplateSlug","references"],"additionalProperties":false}},"proof":{"type":"object","properties":{"cli":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"browser":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"proofSurfaces":{"type":"array","items":{"type":"string","minLength":1}}},"required":["cli","browser","proofSurfaces"],"additionalProperties":false},"unsupported":{"type":"object","properties":{"externalSeams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"status":{"type":"string","minLength":1},"reason":{"type":"string","minLength":1},"capabilityIds":{"type":"array","items":{"type":"string","minLength":1}},"live":{"const":false}},"required":["id","label","status","reason","capabilityIds","live"],"additionalProperties":false}},"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"claim":{"type":"string","minLength":1},"status":{"type":"string","minLength":1},"reason":{"type":"string","minLength":1},"live":{"const":false}},"required":["id","claim","status","reason","live"],"additionalProperties":false}}},"required":["externalSeams","claims"],"additionalProperties":false},"caveats":{"type":"array","items":{"type":"string","minLength":1}},"determinismKey":{"type":"string","minLength":1}},"required":["schemaVersion","ok","mode","executedMutations","venueProductionReady","template","organization","counts","plannedRows","proof","unsupported","caveats","determinismKey"],"additionalProperties":{}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/templates/{slug}/browser-handoff":{"get":{"operationId":"bookingGetOrganizerTemplateBrowserHandoff","summary":"Get organizer template browser handoff","description":"Returns the browser/manual-proof handoff generated from the same template dry-run report used by the CLI. Unsupported seams remain non-live and durable template-install tables remain deferred.","tags":["booking-templates"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."}},{"name":"organizationSlug","in":"query","schema":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Optional demo organization slug used to produce deterministic dry-run ids."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"schemaVersion":{"const":"organizer-template-browser-handoff.v0"},"sourceReportSchemaVersion":{"const":"organizer-template-install-plan.v0"},"sourceDeterminismKey":{"type":"string","minLength":1},"venueProductionReady":{"const":false},"template":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"proofTier":{"enum":["docs-only","fixture-backed","local-demo","staging-live"],"type":"string"},"runtimeMode":{"enum":["bundle_only","descriptor_only"],"type":"string"}},"required":["id","slug","name","version","proofTier","runtimeMode"],"additionalProperties":false},"organization":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"externalRef":{"type":"string","minLength":1}},"required":["slug","name","externalRef"],"additionalProperties":false},"orgSwitcher":{"type":"object","properties":{"selectedTemplateSlug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"selectedOrganizationSlug":{"type":"string","minLength":1},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","pattern":"^[a-z][a-z0-9-]*$","description":"Organizer template slug, for example country-club or restaurant."},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"proofTier":{"enum":["docs-only","fixture-backed","local-demo","staging-live"],"type":"string"},"runtimeMode":{"enum":["bundle_only","descriptor_only"],"type":"string"},"capabilities":{"type":"array","items":{"type":"string","minLength":1}},"contexts":{"type":"integer","minimum":0,"maximum":9007199254740991},"unsupportedSeams":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","slug","name","version","proofTier","runtimeMode","capabilities","contexts","unsupportedSeams"],"additionalProperties":false}}},"required":["selectedTemplateSlug","selectedOrganizationSlug","options"],"additionalProperties":false},"panels":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"contexts":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"scheduleRules":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"resources":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"policiesAndRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"proofSurfaces":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"unsupported":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["capabilities","contexts","scheduleRules","resources","policiesAndRates","proofSurfaces","unsupported"],"additionalProperties":false},"parity":{"type":"object","properties":{"source":{"const":"organizer-template-install-report"},"cliCommands":{"type":"array","items":{"type":"string","minLength":1}},"browserRouteHints":{"type":"array","items":{"type":"string","minLength":1}}},"required":["source","cliCommands","browserRouteHints"],"additionalProperties":false},"readiness":{"type":"object","properties":{"dryRunOnly":{"const":true},"guardedInstallAvailable":{"const":true},"disposableAdapterRequiredForMutation":{"const":true},"durableTemplateInstallTables":{"const":"deferred"},"unsupportedSeamsLive":{"const":false}},"required":["dryRunOnly","guardedInstallAvailable","disposableAdapterRequiredForMutation","durableTemplateInstallTables","unsupportedSeamsLive"],"additionalProperties":false}},"required":["schemaVersion","sourceReportSchemaVersion","sourceDeterminismKey","venueProductionReady","template","organization","orgSwitcher","panels","parity","readiness"],"additionalProperties":{}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[]}},"/api/v1/booking/media/assets":{"get":{"operationId":"bookingListMediaAssets","summary":"List booking media assets","description":"Lists durable booking.media_asset catalog rows for the caller organization, optionally scoped to one bookable context. Assets remain served through authenticated Worker routes, not a public CDN.","tags":["booking-media"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Optional bookable context filter."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Source Space provenance. Required while bindingScope is context; nullable after explicit organization promotion and source-Space deletion."},"bindingScope":{"enum":["context","organization"],"type":"string","description":"Reuse boundary for the asset catalog row. context assets remain confined to their source Space; organization assets may be reused by Events in the same organization."},"fileName":{"type":"string","minLength":1,"description":"Original safe file name retained for display/download."},"contentType":{"type":"string","minLength":1,"description":"Validated media MIME type."},"size":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Stored byte size."},"role":{"type":"string","minLength":1,"description":"Catalog role supplied at upload time."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Asset metadata compare-and-swap version."},"uploadedBy":{"anyOf":[{"type":"string","minLength":1},{"const":"unknown"}],"description":"Authenticated principal that uploaded the asset, or unknown for legacy evidence."},"uploadedAt":{"type":"string","format":"date-time","description":"Upload timestamp."},"href":{"type":"string","minLength":1,"description":"Authenticated asset metadata/byte route."},"thumbnailHref":{"type":"string","minLength":1,"description":"Authenticated thumbnail variant route."},"cardHref":{"type":"string","minLength":1,"description":"Authenticated card variant route."},"heroHref":{"type":"string","minLength":1,"description":"Authenticated hero variant route."},"floorPlanHref":{"type":"string","minLength":1,"description":"Authenticated floor-plan variant route."}},"required":["id","contextId","bindingScope","fileName","contentType","size","role","version","uploadedBy","uploadedAt","href"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},"example":{"assets":[{"id":"018fa100-0000-4000-8000-000000000a01","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","bindingScope":"context","version":2,"fileName":"course-map.png","contentType":"image/png","size":48291,"role":"floor_plan","uploadedBy":"018fa100-0000-4000-8000-000000000301","uploadedAt":"2026-06-20T01:15:00.000Z","href":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01","thumbnailHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/thumbnail","cardHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/card","heroHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/hero","floorPlanHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/floorPlan"}]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context filter not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingUploadMediaAsset","summary":"Upload booking media asset","description":"Creates a durable booking.media_asset catalog row and uploads private context-scoped bytes into BOOKING_MEDIA_BUCKET. The mounted endpoint accepts multipart/form-data with contextId, role, and file; it also supports application/octet-stream with contextId/fileName/role query params for SDK and CLI proof.","tags":["booking-media"],"parameters":[{"name":"contextId","in":"query","schema":{"type":"string","format":"uuid","description":"Required for application/octet-stream uploads; multipart uploads carry contextId in the form body."},"allowEmptyValue":true,"allowReserved":true},{"name":"fileName","in":"query","schema":{"type":"string","minLength":1,"description":"Optional file name for application/octet-stream uploads."},"allowEmptyValue":true,"allowReserved":true},{"name":"role","in":"query","schema":{"type":"string","minLength":1,"default":"context_media","description":"Optional media role for application/octet-stream uploads, such as context_overview or floor_plan."},"allowEmptyValue":true,"allowReserved":true}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"contextId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"role":{"type":"string","minLength":1,"default":"context_media","description":"Caller-supplied media role such as context_overview, floor_plan, event_packet, or csv_import."},"fileName":{"type":"string","minLength":1},"file":{"description":"multipart/form-data file part. Omit for application/octet-stream uploads, which use contextId/fileName/role query params."}},"additionalProperties":false}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"Upload accepts multipart/form-data with contextId, role, and file. The mounted REST route also accepts application/octet-stream with contextId/fileName/role query params."},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"asset":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Source Space provenance. Required while bindingScope is context; nullable after explicit organization promotion and source-Space deletion."},"bindingScope":{"enum":["context","organization"],"type":"string","description":"Reuse boundary for the asset catalog row. context assets remain confined to their source Space; organization assets may be reused by Events in the same organization."},"fileName":{"type":"string","minLength":1,"description":"Original safe file name retained for display/download."},"contentType":{"type":"string","minLength":1,"description":"Validated media MIME type."},"size":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Stored byte size."},"role":{"type":"string","minLength":1,"description":"Catalog role supplied at upload time."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Asset metadata compare-and-swap version."},"uploadedBy":{"anyOf":[{"type":"string","minLength":1},{"const":"unknown"}],"description":"Authenticated principal that uploaded the asset, or unknown for legacy evidence."},"uploadedAt":{"type":"string","format":"date-time","description":"Upload timestamp."},"href":{"type":"string","minLength":1,"description":"Authenticated asset metadata/byte route."},"thumbnailHref":{"type":"string","minLength":1,"description":"Authenticated thumbnail variant route."},"cardHref":{"type":"string","minLength":1,"description":"Authenticated card variant route."},"heroHref":{"type":"string","minLength":1,"description":"Authenticated hero variant route."},"floorPlanHref":{"type":"string","minLength":1,"description":"Authenticated floor-plan variant route."}},"required":["id","contextId","bindingScope","fileName","contentType","size","role","version","uploadedBy","uploadedAt","href"],"additionalProperties":false}},"required":["asset"],"additionalProperties":false},"example":{"asset":{"id":"018fa100-0000-4000-8000-000000000a01","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","bindingScope":"context","version":2,"fileName":"course-map.png","contentType":"image/png","size":48291,"role":"floor_plan","uploadedBy":"018fa100-0000-4000-8000-000000000301","uploadedAt":"2026-06-20T01:15:00.000Z","href":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01","thumbnailHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/thumbnail","cardHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/card","heroHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/hero","floorPlanHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/floorPlan"}}}}},"400":{"description":"Bad request: missing contextId/file, unsupported upload content type, oversized upload, or R2 binding unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Context not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/media/assets/{assetId}":{"get":{"operationId":"bookingGetMediaAsset","summary":"Read booking media asset","description":"Returns durable JSON metadata for a private media asset after catalog org/context ownership checks. The mounted authenticated REST href can stream bytes when called directly without metadata=true; generated clients use this JSON-safe metadata operation.","tags":["booking-media"],"parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."}},{"name":"metadata","in":"query","schema":{"const":true,"default":true,"description":"Contract/SDK metadata read. The authenticated REST href can still stream bytes when metadata is omitted outside generated clients."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"asset":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Source Space provenance. Required while bindingScope is context; nullable after explicit organization promotion and source-Space deletion."},"bindingScope":{"enum":["context","organization"],"type":"string","description":"Reuse boundary for the asset catalog row. context assets remain confined to their source Space; organization assets may be reused by Events in the same organization."},"fileName":{"type":"string","minLength":1,"description":"Original safe file name retained for display/download."},"contentType":{"type":"string","minLength":1,"description":"Validated media MIME type."},"size":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Stored byte size."},"role":{"type":"string","minLength":1,"description":"Catalog role supplied at upload time."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Asset metadata compare-and-swap version."},"uploadedBy":{"anyOf":[{"type":"string","minLength":1},{"const":"unknown"}],"description":"Authenticated principal that uploaded the asset, or unknown for legacy evidence."},"uploadedAt":{"type":"string","format":"date-time","description":"Upload timestamp."},"href":{"type":"string","minLength":1,"description":"Authenticated asset metadata/byte route."},"thumbnailHref":{"type":"string","minLength":1,"description":"Authenticated thumbnail variant route."},"cardHref":{"type":"string","minLength":1,"description":"Authenticated card variant route."},"heroHref":{"type":"string","minLength":1,"description":"Authenticated hero variant route."},"floorPlanHref":{"type":"string","minLength":1,"description":"Authenticated floor-plan variant route."}},"required":["id","contextId","bindingScope","fileName","contentType","size","role","version","uploadedBy","uploadedAt","href"],"additionalProperties":false}},"required":["asset"],"additionalProperties":false},"example":{"asset":{"id":"018fa100-0000-4000-8000-000000000a01","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","bindingScope":"context","version":2,"fileName":"course-map.png","contentType":"image/png","size":48291,"role":"floor_plan","uploadedBy":"018fa100-0000-4000-8000-000000000301","uploadedAt":"2026-06-20T01:15:00.000Z","href":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01","thumbnailHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/thumbnail","cardHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/card","heroHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/hero","floorPlanHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/floorPlan"}}}}},"400":{"description":"Bad request: malformed durable media asset id.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Media asset not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"delete":{"operationId":"bookingDeleteMediaAsset","summary":"Delete booking media asset","description":"Soft-deletes the durable booking.media_asset catalog row and deletes the private R2 object after verifying the asset belongs to the caller organization.","tags":["booking-media"],"parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true},"id":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."}},"required":["deleted","id"],"additionalProperties":false},"example":{"deleted":true,"id":"018fa100-0000-4000-8000-000000000a01"}}}},"400":{"description":"Bad request: malformed durable media asset id.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: media asset still has Event bindings.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/media/assets/{assetId}/variants/{variant}":{"get":{"operationId":"bookingGetMediaAssetVariant","summary":"Read booking media image variant","description":"Streams an authenticated, org-scoped Cloudflare Images variant for an image asset stored privately in BOOKING_MEDIA_BUCKET. The catalog row and session are checked before the Worker reads R2 bytes or returns a cached variant.","tags":["booking-media"],"parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."}},{"name":"variant","in":"path","required":true,"schema":{"enum":["thumbnail","card","hero","floorPlan"],"type":"string","description":"Cloudflare Images-backed private image variant."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"description":"Binary image response"},{"not":{}}]}}}},"400":{"description":"Bad request: malformed durable media asset id or unsupported image variant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Media asset not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"415":{"description":"Unsupported media type: non-image media asset.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/media/assets/{assetId}/promote":{"post":{"operationId":"bookingPromoteMediaAsset","summary":"Promote media asset for organization reuse","description":"Explicitly widens a context asset to organization scope after current organizer-capability authorization. The bytes/catalog remain in booking media; promotion is versioned, idempotent, same-organization only, and never implicit.","tags":["booking-media"],"parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."},"example":"018fa100-0000-4000-8000-000000000a01"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current asset version required by compare-and-swap."},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for this explicit scope-promotion command."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":2,"clientRequestId":"media-promote-20260724-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"asset":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Opaque durable booking media asset identifier. New booking.media_asset rows use UUIDs; legacy mounted media catalogs may return non-UUID ids and must remain readable."},"contextId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Source Space provenance. Required while bindingScope is context; nullable after explicit organization promotion and source-Space deletion."},"bindingScope":{"enum":["context","organization"],"type":"string","description":"Reuse boundary for the asset catalog row. context assets remain confined to their source Space; organization assets may be reused by Events in the same organization."},"fileName":{"type":"string","minLength":1,"description":"Original safe file name retained for display/download."},"contentType":{"type":"string","minLength":1,"description":"Validated media MIME type."},"size":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Stored byte size."},"role":{"type":"string","minLength":1,"description":"Catalog role supplied at upload time."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Asset metadata compare-and-swap version."},"uploadedBy":{"anyOf":[{"type":"string","minLength":1},{"const":"unknown"}],"description":"Authenticated principal that uploaded the asset, or unknown for legacy evidence."},"uploadedAt":{"type":"string","format":"date-time","description":"Upload timestamp."},"href":{"type":"string","minLength":1,"description":"Authenticated asset metadata/byte route."},"thumbnailHref":{"type":"string","minLength":1,"description":"Authenticated thumbnail variant route."},"cardHref":{"type":"string","minLength":1,"description":"Authenticated card variant route."},"heroHref":{"type":"string","minLength":1,"description":"Authenticated hero variant route."},"floorPlanHref":{"type":"string","minLength":1,"description":"Authenticated floor-plan variant route."}},"required":["id","contextId","bindingScope","fileName","contentType","size","role","version","uploadedBy","uploadedAt","href"],"additionalProperties":false}},"required":["asset"],"additionalProperties":false},"example":{"asset":{"id":"018fa100-0000-4000-8000-000000000a01","contextId":"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d","bindingScope":"organization","fileName":"event-hero.png","contentType":"image/png","size":48291,"role":"event_hero","version":3,"uploadedBy":"018fa100-0000-4000-8000-000000000301","uploadedAt":"2026-07-24T10:00:00.000Z","href":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01","thumbnailHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/thumbnail","cardHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/card","heroHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/hero","floorPlanHref":"https://sonik-booking-app.example.com/api/v1/booking/media/assets/018fa100-0000-4000-8000-000000000a01/variants/floorPlan"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.manage.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The media asset was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"409":{"description":"The asset version or idempotency key conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_VERSION_CONFLICT","EVENT_MEDIA_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_VERSION_CONFLICT","message":"Event media version changed"}}}}},"422":{"description":"The strict media promotion request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/media":{"get":{"operationId":"bookingListEventMedia","summary":"List Event media bindings","description":"Lists ordered Event presentation bindings without copying media bytes or catalog metadata into the Event.","tags":["booking-media"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event identifier."},"example":"018fa100-0000-4000-8000-000000000e01"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"eventId":{"type":"string","format":"uuid","description":"Canonical Event receiving the media binding."},"assetId":{"type":"string","format":"uuid","description":"Existing booking.media_asset UUID."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Zero-based Event presentation order."},"status":{"enum":["active","hidden"],"type":"string","description":"Whether the binding participates in Event presentation."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Binding compare-and-swap version."},"createdBy":{"type":"string","minLength":1,"description":"Principal that created the binding."},"updatedBy":{"type":"string","minLength":1,"description":"Principal that last changed the binding."},"createdAt":{"type":"string","format":"date-time","description":"Binding creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last binding mutation timestamp."}},"required":["id","eventId","assetId","role","accessibleText","sortOrder","status","version","createdBy","updatedBy","createdAt","updatedAt"],"additionalProperties":false}}},"required":["bindings"],"additionalProperties":false},"example":{"bindings":[{"id":"018fa100-0000-4000-8000-000000000a11","eventId":"018fa100-0000-4000-8000-000000000e01","assetId":"018fa100-0000-4000-8000-000000000a01","role":{"kind":"canonical","value":"primary"},"accessibleText":"Main event artwork showing the stage and event title","sortOrder":0,"status":"active","version":1,"createdBy":"018fa100-0000-4000-8000-000000000301","updatedBy":"018fa100-0000-4000-8000-000000000301","createdAt":"2026-07-24T10:05:00.000Z","updatedAt":"2026-07-24T10:05:00.000Z"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.read.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The Event was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"422":{"description":"The Event media query is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingBindEventMedia","summary":"Bind media to an Event","description":"Binds an existing same-organization asset to an Event with a typed role, required accessible text, and stable order. Context assets may bind only when the Event references that same organization Space; independent Events require explicit asset promotion first.","tags":["booking-media"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event identifier."},"example":"018fa100-0000-4000-8000-000000000e01"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid","description":"Existing same-organization media asset."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Zero-based Event presentation order.","default":0},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for this bind command."}},"required":["assetId","role","accessibleText","clientRequestId"],"additionalProperties":false},"example":{"assetId":"018fa100-0000-4000-8000-000000000a01","role":{"kind":"canonical","value":"primary"},"accessibleText":"Main event artwork showing the stage and event title","sortOrder":0,"clientRequestId":"event-media-bind-20260724-1"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"binding":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"eventId":{"type":"string","format":"uuid","description":"Canonical Event receiving the media binding."},"assetId":{"type":"string","format":"uuid","description":"Existing booking.media_asset UUID."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Zero-based Event presentation order."},"status":{"enum":["active","hidden"],"type":"string","description":"Whether the binding participates in Event presentation."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Binding compare-and-swap version."},"createdBy":{"type":"string","minLength":1,"description":"Principal that created the binding."},"updatedBy":{"type":"string","minLength":1,"description":"Principal that last changed the binding."},"createdAt":{"type":"string","format":"date-time","description":"Binding creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last binding mutation timestamp."}},"required":["id","eventId","assetId","role","accessibleText","sortOrder","status","version","createdBy","updatedBy","createdAt","updatedAt"],"additionalProperties":false}},"required":["binding"],"additionalProperties":false},"example":{"binding":{"id":"018fa100-0000-4000-8000-000000000a11","eventId":"018fa100-0000-4000-8000-000000000e01","assetId":"018fa100-0000-4000-8000-000000000a01","role":{"kind":"canonical","value":"primary"},"accessibleText":"Main event artwork showing the stage and event title","sortOrder":0,"status":"active","version":1,"createdBy":"018fa100-0000-4000-8000-000000000301","updatedBy":"018fa100-0000-4000-8000-000000000301","createdAt":"2026-07-24T10:05:00.000Z","updatedAt":"2026-07-24T10:05:00.000Z"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.manage.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The Event or media asset was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"409":{"description":"The asset scope, primary role, idempotency key, or concurrent binding conflicts.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_SCOPE_CONFLICT","EVENT_MEDIA_IDEMPOTENCY_CONFLICT","EVENT_MEDIA_BINDING_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_BINDING_CONFLICT","message":"The Event already has an active canonical primary binding"}}}}},"422":{"description":"The strict Event-media binding request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/media/{bindingId}":{"patch":{"operationId":"bookingUpdateEventMedia","summary":"Update Event media binding","description":"Updates presentation role, accessible text, or visibility with optimistic concurrency. Asset bytes and catalog metadata remain unchanged.","tags":["booking-media"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event identifier."},"example":"018fa100-0000-4000-8000-000000000e01"},{"name":"bindingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"example":"018fa100-0000-4000-8000-000000000a11"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current binding version required by compare-and-swap."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"status":{"enum":["active","hidden"],"type":"string","description":"Whether the binding participates in Event presentation."},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for this update command."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"accessibleText":"Updated main event artwork description","clientRequestId":"event-media-update-20260724-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"binding":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"eventId":{"type":"string","format":"uuid","description":"Canonical Event receiving the media binding."},"assetId":{"type":"string","format":"uuid","description":"Existing booking.media_asset UUID."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Zero-based Event presentation order."},"status":{"enum":["active","hidden"],"type":"string","description":"Whether the binding participates in Event presentation."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Binding compare-and-swap version."},"createdBy":{"type":"string","minLength":1,"description":"Principal that created the binding."},"updatedBy":{"type":"string","minLength":1,"description":"Principal that last changed the binding."},"createdAt":{"type":"string","format":"date-time","description":"Binding creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last binding mutation timestamp."}},"required":["id","eventId","assetId","role","accessibleText","sortOrder","status","version","createdBy","updatedBy","createdAt","updatedAt"],"additionalProperties":false}},"required":["binding"],"additionalProperties":false},"example":{"binding":{"id":"018fa100-0000-4000-8000-000000000a11","eventId":"018fa100-0000-4000-8000-000000000e01","assetId":"018fa100-0000-4000-8000-000000000a01","role":{"kind":"canonical","value":"primary"},"accessibleText":"Updated main event artwork description","sortOrder":0,"status":"active","version":2,"createdBy":"018fa100-0000-4000-8000-000000000301","updatedBy":"018fa100-0000-4000-8000-000000000301","createdAt":"2026-07-24T10:05:00.000Z","updatedAt":"2026-07-24T10:10:00.000Z"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.manage.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The Event-media binding was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"409":{"description":"The binding version, role, or idempotency key conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_VERSION_CONFLICT","EVENT_MEDIA_BINDING_CONFLICT","EVENT_MEDIA_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_VERSION_CONFLICT","message":"Event media version changed"}}}}},"422":{"description":"The strict Event-media update is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]},"delete":{"operationId":"bookingUnbindEventMedia","summary":"Remove Event media binding","description":"Removes only the Event association. The underlying booking media asset and private bytes remain available for permitted reuse.","tags":["booking-media"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event identifier."},"example":"018fa100-0000-4000-8000-000000000e01"},{"name":"bindingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"example":"018fa100-0000-4000-8000-000000000a11"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current binding version required by compare-and-swap."},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for this unbind command."}},"required":["expectedVersion","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":2,"clientRequestId":"event-media-unbind-20260724-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"unbound":{"const":true},"eventId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"bindingId":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."}},"required":["unbound","eventId","bindingId"],"additionalProperties":false},"example":{"unbound":true,"eventId":"018fa100-0000-4000-8000-000000000e01","bindingId":"018fa100-0000-4000-8000-000000000a11"}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.manage.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The Event-media binding was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"409":{"description":"The binding version or idempotency key conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_VERSION_CONFLICT","EVENT_MEDIA_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_VERSION_CONFLICT","message":"Event media version changed"}}}}},"422":{"description":"The strict Event-media unbind request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"destructive","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/media/{bindingId}/replace":{"post":{"operationId":"bookingReplaceEventMedia","summary":"Replace the Event primary media binding","description":"Atomically replaces the active canonical primary binding with another ready same-organization asset while preserving its presentation role, status, and sort order. Failure retains the original binding and never deletes media bytes.","tags":["booking-media"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event identifier."},"example":"018fa100-0000-4000-8000-000000000e01"},{"name":"bindingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"example":"018fa100-0000-4000-8000-000000000a11"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current primary binding version required by compare-and-swap."},"assetId":{"type":"string","format":"uuid","description":"Ready same-organization media asset that will become the Event primary."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for this atomic replacement command."}},"required":["expectedVersion","assetId","accessibleText","clientRequestId"],"additionalProperties":false},"example":{"expectedVersion":1,"assetId":"018fa100-0000-4000-8000-000000000a02","accessibleText":"Guests entering beneath the replacement Event artwork","clientRequestId":"event-media-replace-20260731-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"binding":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"eventId":{"type":"string","format":"uuid","description":"Canonical Event receiving the media binding."},"assetId":{"type":"string","format":"uuid","description":"Existing booking.media_asset UUID."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Zero-based Event presentation order."},"status":{"enum":["active","hidden"],"type":"string","description":"Whether the binding participates in Event presentation."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Binding compare-and-swap version."},"createdBy":{"type":"string","minLength":1,"description":"Principal that created the binding."},"updatedBy":{"type":"string","minLength":1,"description":"Principal that last changed the binding."},"createdAt":{"type":"string","format":"date-time","description":"Binding creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last binding mutation timestamp."}},"required":["id","eventId","assetId","role","accessibleText","sortOrder","status","version","createdBy","updatedBy","createdAt","updatedAt"],"additionalProperties":false}},"required":["binding"],"additionalProperties":false},"example":{"binding":{"id":"018fa100-0000-4000-8000-000000000a12","eventId":"018fa100-0000-4000-8000-000000000e01","assetId":"018fa100-0000-4000-8000-000000000a02","role":{"kind":"canonical","value":"primary"},"accessibleText":"Guests entering beneath the replacement Event artwork","sortOrder":0,"status":"active","version":1,"createdBy":"018fa100-0000-4000-8000-000000000301","updatedBy":"018fa100-0000-4000-8000-000000000301","createdAt":"2026-07-31T13:30:00.000Z","updatedAt":"2026-07-31T13:30:00.000Z"}}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.manage.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The Event, current binding, or replacement asset was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"409":{"description":"The binding version, replacement asset, primary role, or idempotency key conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_VERSION_CONFLICT","EVENT_MEDIA_SCOPE_CONFLICT","EVENT_MEDIA_BINDING_CONFLICT","EVENT_MEDIA_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_VERSION_CONFLICT","message":"Event media version changed"}}}}},"422":{"description":"The strict Event-media replacement request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/events/{eventId}/media/reorder":{"post":{"operationId":"bookingReorderEventMedia","summary":"Reorder Event media bindings","description":"Atomically replaces the complete Event binding order. Every binding version is compared before any row changes.","tags":["booking-media"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Canonical Event identifier."},"example":"018fa100-0000-4000-8000-000000000e01"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","properties":{"bindingId":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Current binding version required by compare-and-swap."}},"required":["bindingId","expectedVersion"],"additionalProperties":false},"description":"Complete ordered binding list; array position becomes sortOrder."},"clientRequestId":{"type":"string","minLength":1,"description":"Organization-scoped idempotency key for this reorder command."}},"required":["bindings","clientRequestId"],"additionalProperties":false},"example":{"bindings":[{"bindingId":"018fa100-0000-4000-8000-000000000a11","expectedVersion":1}],"clientRequestId":"event-media-reorder-20260724-1"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"bindings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Durable Event-media binding identifier."},"eventId":{"type":"string","format":"uuid","description":"Canonical Event receiving the media binding."},"assetId":{"type":"string","format":"uuid","description":"Existing booking.media_asset UUID."},"role":{"anyOf":[{"type":"object","properties":{"kind":{"const":"canonical"},"value":{"enum":["primary","gallery","card","logo","attachment"],"type":"string","description":"Supported Event presentation role."}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"custom"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_.-]{0,63}$","description":"Namespaced machine key for an organization-defined presentation role."},"displayName":{"type":"string","minLength":1,"maxLength":100,"description":"Human-facing name for the custom role."}},"required":["kind","key","displayName"],"additionalProperties":false}],"description":"Typed Event presentation role. Custom roles require an explicit discriminator and machine key; arbitrary strings are not canonical roles."},"accessibleText":{"type":"string","minLength":1,"maxLength":500,"description":"Required accessible label or alternative text describing the media's purpose/content."},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Zero-based Event presentation order."},"status":{"enum":["active","hidden"],"type":"string","description":"Whether the binding participates in Event presentation."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0,"description":"Binding compare-and-swap version."},"createdBy":{"type":"string","minLength":1,"description":"Principal that created the binding."},"updatedBy":{"type":"string","minLength":1,"description":"Principal that last changed the binding."},"createdAt":{"type":"string","format":"date-time","description":"Binding creation timestamp."},"updatedAt":{"type":"string","format":"date-time","description":"Last binding mutation timestamp."}},"required":["id","eventId","assetId","role","accessibleText","sortOrder","status","version","createdBy","updatedBy","createdAt","updatedAt"],"additionalProperties":false}}},"required":["bindings"],"additionalProperties":false},"example":{"bindings":[{"id":"018fa100-0000-4000-8000-000000000a11","eventId":"018fa100-0000-4000-8000-000000000e01","assetId":"018fa100-0000-4000-8000-000000000a01","role":{"kind":"canonical","value":"primary"},"accessibleText":"Main event artwork showing the stage and event title","sortOrder":0,"status":"active","version":2,"createdBy":"018fa100-0000-4000-8000-000000000301","updatedBy":"018fa100-0000-4000-8000-000000000301","createdAt":"2026-07-24T10:05:00.000Z","updatedAt":"2026-07-24T10:12:00.000Z"}]}}}},"401":{"description":"A trusted authenticated booking actor is required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"unauthorized","message":"Current Amplify session is required"}}}}},"403":{"description":"The current organizer lacks booking.event.manage.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Amplify denied a required organizer capability"}}}}},"404":{"description":"The Event or Event-media binding was not found.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_NOT_FOUND","message":"Event media resource was not found"}}}}},"409":{"description":"The complete order, binding version, or idempotency key conflicts with current state.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_ORDER_CONFLICT","EVENT_MEDIA_VERSION_CONFLICT","EVENT_MEDIA_IDEMPOTENCY_CONFLICT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_VERSION_CONFLICT","message":"Event media version changed"}}}}},"422":{"description":"The strict Event-media reorder request is invalid.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["EVENT_MEDIA_INPUT_INVALID"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"EVENT_MEDIA_INPUT_INVALID","message":"Event media input is invalid"}}}}},"503":{"description":"Organizer capability authority is unavailable.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHORITY_UNAVAILABLE","message":"Organizer capability authority is unavailable"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes":{"get":{"operationId":"bookingListDisputes","summary":"List disputes","description":"Lists org-scoped disputes, urgency-sorted: open disputes by dueBy ascending (derived, never stored), terminal states after. source=terminal rows render Sonik evidence context for charges processed outside Sonik. Mounted runtime: booking.payment_disputes rows written by the webhook consequence lane; FORCE RLS org scope.","tags":["booking-disputes"],"parameters":[{"name":"status","in":"query","schema":{"enum":["warning_needs_response","warning_under_review","warning_closed","needs_response","under_review","won","lost","appeal_needs_response","appeal_under_review","prevented"],"type":"string","description":"Provider dispute status vocabulary (Stripe dispute object; prevented = stopped before it became a chargeback)."},"allowEmptyValue":true,"allowReserved":true},{"name":"source","in":"query","schema":{"enum":["sonik","terminal"],"type":"string","description":"Charge origin: \"terminal\" renders the \"Processed outside Sonik\" tag — viewable and fightable with Sonik ticket/scan evidence without Terminal processing."},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"disputes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…). Host rows key on it."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization from session."},"chargeRef":{"type":"string","minLength":1,"description":"Provider charge reference."},"paymentRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Host payment reference (pay_…)."},"orderRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Host order reference (e.g. SNK-31842)."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Disputed amount."},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Non-refundable dispute fee."},"status":{"enum":["warning_needs_response","warning_under_review","warning_closed","needs_response","under_review","won","lost","appeal_needs_response","appeal_under_review","prevented"],"type":"string","description":"Provider dispute status vocabulary (Stripe dispute object; prevented = stopped before it became a chargeback)."},"defenseState":{"enum":["none","staged","submitted","accepted"],"type":"string","description":"Host defense posture derived from command receipts, never hand-maintained."},"reason":{"type":"object","properties":{"plain":{"type":"string","minLength":1,"description":"Plain-language reason copy."},"networkCode":{"type":"string","minLength":1,"description":"Network reason code (e.g. \"visa 13.1\")."},"raw":{"type":"string","minLength":1,"description":"Provider reason enum value, verbatim."}},"required":["plain","networkCode","raw"],"additionalProperties":false,"description":"Reason in operator language plus the network and provider codes."},"source":{"enum":["sonik","terminal"],"type":"string","description":"Charge origin: \"terminal\" renders the \"Processed outside Sonik\" tag — viewable and fightable with Sonik ticket/scan evidence without Terminal processing."},"dueBy":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Network response deadline. Countdown, window meter, and urgency sort ALL derive from this — never a stored string."},"hostIdentity":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"description":"Host person display name (never a processor customer object)."}},"required":["displayName"],"additionalProperties":false},{"type":"null"}],"description":"Cardholder rendered as host identity — the only identity."},"bookingRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Linked booking/event reference."},"submissionCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Provider submission count; bounds re-submission (architect Q3 semantics)."},"openedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","chargeRef","paymentRef","orderRef","amount","fee","status","defenseState","reason","source","dueBy","hostIdentity","bookingRef","submissionCount","openedAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["disputes","nextCursor"],"additionalProperties":false},"example":{"disputes":[{"id":"dp_7c31f2a9","organizationId":"11111111-1111-4111-8111-111111111111","chargeRef":"ch_31842aa1","paymentRef":"pay_31842aa1","orderRef":"SNK-31842","amount":{"amountCents":18400,"currency":"USD"},"fee":{"amountCents":1500,"currency":"USD"},"status":"needs_response","defenseState":"staged","reason":{"plain":"Services not received","networkCode":"visa 13.1","raw":"services_not_received"},"source":"sonik","dueBy":"2026-07-05T16:00:00.000Z","hostIdentity":{"displayName":"Jordan Ellis"},"bookingRef":"SNK-31842","submissionCount":0,"openedAt":"2026-06-28T15:00:00.000Z","updatedAt":"2026-07-04T02:00:00.000Z"},{"id":"dp_1a90cc44","organizationId":"11111111-1111-4111-8111-111111111111","chargeRef":"ch_clubhouse01","paymentRef":null,"orderRef":null,"amount":{"amountCents":18400,"currency":"USD"},"fee":{"amountCents":1500,"currency":"USD"},"status":"won","defenseState":"submitted","reason":{"plain":"Fraudulent","networkCode":"visa 10.4","raw":"fraudulent"},"source":"terminal","dueBy":null,"hostIdentity":null,"bookingRef":null,"submissionCount":1,"openedAt":"2026-06-20T15:00:00.000Z","updatedAt":"2026-07-04T02:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: status/source/cursor query validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}":{"get":{"operationId":"bookingGetDispute","summary":"Get a dispute case file","description":"Returns one dispute within the caller organization. Cross-org and unknown ids are both 404 under org-scoped invisibility. Mounted runtime over booking.payment_disputes.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…). Host rows key on it."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization from session."},"chargeRef":{"type":"string","minLength":1,"description":"Provider charge reference."},"paymentRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Host payment reference (pay_…)."},"orderRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Host order reference (e.g. SNK-31842)."},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Disputed amount."},"fee":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Non-refundable dispute fee."},"status":{"enum":["warning_needs_response","warning_under_review","warning_closed","needs_response","under_review","won","lost","appeal_needs_response","appeal_under_review","prevented"],"type":"string","description":"Provider dispute status vocabulary (Stripe dispute object; prevented = stopped before it became a chargeback)."},"defenseState":{"enum":["none","staged","submitted","accepted"],"type":"string","description":"Host defense posture derived from command receipts, never hand-maintained."},"reason":{"type":"object","properties":{"plain":{"type":"string","minLength":1,"description":"Plain-language reason copy."},"networkCode":{"type":"string","minLength":1,"description":"Network reason code (e.g. \"visa 13.1\")."},"raw":{"type":"string","minLength":1,"description":"Provider reason enum value, verbatim."}},"required":["plain","networkCode","raw"],"additionalProperties":false,"description":"Reason in operator language plus the network and provider codes."},"source":{"enum":["sonik","terminal"],"type":"string","description":"Charge origin: \"terminal\" renders the \"Processed outside Sonik\" tag — viewable and fightable with Sonik ticket/scan evidence without Terminal processing."},"dueBy":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Network response deadline. Countdown, window meter, and urgency sort ALL derive from this — never a stored string."},"hostIdentity":{"anyOf":[{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"description":"Host person display name (never a processor customer object)."}},"required":["displayName"],"additionalProperties":false},{"type":"null"}],"description":"Cardholder rendered as host identity — the only identity."},"bookingRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Linked booking/event reference."},"submissionCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Provider submission count; bounds re-submission (architect Q3 semantics)."},"openedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","chargeRef","paymentRef","orderRef","amount","fee","status","defenseState","reason","source","dueBy","hostIdentity","bookingRef","submissionCount","openedAt","updatedAt"],"additionalProperties":false},"example":{"id":"dp_7c31f2a9","organizationId":"11111111-1111-4111-8111-111111111111","chargeRef":"ch_31842aa1","paymentRef":"pay_31842aa1","orderRef":"SNK-31842","amount":{"amountCents":18400,"currency":"USD"},"fee":{"amountCents":1500,"currency":"USD"},"status":"needs_response","defenseState":"staged","reason":{"plain":"Services not received","networkCode":"visa 13.1","raw":"services_not_received"},"source":"sonik","dueBy":"2026-07-05T16:00:00.000Z","hostIdentity":{"displayName":"Jordan Ellis"},"bookingRef":"SNK-31842","submissionCount":0,"openedAt":"2026-06-28T15:00:00.000Z","updatedAt":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}/timeline":{"get":{"operationId":"bookingListDisputeTimeline","summary":"List the derived dispute timeline","description":"READ-ONLY BY DESIGN: every entry derives at read time from the two admissible durable sources merged chronologically — booking.payment_events joined through the intake-extracted dispute id (the network/system chapter, ruling D-H1) UNIONed with the dispute command receipts this host wrote (payments.dispute.update_evidence / .close → the sonik-action chapter); zero synthetic entries; gaps render as gaps; every entry carries its sourceRef. No write endpoint exists for this family — a structural absence, not a deferred feature.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Entry id, deterministic from its source row."},"disputeId":{"type":"string","minLength":1},"kind":{"enum":["payment","dispute","funds","sonik-action"],"type":"string","description":"Chapter classification for the case record."},"actor":{"type":"object","properties":{"kind":{"enum":["network","sonik","operator"],"type":"string"},"displayName":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Named operator when kind=operator; null for system actors."}},"required":["kind","displayName"],"additionalProperties":false},"summary":{"type":"string","minLength":1,"description":"Terse operator-voice entry copy."},"occurredAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"sourceRef":{"type":"object","properties":{"kind":{"enum":["normalized_event","command_receipt"],"type":"string","description":"The ONLY two admissible sources — zero synthetic entries."},"id":{"type":"string","minLength":1}},"required":["kind","id"],"additionalProperties":false,"description":"Every entry traces to a normalized webhook event or a command receipt."},"evidenceRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional exhibit reference."}},"required":["id","disputeId","kind","actor","summary","occurredAt","sourceRef","evidenceRef"],"additionalProperties":false,"description":"Derived read model. No write path exists for this shape by design."}},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["entries","nextCursor"],"additionalProperties":false},"example":{"entries":[{"id":"tl_dispute_created","disputeId":"dp_7c31f2a9","kind":"dispute","actor":{"kind":"network","displayName":null},"summary":"Dispute opened: services not received (visa 13.1).","occurredAt":"2026-06-28T15:00:00.000Z","sourceRef":{"kind":"normalized_event","id":"evt_dispute_created_7c31f2a9"},"evidenceRef":null},{"id":"tl_funds_withdrawn","disputeId":"dp_7c31f2a9","kind":"funds","actor":{"kind":"network","displayName":null},"summary":"$184.00 withdrawn pending outcome; $15.00 fee assessed.","occurredAt":"2026-06-28T15:00:05.000Z","sourceRef":{"kind":"normalized_event","id":"evt_funds_withdrawn_7c31f2a9"},"evidenceRef":null},{"id":"tl_defense_staged","disputeId":"dp_7c31f2a9","kind":"sonik-action","actor":{"kind":"operator","displayName":"Dan"},"summary":"Defense assembled and staged: 6 exhibits (5 gathered by Sonik, 1 added by you).","occurredAt":"2026-07-04T02:00:00.000Z","sourceRef":{"kind":"command_receipt","id":"rcpt_stage_7c31f2a9_v1"},"evidenceRef":"file_evt31842doc"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}/evidence":{"get":{"operationId":"bookingGetDisputeEvidence","summary":"Get the evidence packet","description":"Returns the latest staged/submitted evidence packet with per-field provenance (Sonik prefill vs operator input). A dispute with no packet yet is 404 — an honest absence, never an invention. Packet WRITES stay with the Wave-2 respond machine.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"disputeId":{"type":"string","minLength":1},"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Packet version; re-submission appends versions."},"state":{"enum":["staged","submitted"],"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"fieldKey":{"type":"string","minLength":1,"description":"Canonical Stripe evidence field key (camelCase, one of the 27-field set owned by the vendored SDK builder — the SDK contract, not this file, is the key registry)."},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Text value; null for file-backed fields."},"fileRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider file id (file_…) from the purpose-locked dispute_evidence upload."},"provenance":{"type":"object","properties":{"source":{"enum":["sonik","operator"],"type":"string","description":"Who supplied the value."},"detail":{"type":"string","minLength":1,"description":"Named source, e.g. \"Sonik · check-in records\" or \"You\". Edits never erase it."}},"required":["source","detail"],"additionalProperties":false}},"required":["fieldKey","value","fileRef","provenance"],"additionalProperties":false}},"counts":{"type":"object","properties":{"sonik":{"type":"integer","minimum":0,"maximum":9007199254740991},"operator":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["sonik","operator"],"additionalProperties":false,"description":"Provenance split — the automation ratio the case file renders structurally."},"submissionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["disputeId","version","state","items","counts","submissionCount","updatedAt"],"additionalProperties":false},"example":{"disputeId":"dp_7c31f2a9","version":1,"state":"staged","items":[{"fieldKey":"accessActivityLog","value":"Gate A scan 2026-06-27 21:14 device D-04 staff K. Moore","fileRef":null,"provenance":{"source":"sonik","detail":"Sonik · check-in records"}},{"fieldKey":"serviceDate","value":"2026-06-27","fileRef":null,"provenance":{"source":"sonik","detail":"Sonik · order data"}},{"fieldKey":"serviceDocumentation","value":null,"fileRef":"file_evt31842doc","provenance":{"source":"sonik","detail":"Sonik · event records"}},{"fieldKey":"receipt","value":null,"fileRef":"file_rcpt31842","provenance":{"source":"sonik","detail":"Sonik · order data"}},{"fieldKey":"customerEmailAddress","value":"j.ellis@example.com","fileRef":null,"provenance":{"source":"sonik","detail":"Sonik · order data"}},{"fieldKey":"uncategorizedText","value":"Attendee entered at Gate A and stayed for the full event.","fileRef":null,"provenance":{"source":"operator","detail":"You"}}],"counts":{"sonik":5,"operator":1},"submissionCount":0,"updatedAt":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}/evidence/stage":{"post":{"operationId":"bookingStageDisputeEvidence","summary":"Stage evidence fields","description":"Stages evidence (provider update_evidence submit:false semantics via the payments-owned SDK request plan — ruling R1; gated on the dispute integration manifest). Staging bumps the packet and invalidates any outstanding review token (staleness beats replay). CE 3.0 enhanced-evidence staging stays engine-gated.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","minItems":1,"items":{"type":"object","properties":{"fieldKey":{"type":"string","minLength":1,"description":"Canonical Stripe evidence field key (camelCase, one of the 27-field set owned by the vendored SDK builder — the SDK contract, not this file, is the key registry)."},"value":{"anyOf":[{"type":"string"},{"type":"null"}]},"fileRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["fieldKey","value","fileRef"],"additionalProperties":false},"description":"Fields to stage (update_evidence submit:false semantics)."},"clientRequestId":{"type":"string","minLength":1}},"required":["fields"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"packet":{"type":"object","properties":{"disputeId":{"type":"string","minLength":1},"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Packet version; re-submission appends versions."},"state":{"enum":["staged","submitted"],"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"fieldKey":{"type":"string","minLength":1,"description":"Canonical Stripe evidence field key (camelCase, one of the 27-field set owned by the vendored SDK builder — the SDK contract, not this file, is the key registry)."},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Text value; null for file-backed fields."},"fileRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Provider file id (file_…) from the purpose-locked dispute_evidence upload."},"provenance":{"type":"object","properties":{"source":{"enum":["sonik","operator"],"type":"string","description":"Who supplied the value."},"detail":{"type":"string","minLength":1,"description":"Named source, e.g. \"Sonik · check-in records\" or \"You\". Edits never erase it."}},"required":["source","detail"],"additionalProperties":false}},"required":["fieldKey","value","fileRef","provenance"],"additionalProperties":false}},"counts":{"type":"object","properties":{"sonik":{"type":"integer","minimum":0,"maximum":9007199254740991},"operator":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["sonik","operator"],"additionalProperties":false,"description":"Provenance split — the automation ratio the case file renders structurally."},"submissionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["disputeId","version","state","items","counts","submissionCount","updatedAt"],"additionalProperties":false},"traceId":{"type":"string","minLength":1}},"required":["packet","traceId"],"additionalProperties":false},"example":{"packet":{"disputeId":"dp_7c31f2a9","version":1,"state":"staged","items":[{"fieldKey":"accessActivityLog","value":"Gate A scan 2026-06-27 21:14 device D-04 staff K. Moore","fileRef":null,"provenance":{"source":"sonik","detail":"Sonik · check-in records"}},{"fieldKey":"serviceDate","value":"2026-06-27","fileRef":null,"provenance":{"source":"sonik","detail":"Sonik · order data"}},{"fieldKey":"serviceDocumentation","value":null,"fileRef":"file_evt31842doc","provenance":{"source":"sonik","detail":"Sonik · event records"}},{"fieldKey":"receipt","value":null,"fileRef":"file_rcpt31842","provenance":{"source":"sonik","detail":"Sonik · order data"}},{"fieldKey":"customerEmailAddress","value":"j.ellis@example.com","fileRef":null,"provenance":{"source":"sonik","detail":"Sonik · order data"}},{"fieldKey":"uncategorizedText","value":"Attendee entered at Gate A and stayed for the full event.","fileRef":null,"provenance":{"source":"operator","detail":"You"}}],"counts":{"sonik":5,"operator":1},"submissionCount":0,"updatedAt":"2026-07-04T02:00:00.000Z"},"traceId":"trace-dispute-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: packet is already submitted for this version, or staging is engine-gated (CE 3.0).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: fields[] required; unknown keys rejected (strictObject).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}/evidence/review":{"post":{"operationId":"bookingSetDisputeEvidenceReview","summary":"Render the review set and issue the review token","description":"Computes the exact outgoing field set (empties omitted — what the network will see), stores a consume-once review token bound to the packet version and field-set hash (TTL 15 minutes), and returns the token with the rendered field count. The §6 guardrail, server-side.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reviewToken":{"type":"string","minLength":8},"fieldCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Must match the confirm dialog's rendered field count (agent assertion)."},"packetVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1}},"required":["reviewToken","fieldCount","packetVersion","expiresAt","traceId"],"additionalProperties":false},"example":{"reviewToken":"rvt_7c31f2a9_v1_a8f2","fieldCount":6,"packetVersion":1,"expiresAt":"2026-07-04T02:15:00.000Z","traceId":"trace-dispute-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: no staged packet exists to review.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}/evidence/submit":{"post":{"operationId":"bookingSubmitDisputeEvidence","summary":"Submit the reviewed evidence packet","description":"Consumes the review token atomically (zero-rows-updated → typed 409: REVIEW_STALE | REVIEW_CONSUMED | REVIEW_EXPIRED) then submits via the provider update_evidence submit:true request plan. The token proves the review render; the idempotencyKey dedupes the provider submission — orthogonal mechanisms. Submitting bumps submissionCount.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewToken":{"type":"string","minLength":1,"description":"Consume-once review token issued by the review endpoint. Server-side §6 guardrail: submit is structurally unreachable without a review render. Typed 409 reasons: REVIEW_STALE (packet changed since issue), REVIEW_CONSUMED (replay), REVIEW_EXPIRED (TTL)."},"idempotencyKey":{"type":"string","minLength":8,"description":"Provider submission idempotency key (SDK contract: min 8)."},"clientRequestId":{"type":"string","minLength":1}},"required":["reviewToken","idempotencyKey"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"disputeId":{"type":"string","minLength":1},"packetVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"submissionCount":{"type":"integer","minimum":1,"maximum":9007199254740991},"submittedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1}},"required":["disputeId","packetVersion","submissionCount","submittedAt","traceId"],"additionalProperties":false},"example":{"disputeId":"dp_7c31f2a9","packetVersion":1,"submissionCount":1,"submittedAt":"2026-07-04T02:00:00.000Z","traceId":"trace-dispute-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: review token rejected — REVIEW_STALE (packet changed since issue), REVIEW_CONSUMED (replay), or REVIEW_EXPIRED (15-minute TTL); the §6 guardrail is server-side and structural.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: reviewToken + idempotencyKey (min 8) required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/{disputeId}/accept":{"post":{"operationId":"bookingAcceptDispute","summary":"Accept the dispute and forfeit","description":"DESTRUCTIVE and terminal: requires the literal acknowledgeIrreversible:true plus a written rationale; rejects without both. The concession lands as a receipt-derived record entry attributed to the acting operator.","tags":["booking-disputes"],"parameters":[{"name":"disputeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Provider dispute id (dp_…)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rationale":{"type":"string","minLength":1,"description":"Required written rationale, recorded on the case record."},"acknowledgeIrreversible":{"const":true,"description":"The SDK contract IS the modal contract: accepting forfeits the amount, the fee is non-refundable, and it cannot be undone."},"clientRequestId":{"type":"string","minLength":1}},"required":["rationale","acknowledgeIrreversible"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"disputeId":{"type":"string","minLength":1},"rationale":{"type":"string","minLength":1},"actor":{"type":"object","properties":{"principalId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1}},"required":["principalId","displayName"],"additionalProperties":false},"acceptedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1}},"required":["disputeId","rationale","actor","acceptedAt","traceId"],"additionalProperties":false},"example":{"disputeId":"dp_7c31f2a9","rationale":"Duplicate purchase confirmed with the attendee; contesting would be dishonest.","actor":{"principalId":"prn_dan","displayName":"Dan"},"acceptedAt":"2026-07-04T02:00:00.000Z","traceId":"trace-dispute-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow dispute not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: dispute already terminal (submitted, won, lost, or accepted).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: rationale required and acknowledgeIrreversible must be the literal true — the SDK contract IS the modal contract.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/auto-file-policy":{"get":{"operationId":"bookingGetDisputeAutoFilePolicy","summary":"Get the auto-file policy","description":"Org-scoped auto-file posture: enabled default with a buffer before dueBy. The deadline guard is enforced regardless of this setting.","tags":["booking-disputes"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Auto-file is the product default; the deadline guard holds regardless of mode."},"bufferHours":{"type":"integer","minimum":1,"maximum":168,"description":"Hours before due_by when the staged packet files automatically."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["enabled","bufferHours","updatedAt"],"additionalProperties":false},"example":{"enabled":true,"bufferHours":24,"updatedAt":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]},"patch":{"operationId":"bookingSetDisputeAutoFilePolicy","summary":"Set the auto-file policy","description":"Updates the org auto-file posture. Every auto-filed submission lands as an attributed receipt entry (actor = policy), indistinguishable in rigor from a manual one; the scheduler itself is Wave 2.5.","tags":["booking-disputes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"bufferHours":{"type":"integer","minimum":1,"maximum":168,"description":"Hours before due_by when the staged packet files automatically."},"clientRequestId":{"type":"string","minLength":1}},"required":["enabled","bufferHours"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"bufferHours":{"type":"integer","minimum":1,"maximum":168,"description":"Hours before due_by when the staged packet files automatically."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1}},"required":["enabled","bufferHours","updatedAt","traceId"],"additionalProperties":false},"example":{"enabled":true,"bufferHours":24,"updatedAt":"2026-07-04T02:00:00.000Z","traceId":"trace-dispute-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: enabled boolean + bufferHours 1-168 required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/disputes/early-fraud-warnings":{"get":{"operationId":"bookingListEarlyFraudWarnings","summary":"List early fraud warnings","description":"Read-only EFW rows (booking.payment_fraud_warnings) normalized from the webhook spine; informational in MVP (badges on the dispute list). Acting on connected-account/Terminal EFWs waits on the G-lane (G1/G2).","tags":["booking-disputes"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Provider EFW id (issfr_… — the id guard is SDK-side)."},"chargeRef":{"type":"string","minLength":1},"disputeId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Linked dispute when one exists."},"reason":{"type":"string","minLength":1},"receivedAt":{"type":"string","format":"date-time","description":"Normalized-event receipt time; the list badge renders within 5 minutes of it."}},"required":["id","chargeRef","disputeId","reason","receivedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["warnings","nextCursor"],"additionalProperties":false},"example":{"warnings":[{"id":"issfr_9be1d044","chargeRef":"ch_clubhouse01","disputeId":null,"reason":"made_with_stolen_card","receivedAt":"2026-07-04T02:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor/limit query validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}":{"get":{"operationId":"bookingGetLoyaltyMember","summary":"Get a loyalty member","description":"Returns one loyalty member profile, including a derived tier and balance. Both tier and balance are recomputed from the ledger on every read — neither is stored as authority.","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref, e.g. mem_9d42e1c7)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (RLS-scoped)."},"identityRef":{"type":"string","minLength":1,"description":"Host identity ledger reference (e.g. \"idn_4471a0b2\") — never a payment-processor customer object. See BookingLoyaltyMembersContractCompatibility.hostIdentity."},"displayName":{"type":"string","minLength":1,"description":"Member display name."},"phoneLast4":{"anyOf":[{"type":"string","minLength":4,"maxLength":4},{"type":"null"}],"description":"Last 4 digits of the member's phone, for staff phone-first lookup, or null."},"tier":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Tier name."},"derivedAt":{"type":"string","format":"date-time","description":"When this tier was computed. Tier is derived, never stored as authority (see BookingLoyaltyMembersContractCompatibility.derivedNotStored)."}},"required":["name","derivedAt"],"additionalProperties":false,"description":"A member's current loyalty tier, recomputed on every read."},"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Point balance, derived by summing ledger entries — never stored. See BookingLoyaltyMembersContractCompatibility.derivedNotStored."},"consentScope":{"type":"object","properties":{"loyalty":{"type":"boolean","description":"Member has consented to loyalty program participation."},"attribution":{"type":"boolean","description":"Member has consented to attribution tracking."},"aiPersonalization":{"type":"boolean","description":"Member has consented to AI-personalized offers or communications."}},"required":["loyalty","attribution","aiPersonalization"],"additionalProperties":false,"description":"Per-scope member consent flags."},"tags":{"type":"array","items":{"type":"string"},"description":"Operator-applied tags."},"streak":{"anyOf":[{"type":"object","properties":{"challengeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The active challenge this streak is tracking, or null."},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Current streak count."},"target":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Streak count required to complete the challenge."}},"required":["challengeId","count","target"],"additionalProperties":false,"description":"A member's progress toward completing an active challenge."},{"type":"null"}],"description":"Current challenge streak progress, or null when the member has no active streak."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","identityRef","displayName","phoneLast4","tier","balance","consentScope","tags","streak","createdAt"],"additionalProperties":false,"description":"A loyalty program member profile."},"example":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","organizationId":"11111111-1111-4111-8111-111111111111","identityRef":"idn_4471a0b2","displayName":"Jordan Ellis","phoneLast4":"8842","tier":{"name":"Silver","derivedAt":"2026-07-04T02:00:00.000Z"},"balance":350,"consentScope":{"loyalty":true,"attribution":true,"aiPersonalization":false},"tags":["vip-watch","fnb-minimum-tracked"],"streak":{"challengeId":"9d42e1c7-4a5b-4c6d-8e7f-000000000099","count":2,"target":3},"createdAt":"2026-05-01T16:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members":{"get":{"operationId":"bookingSearchLoyaltyMembers","summary":"Search loyalty members","description":"Returns a paginated page of loyalty members, supporting a phone-first staff lookup query.","tags":["booking-loyalty"],"parameters":[{"name":"query","in":"query","schema":{"type":"string","minLength":1,"description":"Phone-first lookup query (phone digits or display name fragment)."},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Pagination cursor from a previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (1-100, default 25)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref, e.g. mem_9d42e1c7)."},"organizationId":{"type":"string","format":"uuid","description":"Owning organization (RLS-scoped)."},"identityRef":{"type":"string","minLength":1,"description":"Host identity ledger reference (e.g. \"idn_4471a0b2\") — never a payment-processor customer object. See BookingLoyaltyMembersContractCompatibility.hostIdentity."},"displayName":{"type":"string","minLength":1,"description":"Member display name."},"phoneLast4":{"anyOf":[{"type":"string","minLength":4,"maxLength":4},{"type":"null"}],"description":"Last 4 digits of the member's phone, for staff phone-first lookup, or null."},"tier":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Tier name."},"derivedAt":{"type":"string","format":"date-time","description":"When this tier was computed. Tier is derived, never stored as authority (see BookingLoyaltyMembersContractCompatibility.derivedNotStored)."}},"required":["name","derivedAt"],"additionalProperties":false,"description":"A member's current loyalty tier, recomputed on every read."},"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Point balance, derived by summing ledger entries — never stored. See BookingLoyaltyMembersContractCompatibility.derivedNotStored."},"consentScope":{"type":"object","properties":{"loyalty":{"type":"boolean","description":"Member has consented to loyalty program participation."},"attribution":{"type":"boolean","description":"Member has consented to attribution tracking."},"aiPersonalization":{"type":"boolean","description":"Member has consented to AI-personalized offers or communications."}},"required":["loyalty","attribution","aiPersonalization"],"additionalProperties":false,"description":"Per-scope member consent flags."},"tags":{"type":"array","items":{"type":"string"},"description":"Operator-applied tags."},"streak":{"anyOf":[{"type":"object","properties":{"challengeId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The active challenge this streak is tracking, or null."},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Current streak count."},"target":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Streak count required to complete the challenge."}},"required":["challengeId","count","target"],"additionalProperties":false,"description":"A member's progress toward completing an active challenge."},{"type":"null"}],"description":"Current challenge streak progress, or null when the member has no active streak."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","identityRef","displayName","phoneLast4","tier","balance","consentScope","tags","streak","createdAt"],"additionalProperties":false,"description":"A loyalty program member profile."},"description":"The page of matching members."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page, or null when exhausted."}},"required":["members","nextCursor"],"additionalProperties":false,"description":"A page of loyalty members matching the search."},"example":{"members":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","organizationId":"11111111-1111-4111-8111-111111111111","identityRef":"idn_4471a0b2","displayName":"Jordan Ellis","phoneLast4":"8842","tier":{"name":"Silver","derivedAt":"2026-07-04T02:00:00.000Z"},"balance":350,"consentScope":{"loyalty":true,"attribution":true,"aiPersonalization":false},"tags":["vip-watch","fnb-minimum-tracked"],"streak":{"challengeId":"9d42e1c7-4a5b-4c6d-8e7f-000000000099","count":2,"target":3},"createdAt":"2026-05-01T16:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: query/cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}/notes":{"post":{"operationId":"bookingAddLoyaltyMemberNote","summary":"Add a staff note to a loyalty member","description":"Appends a staff note to a member's profile. Notes are append-only, organization-scoped, and never surfaced to the member (see BookingLoyaltyMembersContractCompatibility.staffNotesPrivate).","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"description":"Note text."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried note submission."}},"required":["text"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Note id."},"memberId":{"type":"string","minLength":1,"description":"Member (host-ref) the note is attached to."},"author":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"description":"Operator principal id."},"displayName":{"type":"string","minLength":1,"description":"Operator display name."}},"required":["principalId","displayName"],"additionalProperties":false,"description":"The staff member who wrote the note."},"text":{"type":"string","minLength":1,"description":"Note text."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["id","memberId","author","text","createdAt","traceId"],"additionalProperties":false,"description":"A staff note on a member. Notes are append-only, org-scoped, and never member-visible — see BookingLoyaltyMembersContractCompatibility.staffNotesPrivate."},"example":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000010","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","author":{"principalId":"op_2091","displayName":"Casey Nguyen"},"text":"Called to confirm attendance streak; very engaged member.","createdAt":"2026-07-04T02:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: text required (append-only, actor-attributed, never member-visible).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}/tags":{"patch":{"operationId":"bookingSetLoyaltyMemberTags","summary":"Replace a loyalty member's tags","description":"Replaces the full tag set on a loyalty member profile.","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","maxItems":32,"items":{"type":"string","minLength":1},"description":"Replacement tag set (max 32 items)."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried tag update."}},"required":["tags"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","minLength":1},"tags":{"type":"array","items":{"type":"string"},"description":"The member's tag set after this update."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["memberId","tags","updatedAt","traceId"],"additionalProperties":false,"description":"The result of replacing a member's tag set."},"example":{"memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","tags":["vip-watch","fnb-minimum-tracked"],"updatedAt":"2026-07-04T02:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: tags array (max 32, non-empty strings) required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}/redemptions":{"post":{"operationId":"bookingRecordLoyaltyRedemption","summary":"Record a staff-mediated reward redemption","description":"Records a door-side reward redemption for a member, staff-mediated (ruling O-2). Posts a ledger entry and returns the policy gate outcome. Checkout-time redemption never uses this endpoint — it rides the generic loyalty-adjustment seam instead (see BookingLoyaltyMembersContractCompatibility.redemptionRuling).","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rewardId":{"type":"string","format":"uuid","description":"Reward being redeemed."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried redemption."}},"required":["rewardId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ledgerEntry":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Ledger entry id (host-ref, deterministic from the source event)."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) this entry posts to."},"kind":{"enum":["earn","clawback","adjustment","challenge_bonus","claim_resolution"],"type":"string","description":"Ledger entry kind: earn (points awarded), clawback (points reversed, e.g. a refunded order), adjustment (operator correction, either sign), challenge_bonus (challenge completion award), or claim_resolution (points posted by a claim replay)."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta posted by this entry; positive or negative."},"sourceEventRef":{"type":"string","minLength":1,"description":"Commerce-event or check-in id that produced this entry."},"policyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Loyalty policy version in effect when this entry was posted."},"actor":{"enum":["system","operator"],"type":"string","description":"Who posted the entry."},"capped":{"type":"boolean","description":"Whether a program cap reduced or capped the points this entry would have posted."},"crossRef":{"type":"object","properties":{"disputeId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked dispute id when this entry was produced by a dispute outcome, else null."},"claimId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked claim id when this entry was posted by claim resolution, else null."}},"required":["disputeId","claimId"],"additionalProperties":false,"description":"Cross-references to the dispute or claim that produced this entry, if any."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","memberId","kind","points","sourceEventRef","policyVersion","actor","capped","crossRef","createdAt"],"additionalProperties":false,"description":"One append-only loyalty ledger entry. Balances are derived by summing entries — never stored (see BookingLoyaltyLedgerContractCompatibility.ledgerIsTruth)."},"gate":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Shared policy-gate verdict: the backend enforcement object, the rendered UI reason, and the typed agent outcome are this ONE shape."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["ledgerEntry","gate","traceId"],"additionalProperties":false,"description":"The result of a staff-mediated door redemption (ruling O-2). See BookingLoyaltyMembersContractCompatibility.redemptionRuling."},"example":{"ledgerEntry":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000020","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"adjustment","points":-50,"sourceEventRef":"reward.redeemed:rew_7f2a1c90","policyVersion":7,"actor":"operator","capped":false,"crossRef":{"disputeId":null,"claimId":null},"createdAt":"2026-07-04T02:00:00.000Z"},"gate":{"outcome":"allow","reason":null},"traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member or reward not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: rewardId required; gate outcomes (deny / require_approval) are typed 2xx bodies, not errors.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}/pass-link":{"post":{"operationId":"bookingIssueLoyaltyPassLink","summary":"Dispatch a wallet-pass link to a loyalty member","description":"Dispatches a wallet-pass link to a member over SMS or email. The pass is an identity/benefit instrument only and carries no payment function (ruling R-1).","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"enum":["sms","email"],"type":"string","description":"Delivery channel for the pass link."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried dispatch."}},"required":["channel"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","minLength":1},"channel":{"enum":["sms","email"],"type":"string","description":"Delivery channel used."},"dispatchedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["memberId","channel","dispatchedAt","traceId"],"additionalProperties":false,"description":"The result of dispatching a wallet-pass link. The pass is an identity/benefit instrument only — see BookingLoyaltyMembersContractCompatibility.walletPassRuling."},"example":{"memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","channel":"sms","dispatchedAt":"2026-07-04T02:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: channel must be sms or email.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}/ledger":{"get":{"operationId":"bookingListLoyaltyLedgerByMember","summary":"List a member's loyalty ledger entries","description":"Returns a paginated page of a loyalty member's append-only ledger entries, the only source of truth for their point balance. Read-only: no direct write endpoint exists on this surface (see BookingLoyaltyLedgerContractCompatibility.readOnlyByDesign).","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Pagination cursor from a previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (1-100, default 25)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Ledger entry id (host-ref, deterministic from the source event)."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) this entry posts to."},"kind":{"enum":["earn","clawback","adjustment","challenge_bonus","claim_resolution"],"type":"string","description":"Ledger entry kind: earn (points awarded), clawback (points reversed, e.g. a refunded order), adjustment (operator correction, either sign), challenge_bonus (challenge completion award), or claim_resolution (points posted by a claim replay)."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta posted by this entry; positive or negative."},"sourceEventRef":{"type":"string","minLength":1,"description":"Commerce-event or check-in id that produced this entry."},"policyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Loyalty policy version in effect when this entry was posted."},"actor":{"enum":["system","operator"],"type":"string","description":"Who posted the entry."},"capped":{"type":"boolean","description":"Whether a program cap reduced or capped the points this entry would have posted."},"crossRef":{"type":"object","properties":{"disputeId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked dispute id when this entry was produced by a dispute outcome, else null."},"claimId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked claim id when this entry was posted by claim resolution, else null."}},"required":["disputeId","claimId"],"additionalProperties":false,"description":"Cross-references to the dispute or claim that produced this entry, if any."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","memberId","kind","points","sourceEventRef","policyVersion","actor","capped","crossRef","createdAt"],"additionalProperties":false,"description":"One append-only loyalty ledger entry. Balances are derived by summing entries — never stored (see BookingLoyaltyLedgerContractCompatibility.ledgerIsTruth)."},"description":"The page of ledger entries."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page, or null when exhausted."}},"required":["entries","nextCursor"],"additionalProperties":false,"description":"A page of a member's loyalty ledger entries."},"example":{"entries":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000101","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"earn","points":100,"sourceEventRef":"loyalty.enrollment:idn_4471a0b2:welcome_bonus","policyVersion":7,"actor":"system","capped":false,"crossRef":{"disputeId":null,"claimId":null},"createdAt":"2026-05-01T16:00:00.000Z"},{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000102","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"earn","points":184,"sourceEventRef":"order.captured:SNK-31842:pi_31842","policyVersion":7,"actor":"system","capped":false,"crossRef":{"disputeId":null,"claimId":null},"createdAt":"2026-06-20T18:30:00.000Z"},{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000103","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"earn","points":250,"sourceEventRef":"checkin.completed:idn_4471a0b2:2026-06-26","policyVersion":7,"actor":"system","capped":false,"crossRef":{"disputeId":null,"claimId":null},"createdAt":"2026-06-27T01:15:00.000Z"},{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000104","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"clawback","points":-184,"sourceEventRef":"transaction.reversed:SNK-31842:pi_31842","policyVersion":7,"actor":"system","capped":false,"crossRef":{"disputeId":"dp_7c31f2a9","claimId":null},"createdAt":"2026-07-04T02:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/members/{memberId}/balance":{"get":{"operationId":"bookingGetLoyaltyBalance","summary":"Get a member's computed loyalty balance","description":"Returns a loyalty member's point balance, computed by summing their ledger entries at read time. The balance is never stored — it is always consistent with the ledger by construction.","tags":["booking-loyalty"],"parameters":[{"name":"memberId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Loyalty member id (host-ref)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","minLength":1},"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Point balance derived by summing entries at read time — NEVER stored."},"asOf":{"type":"string","format":"date-time","description":"When this balance was computed."},"entryCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of entries summed into this balance."}},"required":["memberId","balance","asOf","entryCount"],"additionalProperties":false,"description":"A member's computed loyalty balance (see BookingLoyaltyLedgerContractCompatibility.ledgerIsTruth)."},"example":{"memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","balance":350,"asOf":"2026-07-04T02:00:00.000Z","entryCount":4}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/adjustments":{"post":{"operationId":"bookingCreateLoyaltyAdjustment","summary":"Create a loyalty point adjustment","description":"Requests a manual point adjustment for a member with a mandatory reason. Within the program's standing cap (+/-500 points) it posts immediately as a new ledger entry; outside the cap it is queued for a second operator's approval instead, and ledgerEntry is null until decided.","tags":["booking-loyalty"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) to adjust."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta; positive or negative, never zero."},"reason":{"type":"string","minLength":1,"description":"Mandatory reason for the adjustment."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried adjustment request."}},"required":["memberId","points","reason"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"gate":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Policy verdict: within +/-500 points -> allow (posts immediately); above -> require_approval (queued). See BookingLoyaltyAdjustmentsContractCompatibility.policyGate."},"ledgerEntry":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Ledger entry id (host-ref, deterministic from the source event)."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) this entry posts to."},"kind":{"enum":["earn","clawback","adjustment","challenge_bonus","claim_resolution"],"type":"string","description":"Ledger entry kind: earn (points awarded), clawback (points reversed, e.g. a refunded order), adjustment (operator correction, either sign), challenge_bonus (challenge completion award), or claim_resolution (points posted by a claim replay)."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta posted by this entry; positive or negative."},"sourceEventRef":{"type":"string","minLength":1,"description":"Commerce-event or check-in id that produced this entry."},"policyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Loyalty policy version in effect when this entry was posted."},"actor":{"enum":["system","operator"],"type":"string","description":"Who posted the entry."},"capped":{"type":"boolean","description":"Whether a program cap reduced or capped the points this entry would have posted."},"crossRef":{"type":"object","properties":{"disputeId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked dispute id when this entry was produced by a dispute outcome, else null."},"claimId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked claim id when this entry was posted by claim resolution, else null."}},"required":["disputeId","claimId"],"additionalProperties":false,"description":"Cross-references to the dispute or claim that produced this entry, if any."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","memberId","kind","points","sourceEventRef","policyVersion","actor","capped","crossRef","createdAt"],"additionalProperties":false,"description":"One append-only loyalty ledger entry. Balances are derived by summing entries — never stored (see BookingLoyaltyLedgerContractCompatibility.ledgerIsTruth)."},{"type":"null"}],"description":"The posted ledger entry, or null exactly when the adjustment was queued for approval."},"approvalId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"The queued approval id, or null exactly when the adjustment posted immediately."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["gate","ledgerEntry","approvalId","traceId"],"additionalProperties":false,"description":"The result of requesting a loyalty adjustment."},"example":{"gate":{"outcome":"allow","reason":null},"ledgerEntry":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000030","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"adjustment","points":25,"sourceEventRef":"operator.adjustment:manual_correction","policyVersion":7,"actor":"operator","capped":false,"crossRef":{"disputeId":null,"claimId":null},"createdAt":"2026-07-04T02:00:00.000Z"},"approvalId":null,"traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: memberId + non-zero points + mandatory reason; within ±500 pts allows, above queues require_approval — a typed outcome, never a 409.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/approvals":{"get":{"operationId":"bookingListLoyaltyApprovals","summary":"List loyalty adjustment approval requests","description":"Returns a paginated page of queued loyalty-adjustment approval requests, optionally filtered by status.","tags":["booking-loyalty"],"parameters":[{"name":"status","in":"query","schema":{"enum":["pending","approved","denied"],"type":"string","description":"Filter to one approval status."},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Pagination cursor from a previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (1-100, default 25)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Approval id."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) the queued adjustment targets."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta requested."},"reason":{"type":"string","minLength":1,"description":"Reason given for the adjustment."},"requestedBy":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"description":"Requesting operator principal id."},"displayName":{"type":"string","minLength":1,"description":"Requesting operator display name."}},"required":["principalId","displayName"],"additionalProperties":false,"description":"The operator who requested the adjustment."},"status":{"enum":["pending","approved","denied"],"type":"string","description":"Approval lifecycle status."},"requestedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","memberId","points","reason","requestedBy","status","requestedAt"],"additionalProperties":false,"description":"A queued loyalty-adjustment approval request."},"description":"The page of approval requests."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page, or null when exhausted."}},"required":["approvals","nextCursor"],"additionalProperties":false,"description":"A page of loyalty-adjustment approval requests."},"example":{"approvals":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000040","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","points":750,"reason":"Goodwill correction for missed dinner service credit exceeding the standing cap.","requestedBy":{"principalId":"op_2091","displayName":"Casey Nguyen"},"status":"pending","requestedAt":"2026-07-04T02:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: status/cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/approvals/{approvalId}/decision":{"post":{"operationId":"bookingDecideLoyaltyApproval","summary":"Decide a queued loyalty adjustment","description":"Approves or denies a queued loyalty-adjustment request. Approving posts exactly one new ledger entry; denying posts none. Deciding an already-decided approval is a status-transition conflict.","tags":["booking-loyalty"],"parameters":[{"name":"approvalId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Loyalty adjustment approval id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"enum":["approve","deny"],"type":"string","description":"The operator's decision on the queued adjustment."},"note":{"type":"string","minLength":1,"description":"Optional decision note."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried decision."}},"required":["decision"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"approvalId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"decision":{"enum":["approve","deny"],"type":"string","description":"The decision that was recorded."},"ledgerEntry":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Ledger entry id (host-ref, deterministic from the source event)."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) this entry posts to."},"kind":{"enum":["earn","clawback","adjustment","challenge_bonus","claim_resolution"],"type":"string","description":"Ledger entry kind: earn (points awarded), clawback (points reversed, e.g. a refunded order), adjustment (operator correction, either sign), challenge_bonus (challenge completion award), or claim_resolution (points posted by a claim replay)."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta posted by this entry; positive or negative."},"sourceEventRef":{"type":"string","minLength":1,"description":"Commerce-event or check-in id that produced this entry."},"policyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Loyalty policy version in effect when this entry was posted."},"actor":{"enum":["system","operator"],"type":"string","description":"Who posted the entry."},"capped":{"type":"boolean","description":"Whether a program cap reduced or capped the points this entry would have posted."},"crossRef":{"type":"object","properties":{"disputeId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked dispute id when this entry was produced by a dispute outcome, else null."},"claimId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked claim id when this entry was posted by claim resolution, else null."}},"required":["disputeId","claimId"],"additionalProperties":false,"description":"Cross-references to the dispute or claim that produced this entry, if any."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","memberId","kind","points","sourceEventRef","policyVersion","actor","capped","crossRef","createdAt"],"additionalProperties":false,"description":"One append-only loyalty ledger entry. Balances are derived by summing entries — never stored (see BookingLoyaltyLedgerContractCompatibility.ledgerIsTruth)."},{"type":"null"}],"description":"The posted ledger entry, present if and only if the decision was approve."},"decidedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["approvalId","decision","ledgerEntry","decidedAt","traceId"],"additionalProperties":false,"description":"The result of deciding a queued loyalty adjustment. See BookingLoyaltyAdjustmentsContractCompatibility.approvalIsTheOnlyResolution."},"example":{"approvalId":"9d42e1c7-4a5b-4c6d-8e7f-000000000040","decision":"approve","ledgerEntry":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000041","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"adjustment","points":750,"sourceEventRef":"loyalty.approval.decided:9d42e1c7-4a5b-4c6d-8e7f-000000000040","policyVersion":7,"actor":"operator","capped":false,"crossRef":{"disputeId":null,"claimId":null},"createdAt":"2026-07-04T02:05:00.000Z"},"decidedAt":"2026-07-04T02:05:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty approval not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: approval already decided.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: decision must be approve or deny.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/claims":{"post":{"operationId":"bookingCreateLoyaltyClaim","summary":"File a loyalty claim","description":"Files a claim that a member should have earned points for a given order or check-in but didn't. The claim opens in status open and is resolved exclusively by ledger replay (see BookingLoyaltyClaimsContractCompatibility.replayOnly).","tags":["booking-loyalty"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) filing the claim."},"sourceEventCandidate":{"type":"string","minLength":1,"description":"The order or check-in reference the claim believes should have earned points."},"description":{"type":"string","minLength":1,"description":"Description of the claim; gates the claim for staff review."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried claim submission."}},"required":["memberId","sourceEventCandidate","description"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Claim id."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) the claim belongs to."},"status":{"const":"open","description":"A newly created claim always opens in status open."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["id","memberId","status","createdAt","traceId"],"additionalProperties":false,"description":"The result of filing a loyalty claim."},"example":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000050","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","status":"open","createdAt":"2026-07-04T02:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty member not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: sourceEventCandidate + description required (claims gate on a description).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListLoyaltyClaims","summary":"List loyalty claims","description":"Returns a paginated page of loyalty claims, optionally filtered by status.","tags":["booking-loyalty"],"parameters":[{"name":"status","in":"query","schema":{"enum":["open","resolved_posted","resolved_no_earn"],"type":"string","description":"Filter to one claim status."},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Pagination cursor from a previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (1-100, default 25)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"claims":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Claim id."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) the claim belongs to."},"sourceEventCandidate":{"type":"string","minLength":1,"description":"The order or check-in reference the claim believes should have earned points."},"description":{"type":"string","minLength":1,"description":"Description of the claim."},"status":{"enum":["open","resolved_posted","resolved_no_earn"],"type":"string","description":"Claim lifecycle status: open (awaiting resolution), resolved_posted (replay checked out, earn posted), or resolved_no_earn (replay did not check out, no entry posted)."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"When the claim was resolved, or null while still open."}},"required":["id","memberId","sourceEventCandidate","description","status","createdAt","resolvedAt"],"additionalProperties":false,"description":"A loyalty claim ('I should have earned points for this and didn't')."},"description":"The page of claims."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page, or null when exhausted."}},"required":["claims","nextCursor"],"additionalProperties":false,"description":"A page of loyalty claims."},"example":{"claims":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000050","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","sourceEventCandidate":"SNK-31900","description":"Member says the June 30 dinner order should have earned points but never posted.","status":"open","createdAt":"2026-07-04T02:00:00.000Z","resolvedAt":null}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: status/cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/claims/{claimId}/resolve":{"post":{"operationId":"bookingResolveLoyaltyClaim","summary":"Resolve a loyalty claim by ledger replay","description":"Runs ledger replay against a claim's source-event candidate. If the replay checks out, the earn posts itself as a new ledger entry carrying a reference back to the claim and the claim closes resolved_posted; otherwise it closes resolved_no_earn with no entry posted. Never accepts a manual point amount. Resolving an already-resolved claim is a status-transition conflict.","tags":["booking-loyalty"],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Loyalty claim id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for a retried resolution."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"claimId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"status":{"enum":["resolved_posted","resolved_no_earn"],"type":"string","description":"The terminal status the replay produced."},"ledgerEntry":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Ledger entry id (host-ref, deterministic from the source event)."},"memberId":{"type":"string","minLength":1,"description":"Loyalty member (host-ref) this entry posts to."},"kind":{"enum":["earn","clawback","adjustment","challenge_bonus","claim_resolution"],"type":"string","description":"Ledger entry kind: earn (points awarded), clawback (points reversed, e.g. a refunded order), adjustment (operator correction, either sign), challenge_bonus (challenge completion award), or claim_resolution (points posted by a claim replay)."},"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed point delta posted by this entry; positive or negative."},"sourceEventRef":{"type":"string","minLength":1,"description":"Commerce-event or check-in id that produced this entry."},"policyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Loyalty policy version in effect when this entry was posted."},"actor":{"enum":["system","operator"],"type":"string","description":"Who posted the entry."},"capped":{"type":"boolean","description":"Whether a program cap reduced or capped the points this entry would have posted."},"crossRef":{"type":"object","properties":{"disputeId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked dispute id when this entry was produced by a dispute outcome, else null."},"claimId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Linked claim id when this entry was posted by claim resolution, else null."}},"required":["disputeId","claimId"],"additionalProperties":false,"description":"Cross-references to the dispute or claim that produced this entry, if any."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","memberId","kind","points","sourceEventRef","policyVersion","actor","capped","crossRef","createdAt"],"additionalProperties":false,"description":"One append-only loyalty ledger entry. Balances are derived by summing entries — never stored (see BookingLoyaltyLedgerContractCompatibility.ledgerIsTruth)."},{"type":"null"}],"description":"The posted ledger entry (kind claim_resolution, crossRef.claimId set), present if and only if the replay posted the earn."},"resolvedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Trace id for this write."}},"required":["claimId","status","ledgerEntry","resolvedAt","traceId"],"additionalProperties":false,"description":"The result of resolving a claim by ledger replay. See BookingLoyaltyClaimsContractCompatibility.replayOnly."},"example":{"claimId":"9d42e1c7-4a5b-4c6d-8e7f-000000000050","status":"resolved_posted","ledgerEntry":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000051","memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","kind":"claim_resolution","points":92,"sourceEventRef":"order.captured:SNK-31900","policyVersion":7,"actor":"system","capped":false,"crossRef":{"disputeId":null,"claimId":"9d42e1c7-4a5b-4c6d-8e7f-000000000050"},"createdAt":"2026-07-04T02:10:00.000Z"},"resolvedAt":"2026-07-04T02:10:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty claim not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: claim already resolved — resolution is ledger replay, run once.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/policy":{"get":{"operationId":"bookingGetCurrentLoyaltyPolicy","summary":"Get the current loyalty policy","description":"Returns the currently active loyalty policy version.","tags":["booking-loyalty"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Append-only version number."},"manifest":{"type":"object","properties":{"earnRates":{"type":"array","items":{"type":"object","properties":{"event":{"enum":["purchase","attendance","referral","birthday","welcome"],"type":"string","description":"Ledger event kind that accrues points under this earn-rate row."},"rate":{"type":"number","minimum":0,"description":"Points earned per unit of the event; for purchase this is points per 100 currency-minor-units (e.g. per $1.00)."},"cap":{"anyOf":[{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Max points earnable from this event within the window."},"window":{"enum":["day","week","month","quarter"],"type":"string","description":"Rolling window an earn-rate cap resets on."}},"required":["limit","window"],"additionalProperties":false},{"type":"null"}],"description":"Rolling earn cap for this event; mandatory (non-null) on referral rows."}},"required":["event","rate","cap"],"additionalProperties":false},"description":"Per-event earn rates; challenges are their own family and are not modeled here."},"tiers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Tier display name."},"pointsThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Points threshold to reach this tier."},"checkinsThreshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Alternate check-ins threshold; either path qualifies (behavior-weighted OR)."},"windowMonths":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Rolling window, in months, the thresholds are evaluated over."},"softLanding":{"type":"boolean","description":"Whether a member keeps tier benefits briefly after falling below threshold."}},"required":["name","pointsThreshold","checkinsThreshold","windowMonths","softLanding"],"additionalProperties":false},"description":"Tier ladder, evaluated on a rolling window per tier."},"rewards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Reward id."},"name":{"type":"string","minLength":1,"description":"Reward display name."},"costPoints":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points required to redeem this reward."},"inventoryCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Optional redemption inventory ceiling; null = uncapped."},"gate":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Unlock condition rendered for this reward row."}},"required":["id","name","costPoints","inventoryCap","gate"],"additionalProperties":false},"description":"Redeemable reward catalog."},"multipliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Multiplier id."},"name":{"type":"string","minLength":1,"description":"Multiplier display name."},"factor":{"type":"number","exclusiveMinimum":1,"description":"Earn multiplier factor; must exceed 1."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Multiplier window start."},"endsAt":{"type":"string","format":"date-time","description":"Multiplier window end."}},"required":["startsAt","endsAt"],"additionalProperties":false},"budgetCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."},{"type":"null"}],"description":"Cap on the added liability this multiplier may create; null = uncapped."}},"required":["id","name","factor","window","budgetCap"],"additionalProperties":false},"description":"Time-boxed earn multipliers with an optional budget cap."},"expiryMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Points expiry in months; null = points never expire."},"unitValueCents":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Cents of value per point (e.g. 10 = $0.10/pt)."}},"required":["earnRates","tiers","rewards","multipliers","expiryMonths","unitValueCents"],"additionalProperties":false,"description":"Versioned loyalty policy manifest: earn rates, tiers, rewards, multipliers, expiry, and unit value."},"author":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"description":"Authoring principal id."},"displayName":{"type":"string","minLength":1,"description":"Authoring principal display name."}},"required":["principalId","displayName"],"additionalProperties":false},"summary":{"type":"string","minLength":1,"description":"Human summary of what changed in this version."},"effectiveAt":{"type":"string","format":"date-time","description":"When this version became (or becomes) effective."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["version","manifest","author","summary","effectiveAt","createdAt"],"additionalProperties":false},"example":{"version":7,"manifest":{"earnRates":[{"event":"purchase","rate":1,"cap":null},{"event":"attendance","rate":50,"cap":{"limit":200,"window":"month"}},{"event":"referral","rate":500,"cap":{"limit":1000,"window":"quarter"}},{"event":"birthday","rate":250,"cap":null},{"event":"welcome","rate":100,"cap":null}],"tiers":[{"name":"Bronze","pointsThreshold":0,"checkinsThreshold":0,"windowMonths":12,"softLanding":false},{"name":"Silver","pointsThreshold":300,"checkinsThreshold":6,"windowMonths":12,"softLanding":true},{"name":"Gold","pointsThreshold":1000,"checkinsThreshold":20,"windowMonths":12,"softLanding":true},{"name":"Platinum","pointsThreshold":3000,"checkinsThreshold":null,"windowMonths":12,"softLanding":true}],"rewards":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000020","name":"Free entree","costPoints":500,"inventoryCap":null,"gate":{"outcome":"allow","reason":null}}],"multipliers":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000030","name":"Summer Double Points","factor":2,"window":{"startsAt":"2026-06-01T00:00:00.000Z","endsAt":"2026-08-31T23:59:59.000Z"},"budgetCap":{"amountCents":500000,"currency":"USD"}}],"expiryMonths":12,"unitValueCents":10},"author":{"principalId":"usr_ops_manager_01","displayName":"Alex Rivera"},"summary":"Fairview Regulars: added the summer double-points multiplier and raised the referral cap.","effectiveAt":"2026-06-01T09:00:00.000Z","createdAt":"2026-06-01T09:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/policy/versions":{"get":{"operationId":"bookingListLoyaltyPolicyVersions","summary":"List loyalty policy versions","description":"Lists the append-only loyalty policy version history, newest first. History is never rewritten; a rollback restores a prior manifest as a new version.","tags":["booking-loyalty"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor from a prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (default 25, max 100)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Append-only version number."},"manifest":{"type":"object","properties":{"earnRates":{"type":"array","items":{"type":"object","properties":{"event":{"enum":["purchase","attendance","referral","birthday","welcome"],"type":"string","description":"Ledger event kind that accrues points under this earn-rate row."},"rate":{"type":"number","minimum":0,"description":"Points earned per unit of the event; for purchase this is points per 100 currency-minor-units (e.g. per $1.00)."},"cap":{"anyOf":[{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Max points earnable from this event within the window."},"window":{"enum":["day","week","month","quarter"],"type":"string","description":"Rolling window an earn-rate cap resets on."}},"required":["limit","window"],"additionalProperties":false},{"type":"null"}],"description":"Rolling earn cap for this event; mandatory (non-null) on referral rows."}},"required":["event","rate","cap"],"additionalProperties":false},"description":"Per-event earn rates; challenges are their own family and are not modeled here."},"tiers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Tier display name."},"pointsThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Points threshold to reach this tier."},"checkinsThreshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Alternate check-ins threshold; either path qualifies (behavior-weighted OR)."},"windowMonths":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Rolling window, in months, the thresholds are evaluated over."},"softLanding":{"type":"boolean","description":"Whether a member keeps tier benefits briefly after falling below threshold."}},"required":["name","pointsThreshold","checkinsThreshold","windowMonths","softLanding"],"additionalProperties":false},"description":"Tier ladder, evaluated on a rolling window per tier."},"rewards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Reward id."},"name":{"type":"string","minLength":1,"description":"Reward display name."},"costPoints":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points required to redeem this reward."},"inventoryCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Optional redemption inventory ceiling; null = uncapped."},"gate":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Unlock condition rendered for this reward row."}},"required":["id","name","costPoints","inventoryCap","gate"],"additionalProperties":false},"description":"Redeemable reward catalog."},"multipliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Multiplier id."},"name":{"type":"string","minLength":1,"description":"Multiplier display name."},"factor":{"type":"number","exclusiveMinimum":1,"description":"Earn multiplier factor; must exceed 1."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Multiplier window start."},"endsAt":{"type":"string","format":"date-time","description":"Multiplier window end."}},"required":["startsAt","endsAt"],"additionalProperties":false},"budgetCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."},{"type":"null"}],"description":"Cap on the added liability this multiplier may create; null = uncapped."}},"required":["id","name","factor","window","budgetCap"],"additionalProperties":false},"description":"Time-boxed earn multipliers with an optional budget cap."},"expiryMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Points expiry in months; null = points never expire."},"unitValueCents":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Cents of value per point (e.g. 10 = $0.10/pt)."}},"required":["earnRates","tiers","rewards","multipliers","expiryMonths","unitValueCents"],"additionalProperties":false,"description":"Versioned loyalty policy manifest: earn rates, tiers, rewards, multipliers, expiry, and unit value."},"author":{"type":"object","properties":{"principalId":{"type":"string","minLength":1,"description":"Authoring principal id."},"displayName":{"type":"string","minLength":1,"description":"Authoring principal display name."}},"required":["principalId","displayName"],"additionalProperties":false},"summary":{"type":"string","minLength":1,"description":"Human summary of what changed in this version."},"effectiveAt":{"type":"string","format":"date-time","description":"When this version became (or becomes) effective."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["version","manifest","author","summary","effectiveAt","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor for the next page; null on the last page. History is append-only."}},"required":["versions","nextCursor"],"additionalProperties":false},"example":{"versions":[{"version":7,"manifest":{"earnRates":[{"event":"purchase","rate":1,"cap":null},{"event":"attendance","rate":50,"cap":{"limit":200,"window":"month"}},{"event":"referral","rate":500,"cap":{"limit":1000,"window":"quarter"}},{"event":"birthday","rate":250,"cap":null},{"event":"welcome","rate":100,"cap":null}],"tiers":[{"name":"Bronze","pointsThreshold":0,"checkinsThreshold":0,"windowMonths":12,"softLanding":false},{"name":"Silver","pointsThreshold":300,"checkinsThreshold":6,"windowMonths":12,"softLanding":true},{"name":"Gold","pointsThreshold":1000,"checkinsThreshold":20,"windowMonths":12,"softLanding":true},{"name":"Platinum","pointsThreshold":3000,"checkinsThreshold":null,"windowMonths":12,"softLanding":true}],"rewards":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000020","name":"Free entree","costPoints":500,"inventoryCap":null,"gate":{"outcome":"allow","reason":null}}],"multipliers":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000030","name":"Summer Double Points","factor":2,"window":{"startsAt":"2026-06-01T00:00:00.000Z","endsAt":"2026-08-31T23:59:59.000Z"},"budgetCap":{"amountCents":500000,"currency":"USD"}}],"expiryMonths":12,"unitValueCents":10},"author":{"principalId":"usr_ops_manager_01","displayName":"Alex Rivera"},"summary":"Fairview Regulars: added the summer double-points multiplier and raised the referral cap.","effectiveAt":"2026-06-01T09:00:00.000Z","createdAt":"2026-06-01T09:00:00.000Z"},{"version":6,"manifest":{"earnRates":[{"event":"purchase","rate":1,"cap":null},{"event":"attendance","rate":50,"cap":{"limit":200,"window":"month"}},{"event":"referral","rate":400,"cap":{"limit":800,"window":"quarter"}},{"event":"birthday","rate":250,"cap":null},{"event":"welcome","rate":100,"cap":null}],"tiers":[{"name":"Bronze","pointsThreshold":0,"checkinsThreshold":0,"windowMonths":12,"softLanding":false},{"name":"Silver","pointsThreshold":300,"checkinsThreshold":6,"windowMonths":12,"softLanding":true},{"name":"Gold","pointsThreshold":1000,"checkinsThreshold":20,"windowMonths":12,"softLanding":true},{"name":"Platinum","pointsThreshold":3000,"checkinsThreshold":null,"windowMonths":12,"softLanding":true}],"rewards":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000020","name":"Free entree","costPoints":500,"inventoryCap":null,"gate":{"outcome":"allow","reason":null}}],"multipliers":[],"expiryMonths":12,"unitValueCents":10},"author":{"principalId":"usr_ops_manager_01","displayName":"Alex Rivera"},"summary":"Fairview Regulars: initial referral cap and birthday bonus configuration.","effectiveAt":"2026-03-01T09:00:00.000Z","createdAt":"2026-03-01T09:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/policy/drafts":{"post":{"operationId":"bookingDraftLoyaltyPolicy","summary":"Draft a loyalty policy manifest","description":"Creates a draft loyalty policy manifest. A draft has no runtime effect until it is simulated and then activated.","tags":["booking-loyalty"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"manifest":{"type":"object","properties":{"earnRates":{"type":"array","items":{"type":"object","properties":{"event":{"enum":["purchase","attendance","referral","birthday","welcome"],"type":"string","description":"Ledger event kind that accrues points under this earn-rate row."},"rate":{"type":"number","minimum":0,"description":"Points earned per unit of the event; for purchase this is points per 100 currency-minor-units (e.g. per $1.00)."},"cap":{"anyOf":[{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Max points earnable from this event within the window."},"window":{"enum":["day","week","month","quarter"],"type":"string","description":"Rolling window an earn-rate cap resets on."}},"required":["limit","window"],"additionalProperties":false},{"type":"null"}],"description":"Rolling earn cap for this event; mandatory (non-null) on referral rows."}},"required":["event","rate","cap"],"additionalProperties":false},"description":"Per-event earn rates; challenges are their own family and are not modeled here."},"tiers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Tier display name."},"pointsThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Points threshold to reach this tier."},"checkinsThreshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Alternate check-ins threshold; either path qualifies (behavior-weighted OR)."},"windowMonths":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Rolling window, in months, the thresholds are evaluated over."},"softLanding":{"type":"boolean","description":"Whether a member keeps tier benefits briefly after falling below threshold."}},"required":["name","pointsThreshold","checkinsThreshold","windowMonths","softLanding"],"additionalProperties":false},"description":"Tier ladder, evaluated on a rolling window per tier."},"rewards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Reward id."},"name":{"type":"string","minLength":1,"description":"Reward display name."},"costPoints":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points required to redeem this reward."},"inventoryCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Optional redemption inventory ceiling; null = uncapped."},"gate":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Unlock condition rendered for this reward row."}},"required":["id","name","costPoints","inventoryCap","gate"],"additionalProperties":false},"description":"Redeemable reward catalog."},"multipliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Multiplier id."},"name":{"type":"string","minLength":1,"description":"Multiplier display name."},"factor":{"type":"number","exclusiveMinimum":1,"description":"Earn multiplier factor; must exceed 1."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Multiplier window start."},"endsAt":{"type":"string","format":"date-time","description":"Multiplier window end."}},"required":["startsAt","endsAt"],"additionalProperties":false},"budgetCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."},{"type":"null"}],"description":"Cap on the added liability this multiplier may create; null = uncapped."}},"required":["id","name","factor","window","budgetCap"],"additionalProperties":false},"description":"Time-boxed earn multipliers with an optional budget cap."},"expiryMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Points expiry in months; null = points never expire."},"unitValueCents":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Cents of value per point (e.g. 10 = $0.10/pt)."}},"required":["earnRates","tiers","rewards","multipliers","expiryMonths","unitValueCents"],"additionalProperties":false,"description":"Versioned loyalty policy manifest: earn rates, tiers, rewards, multipliers, expiry, and unit value."},"summary":{"type":"string","minLength":1,"description":"Human summary of the drafted change."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried draft creation."}},"required":["manifest","summary"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"draftId":{"type":"string","format":"uuid","description":"Draft id; consumed by simulate and activate."},"manifest":{"type":"object","properties":{"earnRates":{"type":"array","items":{"type":"object","properties":{"event":{"enum":["purchase","attendance","referral","birthday","welcome"],"type":"string","description":"Ledger event kind that accrues points under this earn-rate row."},"rate":{"type":"number","minimum":0,"description":"Points earned per unit of the event; for purchase this is points per 100 currency-minor-units (e.g. per $1.00)."},"cap":{"anyOf":[{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Max points earnable from this event within the window."},"window":{"enum":["day","week","month","quarter"],"type":"string","description":"Rolling window an earn-rate cap resets on."}},"required":["limit","window"],"additionalProperties":false},{"type":"null"}],"description":"Rolling earn cap for this event; mandatory (non-null) on referral rows."}},"required":["event","rate","cap"],"additionalProperties":false},"description":"Per-event earn rates; challenges are their own family and are not modeled here."},"tiers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Tier display name."},"pointsThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Points threshold to reach this tier."},"checkinsThreshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Alternate check-ins threshold; either path qualifies (behavior-weighted OR)."},"windowMonths":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Rolling window, in months, the thresholds are evaluated over."},"softLanding":{"type":"boolean","description":"Whether a member keeps tier benefits briefly after falling below threshold."}},"required":["name","pointsThreshold","checkinsThreshold","windowMonths","softLanding"],"additionalProperties":false},"description":"Tier ladder, evaluated on a rolling window per tier."},"rewards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Reward id."},"name":{"type":"string","minLength":1,"description":"Reward display name."},"costPoints":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points required to redeem this reward."},"inventoryCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Optional redemption inventory ceiling; null = uncapped."},"gate":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Unlock condition rendered for this reward row."}},"required":["id","name","costPoints","inventoryCap","gate"],"additionalProperties":false},"description":"Redeemable reward catalog."},"multipliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Multiplier id."},"name":{"type":"string","minLength":1,"description":"Multiplier display name."},"factor":{"type":"number","exclusiveMinimum":1,"description":"Earn multiplier factor; must exceed 1."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"Multiplier window start."},"endsAt":{"type":"string","format":"date-time","description":"Multiplier window end."}},"required":["startsAt","endsAt"],"additionalProperties":false},"budgetCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Money in minor units; no payment capture or settlement semantics."},{"type":"null"}],"description":"Cap on the added liability this multiplier may create; null = uncapped."}},"required":["id","name","factor","window","budgetCap"],"additionalProperties":false},"description":"Time-boxed earn multipliers with an optional budget cap."},"expiryMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}],"description":"Points expiry in months; null = points never expire."},"unitValueCents":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Cents of value per point (e.g. 10 = $0.10/pt)."}},"required":["earnRates","tiers","rewards","multipliers","expiryMonths","unitValueCents"],"additionalProperties":false,"description":"Versioned loyalty policy manifest: earn rates, tiers, rewards, multipliers, expiry, and unit value."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["draftId","manifest","createdAt","traceId"],"additionalProperties":false},"example":{"draftId":"9d42e1c7-4a5b-4c6d-8e7f-000000000010","manifest":{"earnRates":[{"event":"purchase","rate":1,"cap":null},{"event":"attendance","rate":50,"cap":{"limit":200,"window":"month"}},{"event":"referral","rate":500,"cap":{"limit":1000,"window":"quarter"}},{"event":"birthday","rate":250,"cap":null},{"event":"welcome","rate":100,"cap":null}],"tiers":[{"name":"Bronze","pointsThreshold":0,"checkinsThreshold":0,"windowMonths":12,"softLanding":false},{"name":"Silver","pointsThreshold":300,"checkinsThreshold":6,"windowMonths":12,"softLanding":true},{"name":"Gold","pointsThreshold":1000,"checkinsThreshold":20,"windowMonths":12,"softLanding":true},{"name":"Platinum","pointsThreshold":3000,"checkinsThreshold":null,"windowMonths":12,"softLanding":true}],"rewards":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000020","name":"Free entree","costPoints":500,"inventoryCap":null,"gate":{"outcome":"allow","reason":null}}],"multipliers":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000030","name":"Summer Double Points","factor":2,"window":{"startsAt":"2026-06-01T00:00:00.000Z","endsAt":"2026-08-31T23:59:59.000Z"},"budgetCap":{"amountCents":500000,"currency":"USD"}},{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000031","name":"Fall Triple Points","factor":3,"window":{"startsAt":"2026-09-01T00:00:00.000Z","endsAt":"2026-10-31T23:59:59.000Z"},"budgetCap":{"amountCents":800000,"currency":"USD"}}],"expiryMonths":12,"unitValueCents":10},"createdAt":"2026-07-01T10:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: manifest + summary required; referral earn rate must carry a cap.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/policy/drafts/{draftId}/simulate":{"post":{"operationId":"bookingSimulateLoyaltyPolicy","summary":"Simulate a drafted loyalty policy","description":"Replays the last N days of the real ledger under the drafted rates to project added points, added liability, members reached, and projected redemption cost, plus a budget-cap verdict. Mints a consume-once simulateToken that activate requires; any further edit to the draft invalidates it.","tags":["booking-loyalty"],"parameters":[{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Policy draft id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"replayDays":{"type":"integer","minimum":1,"maximum":90,"default":30,"description":"Days of real ledger history to replay under the drafted rates."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried simulation."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"draftId":{"type":"string","format":"uuid"},"simulateToken":{"type":"string","minLength":1,"description":"Consume-once token required by activate; TTL-bounded, and any further draft edit invalidates it (the same generic review-token mechanism as dispute evidence, contract map §7)."},"projection":{"type":"object","properties":{"addedPoints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Net points the drafted manifest would have added over the replay window."},"addedLiability":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Net redemption-value liability the drafted manifest would have added."},"membersReached":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Distinct members whose earn events would change under the draft."},"projectedRedemptionCost":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Projected future redemption cost implied by the added points."}},"required":["addedPoints","addedLiability","membersReached","projectedRedemptionCost"],"additionalProperties":false},"capVerdict":{"type":"object","properties":{"outcome":{"enum":["allow","deny","require_approval","warn"],"type":"string","description":"Typed policy verdict: allow, deny, require_approval, or warn."},"reason":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Machine-readable reason code (stable, snake_case)."},"message":{"type":"string","minLength":1,"description":"Human-readable reason copy, operator voice."}},"required":["code","message"],"additionalProperties":false,"description":"Why the gate ruled as it did; doubles as the agent disabledReason source."},{"type":"null"}]}},"required":["outcome","reason"],"additionalProperties":false,"description":"Budget-cap verdict: allow when projected liability is under cap (auto-stop language), warn when projected exceeds cap."},"replayWindowDays":{"type":"integer","minimum":1,"maximum":90,"description":"Days of ledger history actually replayed."},"simulatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["draftId","simulateToken","projection","capVerdict","replayWindowDays","simulatedAt","traceId"],"additionalProperties":false},"example":{"draftId":"9d42e1c7-4a5b-4c6d-8e7f-000000000010","simulateToken":"sim_9d42e1c7-000000000010-01","projection":{"addedPoints":42000,"addedLiability":{"amountCents":420000,"currency":"USD"},"membersReached":612,"projectedRedemptionCost":{"amountCents":350000,"currency":"USD"}},"capVerdict":{"outcome":"allow","reason":null},"replayWindowDays":30,"simulatedAt":"2026-07-01T10:05:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow policy draft not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: replayDays 1-90.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/policy/drafts/{draftId}/activate":{"post":{"operationId":"bookingActivateLoyaltyPolicy","summary":"Activate a drafted loyalty policy","description":"Activates a drafted loyalty policy manifest as a new append-only version. Structurally unreachable without a prior simulation: the request must present the simulateToken minted by simulate, and a stale or already-consumed token is rejected.","tags":["booking-loyalty"],"parameters":[{"name":"draftId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Policy draft id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"simulateToken":{"type":"string","minLength":1,"description":"Consume-once token minted by simulate; required to activate."},"effectiveAt":{"type":"string","format":"date-time","description":"Optional future effective time; default is immediate."},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried activation."}},"required":["simulateToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The new version number created by activation."},"activatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["version","activatedAt","traceId"],"additionalProperties":false},"example":{"version":8,"activatedAt":"2026-07-02T09:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow policy draft not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: simulate token rejected — consumed, expired, or stale after a draft edit; activation is structurally unreachable without a fresh simulation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: simulateToken required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/policy/versions/{version}/rollback":{"post":{"operationId":"bookingRollbackLoyaltyPolicy","summary":"Roll back to a prior loyalty policy version","description":"Restores a prior loyalty policy version as a new append-only version (never a history rewrite). A single, confirmed action.","tags":["booking-loyalty"],"parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Target policy version number."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried rollback."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The new version created by restoring the target version."},"restoredFromVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number this rollback restored from."},"activatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["version","restoredFromVersion","activatedAt","traceId"],"additionalProperties":false},"example":{"version":9,"restoredFromVersion":6,"activatedAt":"2026-07-03T09:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow policy version not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/challenges":{"get":{"operationId":"bookingListLoyaltyChallenges","summary":"List loyalty challenges","description":"Lists loyalty challenges with an optional status filter. Draft challenges are visible but inert; completion is evaluated from ledger events and emits its own earn entry (kind challenge_bonus).","tags":["booking-loyalty"],"parameters":[{"name":"status","in":"query","schema":{"enum":["draft","active","completed","archived"],"type":"string","description":"Optional lifecycle status filter."},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor from a prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (default 25, max 100)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"challenges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"description":"Challenge display name."},"goal":{"type":"object","properties":{"event":{"enum":["checkin.scan","transaction.completed"],"type":"string","description":"Ledger event kind the challenge goal counts."},"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of qualifying events required to complete the goal."},"window":{"type":"object","properties":{"unit":{"enum":["day","week","month"],"type":"string","description":"Unit the challenge goal window spans."},"span":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of units the goal window spans."}},"required":["unit","span"],"additionalProperties":false},"constraint":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional qualifying constraint on matching events (e.g. \"friday\")."}},"required":["event","count","window","constraint"],"additionalProperties":false},"reward":{"type":"object","properties":{"points":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points paid on completion via a challenge_bonus earn entry."},"tierWeighting":{"type":"number","minimum":1,"default":1,"description":"Multiplier applied to the reward's tier-progress weighting (architect Q2 open — whether weighting lives on the ledger entry or the tier policy; the contract carries it as challenge config)."}},"required":["points"],"additionalProperties":false},"status":{"enum":["draft","active","completed","archived"],"type":"string","description":"Challenge lifecycle status."},"inProgressCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Members currently mid-goal, derived live from ledger events, not stored progress."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","name","goal","reward","status","inProgressCount","createdAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor for the next page; null on the last page."}},"required":["challenges","nextCursor"],"additionalProperties":false},"example":{"challenges":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000040","name":"Friday regular","goal":{"event":"checkin.scan","count":3,"window":{"unit":"month","span":1},"constraint":"friday"},"reward":{"points":750,"tierWeighting":2},"status":"active","inProgressCount":12,"createdAt":"2026-05-01T09:00:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: status/cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingCreateLoyaltyChallenge","summary":"Create a loyalty challenge","description":"Creates a loyalty challenge in draft status. Drafts are visible but inert until activated.","tags":["booking-loyalty"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Challenge display name."},"goal":{"type":"object","properties":{"event":{"enum":["checkin.scan","transaction.completed"],"type":"string","description":"Ledger event kind the challenge goal counts."},"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of qualifying events required to complete the goal."},"window":{"type":"object","properties":{"unit":{"enum":["day","week","month"],"type":"string","description":"Unit the challenge goal window spans."},"span":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of units the goal window spans."}},"required":["unit","span"],"additionalProperties":false},"constraint":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional qualifying constraint on matching events (e.g. \"friday\")."}},"required":["event","count","window","constraint"],"additionalProperties":false},"reward":{"type":"object","properties":{"points":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points paid on completion via a challenge_bonus earn entry."},"tierWeighting":{"type":"number","minimum":1,"default":1,"description":"Multiplier applied to the reward's tier-progress weighting (architect Q2 open — whether weighting lives on the ledger entry or the tier policy; the contract carries it as challenge config)."}},"required":["points"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried challenge creation."}},"required":["name","goal","reward"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"description":"Challenge display name."},"goal":{"type":"object","properties":{"event":{"enum":["checkin.scan","transaction.completed"],"type":"string","description":"Ledger event kind the challenge goal counts."},"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of qualifying events required to complete the goal."},"window":{"type":"object","properties":{"unit":{"enum":["day","week","month"],"type":"string","description":"Unit the challenge goal window spans."},"span":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Number of units the goal window spans."}},"required":["unit","span"],"additionalProperties":false},"constraint":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Optional qualifying constraint on matching events (e.g. \"friday\")."}},"required":["event","count","window","constraint"],"additionalProperties":false},"reward":{"type":"object","properties":{"points":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Points paid on completion via a challenge_bonus earn entry."},"tierWeighting":{"type":"number","minimum":1,"default":1,"description":"Multiplier applied to the reward's tier-progress weighting (architect Q2 open — whether weighting lives on the ledger entry or the tier policy; the contract carries it as challenge config)."}},"required":["points"],"additionalProperties":false},"status":{"enum":["draft","active","completed","archived"],"type":"string","description":"Challenge lifecycle status."},"inProgressCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Members currently mid-goal, derived live from ledger events, not stored progress."},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["id","name","goal","reward","status","inProgressCount","createdAt","traceId"],"additionalProperties":false},"example":{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000040","name":"Friday regular","goal":{"event":"checkin.scan","count":3,"window":{"unit":"month","span":1},"constraint":"friday"},"reward":{"points":750,"tierWeighting":2},"status":"draft","inProgressCount":0,"createdAt":"2026-05-01T09:00:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: name/goal/reward required (strictObject).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/challenges/{challengeId}/activate":{"post":{"operationId":"bookingActivateLoyaltyChallenge","summary":"Activate a loyalty challenge","description":"Activates a draft loyalty challenge. Activating a challenge that is already active or archived is an illegal status transition (409).","tags":["booking-loyalty"],"parameters":[{"name":"challengeId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Challenge id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried activation."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"challengeId":{"type":"string","format":"uuid"},"status":{"const":"active"},"activatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["challengeId","status","activatedAt","traceId"],"additionalProperties":false},"example":{"challengeId":"9d42e1c7-4a5b-4c6d-8e7f-000000000040","status":"active","activatedAt":"2026-05-01T09:05:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty challenge not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: challenge is not in draft status.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/analytics/kpis":{"get":{"operationId":"bookingGetLoyaltyKpis","summary":"Get top-line loyalty KPIs","description":"Returns exactly four top-line loyalty KPIs (member count/enrollment rate, active-member rate, redemption rate, outstanding liability). Every figure maps to a ledger or member query; no KPI wallpaper.","tags":["booking-loyalty"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total enrolled loyalty members."},"enrollmentRate":{"type":"number","minimum":0,"maximum":1,"description":"Enrolled members as a fraction of eligible customers."}},"required":["total","enrollmentRate"],"additionalProperties":false},"activeMemberRate":{"type":"number","minimum":0,"maximum":1,"description":"Fraction of enrolled members with a qualifying ledger event in the active window."},"redemptionRate":{"type":"number","minimum":0,"maximum":1,"description":"Fraction of earned points that have been redeemed."},"outstandingLiability":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Redemption-value liability of all unredeemed, unexpired points."},"asOf":{"type":"string","format":"date-time","description":"Read timestamp these figures were computed at."}},"required":["members","activeMemberRate","redemptionRate","outstandingLiability","asOf"],"additionalProperties":false},"example":{"members":{"total":1842,"enrollmentRate":0.41},"activeMemberRate":0.37,"redemptionRate":0.22,"outstandingLiability":{"amountCents":1284000,"currency":"USD"},"asOf":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/analytics/cohort-compare":{"get":{"operationId":"bookingGetLoyaltyCohortCompare","summary":"Compare member vs. non-member cohorts","description":"Compares matched member and non-member cohorts across spend-per-visit, visits-per-quarter, and repeat-attendance. delta is computed, never copywritten.","tags":["booking-loyalty"],"parameters":[{"name":"windowDays","in":"query","schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"default":90,"description":"Trailing window, in days, the cohort comparison is computed over (default 90)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"object","properties":{"matchingKeys":{"type":"array","items":{"type":"string"},"description":"Attributes members and non-members were matched on before comparison."},"n":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total members compared."},"windowDays":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["matchingKeys","n","windowDays"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"metric":{"enum":["spendPerVisit","visitsPerQuarter","repeatAttendance"],"type":"string","description":"Cohort-compare metric."},"members":{"type":"number","description":"Metric value for the member cohort."},"nonMembers":{"type":"number","description":"Metric value for the matched non-member cohort."},"delta":{"type":"number","description":"members minus nonMembers; computed, not copywritten."}},"required":["metric","members","nonMembers","delta"],"additionalProperties":false}},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["method","rows","asOf"],"additionalProperties":false},"example":{"method":{"matchingKeys":["homeVenue","signupCohortMonth"],"n":1842,"windowDays":90},"rows":[{"metric":"spendPerVisit","members":84.5,"nonMembers":61.2,"delta":23.3},{"metric":"visitsPerQuarter","members":4.2,"nonMembers":2.1,"delta":2.1},{"metric":"repeatAttendance","members":0.68,"nonMembers":0.41,"delta":0.27}],"asOf":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: windowDays validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/analytics/top-members":{"get":{"operationId":"bookingListLoyaltyTopMembers","summary":"List top loyalty members","description":"Lists the top loyalty members by balance with tier progress projected from the current tier policy.","tags":["booking-loyalty"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":10,"description":"Number of top members to return (default 10, max 50)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string","minLength":1},"displayName":{"type":"string","minLength":1},"tier":{"type":"string","minLength":1,"description":"Current tier name."},"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Current point balance."},"progressToNext":{"anyOf":[{"type":"object","properties":{"kind":{"enum":["points","checkins"],"type":"string","description":"Which threshold path is closer to the next tier."},"remaining":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Remaining amount to the next tier."}},"required":["kind","remaining"],"additionalProperties":false},{"type":"null"}],"description":"Projected from tier policy; null when the member is already at the top tier."},"spend90d":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Trailing 90-day spend."},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},{"type":"null"}],"description":"Last qualifying ledger event; null if none yet."}},"required":["memberId","displayName","tier","balance","progressToNext","spend90d","lastSeenAt"],"additionalProperties":false}},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["rows","asOf"],"additionalProperties":false},"example":{"rows":[{"memberId":"9d42e1c7-4a5b-4c6d-8e7f-000000000001","displayName":"Jordan Ellis","tier":"Silver","balance":350,"progressToNext":{"kind":"points","remaining":650},"spend90d":{"amountCents":84500,"currency":"USD"},"lastSeenAt":"2026-07-01T18:30:00.000Z"}],"asOf":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: limit 1-50.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/analytics/liability":{"get":{"operationId":"bookingGetLoyaltyLiability","summary":"Get outstanding loyalty liability","description":"Returns outstanding point liability reconciled to the ledger, upcoming expiry cohorts, and a modeled breakage estimate that renders only with an explicit modeled label until a real cohort expires.","tags":["booking-loyalty"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"outstandingPoints":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total unredeemed, unexpired points across all members."},"unitValueCents":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Cents of value per point at the current policy."},"liability":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Reconciles exactly to the ledger."},"expiryPolicyMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Current policy expiry in months; null = no expiry."},"firstExpiryCohort":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"points":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["expiresAt","points"],"additionalProperties":false},{"type":"null"}],"description":"The next cohort of points scheduled to expire; null when expiry is disabled."},"expiringNext90d":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Points scheduled to expire within the next 90 days."},"breakage":{"anyOf":[{"type":"object","properties":{"low":{"type":"number","minimum":0,"maximum":1,"description":"Low end of the modeled breakage-rate range."},"high":{"type":"number","minimum":0,"maximum":1,"description":"High end of the modeled breakage-rate range."},"modeled":{"const":true,"description":"Renders ONLY with this explicit modeled label until a real cohort expires — assertion-enforced."}},"required":["low","high","modeled"],"additionalProperties":false},{"type":"null"}],"description":"Modeled breakage estimate; null until enough expiry history exists to model."},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["outstandingPoints","unitValueCents","liability","expiryPolicyMonths","firstExpiryCohort","expiringNext90d","breakage","asOf"],"additionalProperties":false},"example":{"outstandingPoints":128400,"unitValueCents":10,"liability":{"amountCents":1284000,"currency":"USD"},"expiryPolicyMonths":12,"firstExpiryCohort":{"expiresAt":"2026-08-15T00:00:00.000Z","points":4200},"expiringNext90d":8200,"breakage":{"low":0.18,"high":0.31,"modeled":true},"asOf":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/analytics/promo-performance":{"get":{"operationId":"bookingGetLoyaltyPromoPerformance","summary":"Get loyalty promo performance","description":"Lists attributed sales and honest redemption cost per earn multiplier promo.","tags":["booking-loyalty"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","minLength":1,"description":"Opaque pagination cursor from a prior page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Page size (default 25, max 100)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"promos":{"type":"array","items":{"type":"object","properties":{"multiplierId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"policyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Policy version the multiplier was defined under."},"window":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"endsAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["startsAt","endsAt"],"additionalProperties":false},"attributedSales":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Sales attributed to the promo window."},"redemptionCost":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor-unit amount."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code."}},"required":["amountCents","currency"],"additionalProperties":false,"description":"Honest cost: redemption value of points the promo added."},"attributionWindowDays":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Days after the promo window still attributed to it."}},"required":["multiplierId","name","policyVersion","window","attributedSales","redemptionCost","attributionWindowDays"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor for the next page; null on the last page."},"asOf":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["promos","nextCursor","asOf"],"additionalProperties":false},"example":{"promos":[{"multiplierId":"9d42e1c7-4a5b-4c6d-8e7f-000000000030","name":"Summer Double Points","policyVersion":7,"window":{"startsAt":"2026-06-01T00:00:00.000Z","endsAt":"2026-08-31T23:59:59.000Z"},"attributedSales":{"amountCents":920000,"currency":"USD"},"redemptionCost":{"amountCents":184000,"currency":"USD"},"attributionWindowDays":14}],"nextCursor":null,"asOf":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor/limit validation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/segments":{"get":{"operationId":"bookingListLoyaltySegments","summary":"List loyalty segments","description":"Lists loyalty segments as ledger predicates evaluated on read, with a consent-filtered size. No segment membership list is ever materialized here.","tags":["booking-loyalty"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"description":"Segment display name."},"predicate":{"type":"string","minLength":1,"description":"Ledger predicate DSL evaluated on read, e.g. \"tier = Gold AND last_checkin > 30d\"."},"size":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Member count, evaluated at read time."},"consentFiltered":{"const":true,"description":"Segment membership is always consent-filtered before it is sized or exported."}},"required":["id","name","predicate","size","consentFiltered"],"additionalProperties":false}},"asOf":{"type":"string","format":"date-time","description":"Read timestamp segment sizes were evaluated at."}},"required":["segments","asOf"],"additionalProperties":false},"example":{"segments":[{"id":"9d42e1c7-4a5b-4c6d-8e7f-000000000050","name":"Lapsing Gold members","predicate":"tier = Gold AND last_checkin > 30d","size":96,"consentFiltered":true}],"asOf":"2026-07-04T02:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/loyalty/segments/{segmentId}/export-to-amplify":{"post":{"operationId":"bookingExportLoyaltySegmentToAmplify","summary":"Export a loyalty segment reference to Amplify","description":"Hands Amplify a segment reference plus a consent-filtered member-set handle. Loyalty is the source of behavior; Amplify is the send engine — no send tooling exists on this surface, and the boundary is deliberate and typed.","tags":["booking-loyalty"],"parameters":[{"name":"segmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Segment id."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"description":"Idempotency key for retried export."}},"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"segmentId":{"type":"string","format":"uuid"},"exportRef":{"type":"string","minLength":1,"description":"Segment REFERENCE + consent-filtered member-set handle — never a materialized list. The export contract shape is an open Amplify-team ruling (handoff §7.4)."},"consentScopeApplied":{"const":true,"description":"Confirms consent filtering was applied before the reference was minted."},"exportedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"traceId":{"type":"string","minLength":1,"description":"Request trace id."}},"required":["segmentId","exportRef","consentScopeApplied","exportedAt","traceId"],"additionalProperties":false},"example":{"segmentId":"9d42e1c7-4a5b-4c6d-8e7f-000000000050","exportRef":"loyalty-segment-ref:9d42e1c7-4a5b-4c6d-8e7f-000000000050:2026-07-04T02:00:00.000Z","consentScopeApplied":true,"exportedAt":"2026-07-04T02:05:00.000Z","traceId":"trace-loyalty-fixture"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Future shadow loyalty segment not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"shadow","x-sonik-adapter":"not-mounted","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests":{"get":{"operationId":"bookingEmbedManifestsList","summary":"List embed manifests for the org","description":"Org-scoped listing of studio manifests with live-pointer status for the studio home. Cursor-paginated per the house list idiom.","tags":["embed-studio"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"Opaque page cursor from a prior response."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"description":"Max rows to return (1-100); defaults to the resolver's own page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"manifests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The operator's own name for this page, read from its draft document; null until they name it. The index shows this, never an id."},"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"eventId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"customerRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Client/customer this delivery engagement is for; null for internal drafts."},"liveVersionId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Null until first publish."},"draftEtag":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","surface","eventId","customerRef","liveVersionId","draftEtag","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["manifests","nextCursor"],"additionalProperties":false},"example":{"manifests":[{"id":"018fa100-0000-4000-8000-0000000000e1","organizationId":"018f9b00-1111-7000-8000-000000000abc","name":"Friday Night Live","surface":"event-page","eventId":"018fa100-0000-4000-8000-0000000000e2","customerRef":null,"liveVersionId":null,"draftEtag":"018fa100-0000-4000-8000-0000000000e6","createdAt":"2026-07-28T18:00:00.000Z","updatedAt":"2026-07-28T18:05:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor and limit query parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingEmbedManifestCreate","summary":"Create a manifest from a starter template","description":"Instantiates a starter template into a new org-scoped draft. Template-first: there is no blank-canvas create path.","tags":["embed-studio"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"eventId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]},"templateId":{"type":"string","format":"uuid","description":"Starter template to instantiate from. Required: there is no blank-canvas create."},"customerRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Client/customer engagement this build is for; null for internal drafts."},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["surface","eventId","templateId","customerRef","clientRequestId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"document":{"type":"object","properties":{"schemaVersion":{"const":"embed-manifest.v1"},"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen page name; null until they name it."},"locale":{"anyOf":[{"enum":["es-CO","en-US"],"type":"string","description":"BCP 47 tag of the page's language: es-CO or en-US."},{"type":"null"}],"default":null,"description":"Page language (es-CO | en-US); null derives it from the bound event's venue country when the page publishes."},"eventIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"P7: the microsite's curated collection. The ORDER is the authored order and removal is hiding. Empty for every non-collection surface."},"eventId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Bound event for event-page surfaces; null for organizer pages."},"modules":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["featured-event","ticket-tier-list","organizer-profile","venue-facts","checkout","event-list"],"type":"string","description":"Closed phase-1 module registry. Adding a kind is a code change, not data."},"span":{"enum":["full","half-left","half-center","half-right"],"type":"string","description":"Constrained span ladder. A half module is alone on its row at the stated alignment — no adjacent slot exists. Array order is mobile order."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Typed per-module field values validated in depth by the studio module catalog."},"children":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Nested module ids for container modules; maps 1:1 to renderer children."}},"required":["id","kind","span","fields"],"additionalProperties":false},"description":"Template-first: a manifest never exists as a blank canvas."},"theme":{"type":"object","properties":{"provenanceThemeId":{"type":"string","format":"uuid","description":"Identity of the runtime theme this snapshot was taken from."},"record":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The full runtime theme record embedded BY VALUE so later theme edits never mutate a published page and rollback restores byte-identical output. Carries the same monetary-key guard as module fields — published-immutable data is the most durable smuggling channel."}},"required":["provenanceThemeId","record"],"additionalProperties":false},"templateLineage":{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["templateId","version"],"additionalProperties":false},{"type":"null"}],"description":"Which starter template this manifest descends from, for the flywheel metric."}},"required":["schemaVersion","surface","eventId","modules","theme","templateLineage"],"additionalProperties":false},"etag":{"type":"string","minLength":1,"description":"Opaque draft revision tag; echo as expectedEtag on save."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["manifestId","document","etag","updatedAt"],"additionalProperties":false},"example":{"manifestId":"018fa100-0000-4000-8000-0000000000e1","document":{"schemaVersion":"embed-manifest.v1","surface":"event-page","eventId":"018fa100-0000-4000-8000-0000000000e2","modules":[{"id":"018fa100-0000-4000-8000-0000000000e3","kind":"ticket-tier-list","span":"full","fields":{"heading":"Tickets"},"children":[]}],"theme":{"provenanceThemeId":"018fa100-0000-4000-8000-0000000000e4","record":{"--color-accent":"oklch(0.7 0.15 250)"}},"templateLineage":{"templateId":"018fa100-0000-4000-8000-0000000000e5","version":1}},"etag":"018fa100-0000-4000-8000-0000000000e6","updatedAt":"2026-07-28T18:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Starter template not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: surface, eventId, templateId, and customerRef schema.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests/{manifestId}":{"delete":{"operationId":"bookingEmbedManifestDelete","summary":"Delete a page that has never been published","description":"Removes a draft-only page and the hours metered against it. IDEMPOTENT: a page that is already gone answers deleted:false rather than failing, so a retried delete is safe. A page that has EVER been published is REFUSED with a reason, never cascaded — its versions are immutable history that something may still be pointing at, and an operation that quietly destroys history is not a delete.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deleted":{"type":"boolean","description":"Whether THIS call removed the page. False means it was already gone — the operation is idempotent, and says which of the two happened rather than pretending."}},"required":["manifestId","deleted"],"additionalProperties":false},"example":{"manifestId":"018fa100-0000-4000-8000-0000000000e1","deleted":true}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: manifest has published versions and cannot be deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: manifestId path parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"destructive","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests/{manifestId}/draft":{"get":{"operationId":"bookingEmbedManifestDraftGet","summary":"Read the current draft","description":"Returns the autosaved draft document with its ETag for optimistic-lock saves.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"document":{"type":"object","properties":{"schemaVersion":{"const":"embed-manifest.v1"},"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen page name; null until they name it."},"locale":{"anyOf":[{"enum":["es-CO","en-US"],"type":"string","description":"BCP 47 tag of the page's language: es-CO or en-US."},{"type":"null"}],"default":null,"description":"Page language (es-CO | en-US); null derives it from the bound event's venue country when the page publishes."},"eventIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"P7: the microsite's curated collection. The ORDER is the authored order and removal is hiding. Empty for every non-collection surface."},"eventId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Bound event for event-page surfaces; null for organizer pages."},"modules":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["featured-event","ticket-tier-list","organizer-profile","venue-facts","checkout","event-list"],"type":"string","description":"Closed phase-1 module registry. Adding a kind is a code change, not data."},"span":{"enum":["full","half-left","half-center","half-right"],"type":"string","description":"Constrained span ladder. A half module is alone on its row at the stated alignment — no adjacent slot exists. Array order is mobile order."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Typed per-module field values validated in depth by the studio module catalog."},"children":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Nested module ids for container modules; maps 1:1 to renderer children."}},"required":["id","kind","span","fields"],"additionalProperties":false},"description":"Template-first: a manifest never exists as a blank canvas."},"theme":{"type":"object","properties":{"provenanceThemeId":{"type":"string","format":"uuid","description":"Identity of the runtime theme this snapshot was taken from."},"record":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The full runtime theme record embedded BY VALUE so later theme edits never mutate a published page and rollback restores byte-identical output. Carries the same monetary-key guard as module fields — published-immutable data is the most durable smuggling channel."}},"required":["provenanceThemeId","record"],"additionalProperties":false},"templateLineage":{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["templateId","version"],"additionalProperties":false},{"type":"null"}],"description":"Which starter template this manifest descends from, for the flywheel metric."}},"required":["schemaVersion","surface","eventId","modules","theme","templateLineage"],"additionalProperties":false},"etag":{"type":"string","minLength":1,"description":"Opaque draft revision tag; echo as expectedEtag on save."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["manifestId","document","etag","updatedAt"],"additionalProperties":false},"example":{"manifestId":"018fa100-0000-4000-8000-0000000000e1","document":{"schemaVersion":"embed-manifest.v1","surface":"event-page","eventId":"018fa100-0000-4000-8000-0000000000e2","modules":[{"id":"018fa100-0000-4000-8000-0000000000e3","kind":"ticket-tier-list","span":"full","fields":{"heading":"Tickets"},"children":[]}],"theme":{"provenanceThemeId":"018fa100-0000-4000-8000-0000000000e4","record":{"--color-accent":"oklch(0.7 0.15 250)"}},"templateLineage":{"templateId":"018fa100-0000-4000-8000-0000000000e5","version":1}},"etag":"018fa100-0000-4000-8000-0000000000e6","updatedAt":"2026-07-28T18:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]},"put":{"operationId":"bookingEmbedManifestDraftSave","summary":"Autosave the draft","description":"Persists the draft document guarded by expectedEtag; a stale tag fails closed so a second tab never silently clobbers work.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"schemaVersion":{"const":"embed-manifest.v1"},"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen page name; null until they name it."},"locale":{"anyOf":[{"enum":["es-CO","en-US"],"type":"string","description":"BCP 47 tag of the page's language: es-CO or en-US."},{"type":"null"}],"default":null,"description":"Page language (es-CO | en-US); null derives it from the bound event's venue country when the page publishes."},"eventIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"P7: the microsite's curated collection. The ORDER is the authored order and removal is hiding. Empty for every non-collection surface."},"eventId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Bound event for event-page surfaces; null for organizer pages."},"modules":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["featured-event","ticket-tier-list","organizer-profile","venue-facts","checkout","event-list"],"type":"string","description":"Closed phase-1 module registry. Adding a kind is a code change, not data."},"span":{"enum":["full","half-left","half-center","half-right"],"type":"string","description":"Constrained span ladder. A half module is alone on its row at the stated alignment — no adjacent slot exists. Array order is mobile order."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Typed per-module field values validated in depth by the studio module catalog."},"children":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Nested module ids for container modules; maps 1:1 to renderer children."}},"required":["id","kind","span","fields"],"additionalProperties":false},"description":"Template-first: a manifest never exists as a blank canvas."},"theme":{"type":"object","properties":{"provenanceThemeId":{"type":"string","format":"uuid","description":"Identity of the runtime theme this snapshot was taken from."},"record":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The full runtime theme record embedded BY VALUE so later theme edits never mutate a published page and rollback restores byte-identical output. Carries the same monetary-key guard as module fields — published-immutable data is the most durable smuggling channel."}},"required":["provenanceThemeId","record"],"additionalProperties":false},"templateLineage":{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["templateId","version"],"additionalProperties":false},{"type":"null"}],"description":"Which starter template this manifest descends from, for the flywheel metric."}},"required":["schemaVersion","surface","eventId","modules","theme","templateLineage"],"additionalProperties":false},"expectedEtag":{"type":"string","minLength":1,"description":"Stale-write guard: save fails when the stored draft moved past this tag."}},"required":["document","expectedEtag"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"document":{"type":"object","properties":{"schemaVersion":{"const":"embed-manifest.v1"},"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen page name; null until they name it."},"locale":{"anyOf":[{"enum":["es-CO","en-US"],"type":"string","description":"BCP 47 tag of the page's language: es-CO or en-US."},{"type":"null"}],"default":null,"description":"Page language (es-CO | en-US); null derives it from the bound event's venue country when the page publishes."},"eventIds":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"P7: the microsite's curated collection. The ORDER is the authored order and removal is hiding. Empty for every non-collection surface."},"eventId":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}],"description":"Bound event for event-page surfaces; null for organizer pages."},"modules":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"kind":{"enum":["featured-event","ticket-tier-list","organizer-profile","venue-facts","checkout","event-list"],"type":"string","description":"Closed phase-1 module registry. Adding a kind is a code change, not data."},"span":{"enum":["full","half-left","half-center","half-right"],"type":"string","description":"Constrained span ladder. A half module is alone on its row at the stated alignment — no adjacent slot exists. Array order is mobile order."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Typed per-module field values validated in depth by the studio module catalog."},"children":{"type":"array","items":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"default":[],"description":"Nested module ids for container modules; maps 1:1 to renderer children."}},"required":["id","kind","span","fields"],"additionalProperties":false},"description":"Template-first: a manifest never exists as a blank canvas."},"theme":{"type":"object","properties":{"provenanceThemeId":{"type":"string","format":"uuid","description":"Identity of the runtime theme this snapshot was taken from."},"record":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The full runtime theme record embedded BY VALUE so later theme edits never mutate a published page and rollback restores byte-identical output. Carries the same monetary-key guard as module fields — published-immutable data is the most durable smuggling channel."}},"required":["provenanceThemeId","record"],"additionalProperties":false},"templateLineage":{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["templateId","version"],"additionalProperties":false},{"type":"null"}],"description":"Which starter template this manifest descends from, for the flywheel metric."}},"required":["schemaVersion","surface","eventId","modules","theme","templateLineage"],"additionalProperties":false},"etag":{"type":"string","minLength":1,"description":"Opaque draft revision tag; echo as expectedEtag on save."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["manifestId","document","etag","updatedAt"],"additionalProperties":false},"example":{"manifestId":"018fa100-0000-4000-8000-0000000000e1","document":{"schemaVersion":"embed-manifest.v1","surface":"event-page","eventId":"018fa100-0000-4000-8000-0000000000e2","modules":[{"id":"018fa100-0000-4000-8000-0000000000e3","kind":"ticket-tier-list","span":"full","fields":{"heading":"Tickets"},"children":[]}],"theme":{"provenanceThemeId":"018fa100-0000-4000-8000-0000000000e4","record":{"--color-accent":"oklch(0.7 0.15 250)"}},"templateLineage":{"templateId":"018fa100-0000-4000-8000-0000000000e5","version":1}},"etag":"018fa100-0000-4000-8000-0000000000e6","updatedAt":"2026-07-28T18:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: draft moved past expectedEtag.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: document schema, including the monetary-key guard.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests/{manifestId}/publish":{"post":{"operationId":"bookingEmbedManifestPublish","summary":"Publish the draft as an immutable version","description":"One transaction: inserts an immutable version (ON CONFLICT DO NOTHING) and flips the live pointer. Never overwrites; rollback is free by construction. Returns blast radius for the confirmation dialog.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedEtag":{"type":"string","minLength":1},"artifact":{"type":"object","properties":{"spec":{"type":"object","properties":{"root":{"type":"string","minLength":1},"elements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"type":{"enum":["Region","FeaturedEvent","TicketTierList","OrganizerProfile","VenueFacts","Checkout","EventList","EventCard","TierRow"],"type":"string"},"props":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}}]}},"children":{"type":"array","items":{"type":"string"}},"repeat":{"type":"object","properties":{"statePath":{"type":"string","pattern":"^\\/.*"},"key":{"type":"string","minLength":1}},"required":["statePath","key"],"additionalProperties":false},"visible":{"type":"object","properties":{"$state":{"type":"string","pattern":"^\\/.*"},"not":{"const":true}},"required":["$state"],"additionalProperties":false},"on":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"action":{"enum":["selectEvent","selectTier"],"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{},"additionalProperties":{}}]}}},"required":["action"],"additionalProperties":false}}},"required":["type","props","children"],"additionalProperties":false}},"state":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}]}}},"required":["root","elements","state"],"additionalProperties":false},"catalogVersion":{"const":"embed-catalog.v1"},"rendererPin":{"type":"object","properties":{"packageBuildHash":{"type":"string","minLength":1},"jsonRenderCoreVersion":{"const":"0.19.0"},"jsonRenderSvelteVersion":{"const":"0.19.0"},"elementTreeSchemaVersion":{"const":"v1"}},"required":["packageBuildHash","jsonRenderCoreVersion","jsonRenderSvelteVersion","elementTreeSchemaVersion"],"additionalProperties":false}},"required":["spec","catalogVersion","rendererPin"],"additionalProperties":false},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["expectedEtag","artifact","clientRequestId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"versionNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"organizationId":{"type":"string","format":"uuid","description":"Organizer this version belongs to, denormalized so a version row is auditable standalone."},"customerRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Client/customer this delivery engagement is for; null for internal drafts. Denormalized from the manifest at publish time."},"createdAt":{"type":"string","format":"date-time","description":"When this version record was created."},"publishedAt":{"type":"string","format":"date-time","description":"When the publish transaction completed and the pointer flipped (submission time)."},"documentDigest":{"type":"string","minLength":1,"description":"Digest of the immutable published document for byte-identical rollback proof."}},"required":["versionId","versionNumber","organizationId","customerRef","createdAt","publishedAt","documentDigest"],"additionalProperties":false},"pointer":{"type":"object","properties":{"liveVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["liveVersionId"],"additionalProperties":false},"blastRadius":{"type":"object","properties":{"installs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Live installs that change immediately; phase 1 serves a synthetic fixture."}},"required":["installs"],"additionalProperties":false}},"required":["version","pointer","blastRadius"],"additionalProperties":false},"example":{"version":{"versionId":"018fa100-0000-4000-8000-0000000000f1","versionNumber":1,"organizationId":"018f9b00-1111-7000-8000-000000000abc","customerRef":null,"createdAt":"2026-07-28T18:10:00.000Z","publishedAt":"2026-07-28T18:10:00.000Z","documentDigest":"b13fd7c3e0a2f4c1d9e6a5b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7"},"pointer":{"liveVersionId":"018fa100-0000-4000-8000-0000000000f1"},"blastRadius":{"installs":0}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: draft moved past expectedEtag, or version allocation could not land.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: expectedEtag and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests/{manifestId}/versions":{"get":{"operationId":"bookingEmbedManifestVersionsList","summary":"List immutable published versions","description":"Version history for rollback selection; documents are immutable and digest-pinned. Cursor-paginated per the house list idiom.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"Opaque page cursor from a prior response."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"description":"Max rows to return (1-100); defaults to the resolver's own page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"versionNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"organizationId":{"type":"string","format":"uuid","description":"Organizer this version belongs to, denormalized so a version row is auditable standalone."},"customerRef":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Client/customer this delivery engagement is for; null for internal drafts. Denormalized from the manifest at publish time."},"createdAt":{"type":"string","format":"date-time","description":"When this version record was created."},"publishedAt":{"type":"string","format":"date-time","description":"When the publish transaction completed and the pointer flipped (submission time)."},"documentDigest":{"type":"string","minLength":1,"description":"Digest of the immutable published document for byte-identical rollback proof."}},"required":["versionId","versionNumber","organizationId","customerRef","createdAt","publishedAt","documentDigest"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["versions","nextCursor"],"additionalProperties":false},"example":{"versions":[{"versionId":"018fa100-0000-4000-8000-0000000000f1","versionNumber":1,"organizationId":"018f9b00-1111-7000-8000-000000000abc","customerRef":null,"createdAt":"2026-07-28T18:10:00.000Z","publishedAt":"2026-07-28T18:10:00.000Z","documentDigest":"b13fd7c3e0a2f4c1d9e6a5b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor and limit query parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests/{manifestId}/pointer":{"post":{"operationId":"bookingEmbedManifestRollback","summary":"Point live at a prior version","description":"Pointer flip to an existing immutable version; restores byte-identical content because themes are embedded by value.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","description":"Existing immutable version to point live at."},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["versionId","clientRequestId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pointer":{"type":"object","properties":{"liveVersionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}},"required":["liveVersionId"],"additionalProperties":false}},"required":["pointer"],"additionalProperties":false},"example":{"pointer":{"liveVersionId":"018fa100-0000-4000-8000-0000000000f1"}}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest or target version not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: versionId and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-templates":{"post":{"operationId":"bookingEmbedTemplatePromote","summary":"Promote a published version into a reusable starter template","description":"Freezes a published manifest version into the template library (the delivery flywheel). Distinct from the organizer starter-bundle bookingTemplates surface.","tags":["embed-studio"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"versionId":{"type":"string","format":"uuid","description":"Published version to freeze into the template."},"name":{"type":"string","minLength":1,"maxLength":120},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["manifestId","versionId","name","clientRequestId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"type":"string","minLength":1},"surface":{"enum":["organizer-page","event-page","ticket-tier-embed","quick-checkout","microsite"],"type":"string","description":"The publishable surfaces: the two page surfaces plus the P6 commerce surfaces (a standalone tier embed and a quick checkout for an already-known event). Each starter template targets exactly one."},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","name","surface","version","createdAt"],"additionalProperties":false},"example":{"id":"018fa100-0000-4000-8000-0000000000e5","name":"Organizer starter","surface":"organizer-page","version":1,"createdAt":"2026-07-28T18:15:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest or published version not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: name, manifestId, versionId, and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embed-manifests/{manifestId}/hours":{"post":{"operationId":"bookingEmbedManifestHoursAppend","summary":"Append metered operator time","description":"Single-writer, focus-gated hour metering per engagement so the compression claim is measured from day one.","tags":["embed-studio"],"parameters":[{"name":"manifestId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":14400,"exclusiveMinimum":0,"description":"Focus-gated operator seconds accrued since the last append; bounded per write."},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["seconds","clientRequestId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"totalSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["manifestId","totalSeconds"],"additionalProperties":false},"example":{"manifestId":"018fa100-0000-4000-8000-0000000000e1","totalSeconds":1800}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Manifest not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: seconds bound (max 4h) and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/seatmaps":{"get":{"operationId":"bookingListSeatmaps","summary":"List seat maps for the org","description":"Org-scoped listing of seat-map venue documents. Cursor-paginated per the house list idiom.","tags":["booking-seatmaps"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"Opaque page cursor from a prior response."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"description":"Max rows to return (1-100); defaults to the resolver's own page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"seatmaps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The operator's own name for this seat map, read from its draft document."},"draftEtag":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["id","organizationId","name","draftEtag","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["seatmaps","nextCursor"],"additionalProperties":false},"example":{"seatmaps":[{"id":"018fa100-0000-4000-8000-0000000000f1","organizationId":"018fa100-0000-4000-8000-0000000000f0","name":"Grand Hall","draftEtag":"018fa100-0000-4000-8000-0000000000f2","createdAt":"2026-08-08T17:00:00.000Z","updatedAt":"2026-08-08T18:05:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor and limit query parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingCreateSeatmap","summary":"Create a seat map","description":"Creates an org-scoped seat-map draft from an initial venue payload. Idempotent on clientRequestId.","tags":["booking-seatmaps"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null},"venue":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Opaque venue geometry (sections, rows, seats, viewport). Structure only: any nested key carrying monetary vocabulary is refused."},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["venue","clientRequestId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"seatmapId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"document":{"type":"object","properties":{"schemaVersion":{"const":"seatmap-document.v1"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen seat-map name; null until they name it."},"venue":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Opaque venue geometry (sections, rows, seats, viewport). Structure only: any nested key carrying monetary vocabulary is refused."}},"required":["schemaVersion","venue"],"additionalProperties":false},"etag":{"type":"string","minLength":1,"description":"Opaque draft revision tag; echo as expectedEtag on save."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["seatmapId","document","etag","updatedAt"],"additionalProperties":false},"example":{"seatmapId":"018fa100-0000-4000-8000-0000000000f1","document":{"schemaVersion":"seatmap-document.v1","name":"Grand Hall","venue":{"viewBox":{"width":1200,"height":800},"sections":[{"id":"orchestra","label":"Orchestra","rows":[{"id":"row-a","label":"A","seats":[{"id":"a-1","label":"1","x":120,"y":240},{"id":"a-2","label":"2","x":156,"y":240}]}]}]}},"etag":"018fa100-0000-4000-8000-0000000000f2","updatedAt":"2026-08-08T18:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: name, venue document schema (including the monetary-key guard), and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/seatmaps/{seatmapId}/draft":{"get":{"operationId":"bookingGetSeatmapDraft","summary":"Read the current draft","description":"Returns the autosaved venue document with its ETag for optimistic-lock saves.","tags":["booking-seatmaps"],"parameters":[{"name":"seatmapId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"seatmapId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"document":{"type":"object","properties":{"schemaVersion":{"const":"seatmap-document.v1"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen seat-map name; null until they name it."},"venue":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Opaque venue geometry (sections, rows, seats, viewport). Structure only: any nested key carrying monetary vocabulary is refused."}},"required":["schemaVersion","venue"],"additionalProperties":false},"etag":{"type":"string","minLength":1,"description":"Opaque draft revision tag; echo as expectedEtag on save."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["seatmapId","document","etag","updatedAt"],"additionalProperties":false},"example":{"seatmapId":"018fa100-0000-4000-8000-0000000000f1","document":{"schemaVersion":"seatmap-document.v1","name":"Grand Hall","venue":{"viewBox":{"width":1200,"height":800},"sections":[{"id":"orchestra","label":"Orchestra","rows":[{"id":"row-a","label":"A","seats":[{"id":"a-1","label":"1","x":120,"y":240},{"id":"a-2","label":"2","x":156,"y":240}]}]}]}},"etag":"018fa100-0000-4000-8000-0000000000f2","updatedAt":"2026-08-08T18:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Seatmap not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]},"put":{"operationId":"bookingSaveSeatmapDraft","summary":"Autosave the draft","description":"Persists the venue document guarded by expectedEtag; a stale tag fails closed so a second tab never silently clobbers work.","tags":["booking-seatmaps"],"parameters":[{"name":"seatmapId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"schemaVersion":{"const":"seatmap-document.v1"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen seat-map name; null until they name it."},"venue":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Opaque venue geometry (sections, rows, seats, viewport). Structure only: any nested key carrying monetary vocabulary is refused."}},"required":["schemaVersion","venue"],"additionalProperties":false},"expectedEtag":{"type":"string","minLength":1,"description":"Stale-write guard: save fails when the stored draft moved past this tag."}},"required":["document","expectedEtag"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"seatmapId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"document":{"type":"object","properties":{"schemaVersion":{"const":"seatmap-document.v1"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen seat-map name; null until they name it."},"venue":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Opaque venue geometry (sections, rows, seats, viewport). Structure only: any nested key carrying monetary vocabulary is refused."}},"required":["schemaVersion","venue"],"additionalProperties":false},"etag":{"type":"string","minLength":1,"description":"Opaque draft revision tag; echo as expectedEtag on save."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["seatmapId","document","etag","updatedAt"],"additionalProperties":false},"example":{"seatmapId":"018fa100-0000-4000-8000-0000000000f1","document":{"schemaVersion":"seatmap-document.v1","name":"Grand Hall","venue":{"viewBox":{"width":1200,"height":800},"sections":[{"id":"orchestra","label":"Orchestra","rows":[{"id":"row-a","label":"A","seats":[{"id":"a-1","label":"1","x":120,"y":240},{"id":"a-2","label":"2","x":156,"y":240}]}]}]}},"etag":"018fa100-0000-4000-8000-0000000000f2","updatedAt":"2026-08-08T18:05:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Seatmap not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: draft moved past expectedEtag.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: venue document schema, including the monetary-key guard.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/seatmaps/{seatmapId}":{"delete":{"operationId":"bookingDeleteSeatmap","summary":"Delete a seat map","description":"Removes a seat map and its draft. IDEMPOTENT: a seat map that is already gone answers deleted:false rather than failing, so a retried delete is safe. It removes the draft only; published versions survive it.","tags":["booking-seatmaps"],"parameters":[{"name":"seatmapId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"seatmapId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"deleted":{"type":"boolean","description":"Whether THIS call removed the seat map. False means it was already gone — the operation is idempotent, and says which of the two happened rather than pretending."}},"required":["seatmapId","deleted"],"additionalProperties":false},"example":{"seatmapId":"018fa100-0000-4000-8000-0000000000f1","deleted":true}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: seatmapId path parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"destructive","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/seatmaps/{seatmapId}/versions":{"post":{"operationId":"bookingPublishSeatmap","summary":"Publish the draft as a version","description":"WO-2524: copies the current draft into a new immutable version with its seat keys and seat count. The draft stays editable; a republish mints the next version and leaves every earlier one unchanged. Idempotent on clientRequestId.","tags":["booking-seatmaps"],"parameters":[{"name":"seatmapId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key: a retried publish answers the version it minted."}},"required":["clientRequestId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"seatmapId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"seatCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"seatKeys":{"type":"array","items":{"type":"string","minLength":1}},"document":{"type":"object","properties":{"schemaVersion":{"const":"seatmap-document.v1"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"default":null,"description":"Operator-chosen seat-map name; null until they name it."},"venue":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Opaque venue geometry (sections, rows, seats, viewport). Structure only: any nested key carrying monetary vocabulary is refused."}},"required":["schemaVersion","venue"],"additionalProperties":false},"publishedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["versionId","seatmapId","version","seatCount","seatKeys","document","publishedAt"],"additionalProperties":false},"example":{"versionId":"018fa100-0000-4000-8000-0000000000f3","seatmapId":"018fa100-0000-4000-8000-0000000000f1","version":1,"seatCount":2,"seatKeys":["orchestra-A-1","orchestra-A-2"],"document":{"schemaVersion":"seatmap-document.v1","name":"Grand Hall","venue":{"viewBox":{"width":1200,"height":800},"sections":[{"id":"orchestra","label":"Orchestra","rows":[{"id":"row-a","label":"A","seats":[{"id":"a-1","label":"1","x":120,"y":240},{"id":"a-2","label":"2","x":156,"y":240}]}]}]}},"publishedAt":"2026-08-08T18:10:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Seatmap not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: a concurrent publish took this version number.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: seatmapId path parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]},"get":{"operationId":"bookingListSeatmapVersions","summary":"List the published versions","description":"WO-2524: every published version of the seat map, oldest first, each with its seat count. A seat map that was never published is refused as seatmap_not_published.","tags":["booking-seatmaps"],"parameters":[{"name":"seatmapId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"versionId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"seatmapId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"seatCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"publishedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["versionId","seatmapId","version","seatCount","publishedAt"],"additionalProperties":false}}},"required":["versions"],"additionalProperties":false},"example":{"versions":[{"versionId":"018fa100-0000-4000-8000-0000000000f3","seatmapId":"018fa100-0000-4000-8000-0000000000f1","version":1,"seatCount":2,"publishedAt":"2026-08-08T18:10:00.000Z"}]}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Seatmap not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict: seatmap_not_published: the seat map has no published version.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: seatmapId path parameter.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embeddings":{"get":{"operationId":"bookingEmbeddingList","summary":"List embeddings for the org","description":"Org-scoped listing of page installations for the embeddings workspace. Cursor-paginated per the house list idiom.","tags":["embed-studio"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","format":"uuid","description":"Opaque page cursor from a prior response."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"description":"Max rows to return (1-100); defaults to the resolver's own page size."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"embeddings":{"type":"array","items":{"type":"object","properties":{"embeddingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowedOrigins":{"type":"array","items":{"type":"string"}},"state":{"enum":["active","paused"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["embeddingId","organizationId","manifestId","allowedOrigins","state","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},{"type":"null"}]}},"required":["embeddings","nextCursor"],"additionalProperties":false},"example":{"embeddings":[{"embeddingId":"018fa100-0000-4000-8000-0000000000f1","organizationId":"018f9b00-1111-7000-8000-000000000abc","manifestId":"018fa100-0000-4000-8000-0000000000e1","allowedOrigins":["https://example.com","https://tickets.example.com"],"state":"active","createdAt":"2026-08-02T12:00:00.000Z","updatedAt":"2026-08-02T12:00:00.000Z"},{"embeddingId":"018fa100-0000-4000-8000-0000000000f2","organizationId":"018f9b00-1111-7000-8000-000000000abc","manifestId":"018fa100-0000-4000-8000-0000000000e1","allowedOrigins":["https://partner.example.org"],"state":"paused","createdAt":"2026-08-02T12:10:00.000Z","updatedAt":"2026-08-02T12:20:00.000Z"}],"nextCursor":null}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: cursor and limit query parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]},"post":{"operationId":"bookingEmbeddingCreate","summary":"Create an origin-bound installation of a page","description":"Creates an active embedding for an org-owned page with at least one canonical HTTPS origin. The manifest is resolved by (organization, manifestId) — a cross-org reference refuses even when the opaque key exists.","tags":["embed-studio"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"manifestId":{"type":"string","format":"uuid","description":"The page this installation serves."},"allowedOrigins":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string"}},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["manifestId","allowedOrigins","clientRequestId"],"additionalProperties":false}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"embeddingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowedOrigins":{"type":"array","items":{"type":"string"}},"state":{"enum":["active","paused"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["embeddingId","organizationId","manifestId","allowedOrigins","state","createdAt","updatedAt"],"additionalProperties":false},"example":{"embeddingId":"018fa100-0000-4000-8000-0000000000f1","organizationId":"018f9b00-1111-7000-8000-000000000abc","manifestId":"018fa100-0000-4000-8000-0000000000e1","allowedOrigins":["https://example.com","https://tickets.example.com"],"state":"active","createdAt":"2026-08-02T12:00:00.000Z","updatedAt":"2026-08-02T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Page not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: manifestId, canonical HTTPS allowedOrigins (non-empty, unique), and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embeddings/{embeddingId}":{"get":{"operationId":"bookingEmbeddingGet","summary":"Read one embedding","description":"Returns the installation row truth. What is currently served is derived from the page's live pointer at serve time, not stored here.","tags":["embed-studio"],"parameters":[{"name":"embeddingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"embeddingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowedOrigins":{"type":"array","items":{"type":"string"}},"state":{"enum":["active","paused"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"refusedOrigins":{"type":"array","items":{"type":"string","maxLength":255},"description":"Hosts the served loader saw load the install artifact from outside the allowed origins, oldest first."}},"required":["embeddingId","organizationId","manifestId","allowedOrigins","state","createdAt","updatedAt","refusedOrigins"],"additionalProperties":false},"example":{"embeddingId":"018fa100-0000-4000-8000-0000000000f1","organizationId":"018f9b00-1111-7000-8000-000000000abc","manifestId":"018fa100-0000-4000-8000-0000000000e1","allowedOrigins":["https://example.com","https://tickets.example.com"],"state":"active","refusedOrigins":["https://partner-cms.example.org"],"createdAt":"2026-08-02T12:00:00.000Z","updatedAt":"2026-08-02T12:00:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Embedding not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-command":"sonik.embedding.get","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embeddings/{embeddingId}/origins":{"put":{"operationId":"bookingEmbeddingOriginsReplace","summary":"Replace the declared origins","description":"Full replacement of the origin registry — the one list that feeds write validation, CSP frame-ancestors, and any future mint port. Non-canonical origins refuse; there is no additive drift.","tags":["embed-studio"],"parameters":[{"name":"embeddingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"allowedOrigins":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string"}},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["allowedOrigins","clientRequestId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"embeddingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowedOrigins":{"type":"array","items":{"type":"string"}},"state":{"enum":["active","paused"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["embeddingId","organizationId","manifestId","allowedOrigins","state","createdAt","updatedAt"],"additionalProperties":false},"example":{"embeddingId":"018fa100-0000-4000-8000-0000000000f1","organizationId":"018f9b00-1111-7000-8000-000000000abc","manifestId":"018fa100-0000-4000-8000-0000000000e1","allowedOrigins":["https://example.com","https://new.example.net"],"state":"active","createdAt":"2026-08-02T12:00:00.000Z","updatedAt":"2026-08-02T12:30:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Embedding not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: canonical HTTPS allowedOrigins (non-empty, unique) and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/embeddings/{embeddingId}/state":{"put":{"operationId":"bookingEmbeddingStateSet","summary":"Pause or reactivate an embedding","description":"Sets the installation state. Paused serves the public 410 sentinel; there is no delete — unknown maps to 404 and history stays intact.","tags":["embed-studio"],"parameters":[{"name":"embeddingId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"enum":["active","paused"],"type":"string"},"clientRequestId":{"type":"string","minLength":1,"description":"Required idempotency key."}},"required":["state","clientRequestId"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"embeddingId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"organizationId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"manifestId":{"type":"string","format":"uuid","description":"A booking-domain UUID (Postgres uuid primary/foreign key)."},"allowedOrigins":{"type":"array","items":{"type":"string"}},"state":{"enum":["active","paused"],"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp with offset (Postgres timestamptz)."}},"required":["embeddingId","organizationId","manifestId","allowedOrigins","state","createdAt","updatedAt"],"additionalProperties":false},"example":{"embeddingId":"018fa100-0000-4000-8000-0000000000f1","organizationId":"018f9b00-1111-7000-8000-000000000abc","manifestId":"018fa100-0000-4000-8000-0000000000e1","allowedOrigins":["https://example.com","https://tickets.example.com"],"state":"paused","createdAt":"2026-08-02T12:00:00.000Z","updatedAt":"2026-08-02T12:40:00.000Z"}}}},"401":{"description":"No resolved Better Auth session (PROVISIONAL — session transport not yet frozen).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Embedding not found in your organization. Under FORCE RLS a row in another org is indistinguishable from a missing one — both 404, never a cross-org leak.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed: state (active | paused) and clientRequestId.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/billing/plan":{"get":{"operationId":"bookingBillingPlan","summary":"Get the organization's plan","description":"Reads the caller's own organization's subscription from amplify's billing router over the OAuth rail with the caller's bearer: plan, status, entitlement, period end, and the plan source and processor amplify reports. A session cookie or internal token is never sent; a caller without a bearer is refused.","tags":["booking-billing"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"planId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"status":{"type":"string","minLength":1},"entitlementActive":{"type":"boolean"},"currentPeriodEnd":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"source":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"processor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["organizationId","planId","status","entitlementActive","currentPeriodEnd","source","processor"],"additionalProperties":false},"example":{"organizationId":"50800000-0000-4000-8000-000000000001","planId":"pro","status":"active","entitlementActive":true,"currentPeriodEnd":"2026-11-04","source":"polar","processor":"stripe"}}}},"401":{"description":"No booking session, or a caller without an OAuth bearer (a session cookie or internal token never rides the billing rail).","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED","BILLING_READ_BEARER_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BILLING_READ_BEARER_REQUIRED","message":"The plan read needs the caller's OAuth bearer; a session or internal token is never sent to amplify"}}}}},"502":{"description":"amplify's billing read refused or could not answer the caller's bearer, or named no plan source or processor.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BILLING_READ_RAIL_ABSENT","BILLING_PLAN_SOURCE_ABSENT"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BILLING_READ_RAIL_ABSENT","message":"amplify's billing read refused the caller's bearer (HTTP 401)"}}}}},"503":{"description":"amplify's billing rail is not configured.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["BILLING_READ_RAIL_UNCONFIGURED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"BILLING_READ_RAIL_UNCONFIGURED","message":"amplify's billing rail is not configured"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/payments/dead-letters":{"get":{"operationId":"bookingPaymentDeadLetterList","summary":"List payment dead letters","description":"Lists the payment webhooks (refunds, disputes, …) that failed every queue retry, for the caller's organization, newest first. A row is the organization's when intake scoped it, or when the Stripe PaymentIntent it names belongs to one of the organization's payment attempts. Read through the payment module.","tags":["booking-payments"],"parameters":[{"name":"status","in":"query","schema":{"enum":["dead","replayed"],"type":"string","description":"Only rows in this status."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"description":"At most this many, newest first (50)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deadLetters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Dead-letter row id."},"inboxId":{"type":"string","minLength":1,"description":"The webhook inbox row the event was stored in."},"provider":{"type":"string","minLength":1,"description":"Payment provider family of the webhook (stripe, stripe_connect, …)."},"providerEventId":{"type":"string","minLength":1,"description":"The provider's event id (Stripe evt_…), the id a redrive names."},"eventType":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The provider event type, when intake read one."},"providerPaymentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The provider PaymentIntent the event is about, when it named one."},"reason":{"type":"string","minLength":1,"description":"Why the queue gave up (consumer_retries_exhausted, …)."},"status":{"enum":["dead","replayed"],"type":"string","description":"dead: waiting; replayed: a redrive went through."},"failedAt":{"type":"string","minLength":1,"description":"When the queue gave up."},"replayedAt":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"When a redrive went through; null while dead."},"lastError":{"type":"string","description":"The last failure: the queue's, or a failed redrive's own (`redrive <at> by <actor> failed: …`)."}},"required":["id","inboxId","provider","providerEventId","eventType","providerPaymentId","reason","status","failedAt","replayedAt","lastError"],"additionalProperties":false}}},"required":["deadLetters"],"additionalProperties":false},"example":{"deadLetters":[{"id":"payment-dead-letter:7f3c1f5e-2a41-4c8e-9a51-0d3e5b1c2a90:consumer_retries_exhausted","inboxId":"7f3c1f5e-2a41-4c8e-9a51-0d3e5b1c2a90","provider":"stripe","providerEventId":"evt_3UVA8oDWgfHMOrRx3xCD7mt5","eventType":"charge.refunded","providerPaymentId":"pi_3UVA8oDWgfHMOrRx3xCD7mt5","reason":"consumer_retries_exhausted","status":"dead","failedAt":"2026-10-27T13:21:04.000Z","replayedAt":null,"lastError":"refund id missing"}]}}}},"401":{"description":"No booking session.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted authenticated booking actor is required"}}}}},"502":{"description":"The payment module did not answer or refused.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PAYMENT_DEAD_LETTER_RAIL_FAILED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PAYMENT_DEAD_LETTER_RAIL_FAILED","message":"The payment module refused (HTTP 500)"}}}}},"503":{"description":"The PAYMENT_MODULE binding or its manual token is not configured.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PAYMENT_DEAD_LETTER_RAIL_UNCONFIGURED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PAYMENT_DEAD_LETTER_RAIL_UNCONFIGURED","message":"The payment module rail is not configured"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"read","security":[{"betterAuthSession":[]}]}},"/api/v1/booking/payments/dead-letters/redrive":{"post":{"operationId":"bookingPaymentDeadLetterRedrive","summary":"Redrive a payment dead letter","description":"Runs one dead-lettered payment webhook, named by its provider event id, through the payment queue's own processor once. Its rows are claimed first, so a second call answers already_replayed and runs nothing. The outcome stays on the rows: replayed with replayedAt when it went through, back to dead with the redrive's error as lastError when it failed again. Moves no money: it applies what the provider already did (a refund, a dispute).","tags":["booking-payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"providerEventId":{"type":"string","minLength":1,"maxLength":255,"description":"The dead-lettered event's provider id (Stripe evt_…), as the list or Stripe's dashboard shows it."},"reason":{"type":"string","minLength":1,"maxLength":500,"description":"Why it is redriven, for the audit line."}},"required":["providerEventId","reason"],"additionalProperties":false},"example":{"providerEventId":"evt_3UVA8oDWgfHMOrRx3xCD7mt5","reason":"Refund at Stripe 10-27 13:19Z; projection fixed in the integrity-2 release"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"providerEventId":{"type":"string","minLength":1},"outcome":{"enum":["processed","duplicate","failed","already_replayed"],"type":"string","description":"processed: applied now; duplicate: it had already been applied; failed: it failed again (the rows are dead again, lastError says why); already_replayed: nothing was dead, nothing ran."},"deadLetters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Dead-letter row id."},"inboxId":{"type":"string","minLength":1,"description":"The webhook inbox row the event was stored in."},"provider":{"type":"string","minLength":1,"description":"Payment provider family of the webhook (stripe, stripe_connect, …)."},"providerEventId":{"type":"string","minLength":1,"description":"The provider's event id (Stripe evt_…), the id a redrive names."},"eventType":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The provider event type, when intake read one."},"providerPaymentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The provider PaymentIntent the event is about, when it named one."},"reason":{"type":"string","minLength":1,"description":"Why the queue gave up (consumer_retries_exhausted, …)."},"status":{"enum":["dead","replayed"],"type":"string","description":"dead: waiting; replayed: a redrive went through."},"failedAt":{"type":"string","minLength":1,"description":"When the queue gave up."},"replayedAt":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"When a redrive went through; null while dead."},"lastError":{"type":"string","description":"The last failure: the queue's, or a failed redrive's own (`redrive <at> by <actor> failed: …`)."}},"required":["id","inboxId","provider","providerEventId","eventType","providerPaymentId","reason","status","failedAt","replayedAt","lastError"],"additionalProperties":false},"description":"The event's rows after the redrive."}},"required":["providerEventId","outcome","deadLetters"],"additionalProperties":false},"example":{"providerEventId":"evt_3UVA8oDWgfHMOrRx3xCD7mt5","outcome":"processed","deadLetters":[{"id":"payment-dead-letter:7f3c1f5e-2a41-4c8e-9a51-0d3e5b1c2a90:consumer_retries_exhausted","inboxId":"7f3c1f5e-2a41-4c8e-9a51-0d3e5b1c2a90","provider":"stripe","providerEventId":"evt_3UVA8oDWgfHMOrRx3xCD7mt5","eventType":"charge.refunded","providerPaymentId":"pi_3UVA8oDWgfHMOrRx3xCD7mt5","reason":"consumer_retries_exhausted","status":"replayed","failedAt":"2026-10-27T13:21:04.000Z","replayedAt":"2026-10-30T09:00:00.000Z","lastError":"refund id missing"}]}}}},"401":{"description":"No booking session.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["AUTHENTICATION_REQUIRED","AUTH_REQUIRED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"AUTHENTICATION_REQUIRED","message":"A trusted authenticated booking actor is required"}}}}},"403":{"description":"The actor cannot manage this organization's events.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["ORGANIZATION_ACCESS_DENIED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"ORGANIZATION_ACCESS_DENIED","message":"Organizer capability denied"}}}}},"404":{"description":"No dead letter of this organization has that provider event id.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PAYMENT_DEAD_LETTER_NOT_FOUND"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PAYMENT_DEAD_LETTER_NOT_FOUND","message":"No payment dead letter of this organization has that event id"}}}}},"422":{"description":"providerEventId and reason are required.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["VALIDATION_FAILED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"VALIDATION_FAILED","message":"The request does not match the contract"}}}}},"502":{"description":"The payment module did not answer or refused.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PAYMENT_DEAD_LETTER_RAIL_FAILED"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PAYMENT_DEAD_LETTER_RAIL_FAILED","message":"The payment module refused (HTTP 500)"}}}}},"503":{"description":"The PAYMENT_MODULE binding, its manual token, or the organizer authority is not configured.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["PAYMENT_DEAD_LETTER_RAIL_UNCONFIGURED","AUTHORITY_UNAVAILABLE"]},"message":{"type":"string","minLength":1},"details":{"type":"object","additionalProperties":true},"traceId":{"type":"string","minLength":1}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"PAYMENT_DEAD_LETTER_RAIL_UNCONFIGURED","message":"The payment module rail is not configured"}}}}}},"x-sonik-status":"mounted","x-sonik-adapter":"mounted","x-sonik-effect":"write","security":[{"betterAuthSession":[]}]}}},"components":{"securitySchemes":{"betterAuthSession":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"PROVISIONAL until configured-host smoke passes — Better Auth session token forwarded by the booking Worker to Amplify GET /api/auth/get-session. The adapter also forwards Authorization when present and treats x-organization-id only as a hint; organization authority and app principal UUID must come from Amplify's organization_memberships/app_principals."}}}}