{"openapi":"3.1.0","info":{"title":"PLACEFULL API","version":"2.0.0","description":"# PLACEFULL API\n\nPLACEFULL is a booking platform for studios and service businesses. Use the REST API to manage catalog, availability, bookings, payments, memberships, and customer records — or embed the public **storefront** surface for self-serve booking.\n\nAll successful responses use a `{ \"data\": … }` envelope. Money amounts are **integer minor units** (cents). Timestamps are **ISO-8601** strings in UTC.\n\n## Base URLs\n\n| Environment | URL |\n| --- | --- |\n| **Production** | `https://bookable-api.onrender.com` |\n| **Local** | `http://localhost:3000` |\n\nUse the **Production** or **Local** server selector above when trying requests in this reference.\n\n## Authentication\n\nPLACEFULL accepts two credential types:\n\n1. **Session bearer** — passwordless login for operators and customers.\n2. **API key** — machine access for integrations and MCP (`bk_…` prefix).\n\n### Passwordless session\n\n**Step 1 — request a verification code**\n\n```bash\ncurl -sS -X POST https://bookable-api.onrender.com/auth/challenges \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"email\":\"you@example.com\",\"channel\":\"email_code\"}'\n```\n\nResponse `data.challengeId` identifies the challenge. The code is delivered by email (or SMS when enabled).\n\n**Step 2 — verify and receive a session token**\n\n```bash\ncurl -sS -X POST https://bookable-api.onrender.com/auth/verify \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"challengeId\":\"<challenge-id>\",\"code\":\"123456\"}'\n```\n\n**Step 3 — send the token on authenticated requests**\n\n```bash\ncurl -sS https://bookable-api.onrender.com/me/profile \\\n  -H 'Authorization: Bearer <sessionToken>'\n```\n\nSession tokens expire. Repeat the flow when you receive `401 unauthorized`.\n\n### API key\n\nCreate a key with `POST /businesses/{businessId}/api-keys` (session auth, `business.manage`). The plaintext `bk_` key is returned once. Send it as a Bearer token on feature-gated `/businesses/*` routes:\n\n```bash\ncurl -sS https://bookable-api.onrender.com/businesses/<business-id>/customers \\\n  -H 'Authorization: Bearer bk_your_api_key_here'\n```\n\nThat example needs feature `crm.view`. API keys are not accepted on `/me/*`, `POST /businesses`, or the api-keys routes themselves — a key cannot mint its own successor. Gated operator routes also require the **feature** named in each operation's description (for example `booking.manage`).\n\n### Agents\n\nPoint an agent host at this base URL.\n\n| What | URL |\n| --- | --- |\n| **MCP (Streamable HTTP)** | `POST https://bookable-api.onrender.com/mcp` |\n| **Server card** | `https://bookable-api.onrender.com/.well-known/mcp.json` |\n| **Agent guide** | `https://bookable-api.onrender.com/llms.txt` |\n| **OAuth metadata** | `https://bookable-api.onrender.com/.well-known/oauth-authorization-server` |\n| **Operator setup (console)** | `https://bookable-api.onrender.com/app/settings?show=integrations` |\n\n**Claude (recommended):** paste `https://bookable-api.onrender.com/mcp` into Settings → Connectors → Add custom connector → Connect → sign in with the operator email. OAuth 2.1 + PKCE — no API key.\n\n**Cursor / CI:** create a `bk_` API key and send `Authorization: Bearer bk_…` on `POST /mcp`.\n\nUnauthenticated `POST /mcp` returns `401` with `WWW-Authenticate` pointing at protected-resource metadata so clients discover OAuth automatically.\n\n## API surfaces\n\n| Surface | Prefix | Audience |\n| --- | --- | --- |\n| **Operator API** | `/businesses/…`, `/offerings/…`, `/locations/…`, … | Staff and integrations managing a business |\n| **Storefront API** | `/storefront/…` | Public embeddable booking widgets |\n| **Customer self-service** | `/me/…` | Signed-in customers managing their profile and bookings |\n\nStorefront routes are **public read** (no auth) except booking hold and confirm, which require a customer session. Storefront routes are **rate limited** — see below.\n\n## Errors\n\nErrors return a **non-2xx** status with this envelope:\n\n```json\n{\n  \"error\": {\n    \"code\": \"validation\",\n    \"message\": \"email is required\",\n    \"details\": {}\n  }\n}\n```\n\n| Code | HTTP | Meaning |\n| --- | --- | --- |\n| `validation` | 400 | Invalid input |\n| `unauthorized` | 401 | Missing or invalid credentials |\n| `forbidden` | 403 | Authenticated but not permitted (missing feature or role) |\n| `not_found` | 404 | Resource does not exist |\n| `conflict` | 409 | State conflict (capacity, duplicate, or concurrent hold lost) |\n| `too_many_requests` | 429 | Rate limit exceeded |\n| `internal_error` | 500 | Unexpected server error |\n\n## Rate limits\n\n**Storefront** routes (`/storefront/…`) are limited to **120 requests per minute per IP** by default (`STOREFRONT_RATE_LIMIT_MAX` / `STOREFRONT_RATE_LIMIT_WINDOW_MS`). When exceeded, the API returns **429** `too_many_requests` with a `Retry-After` header (seconds until the window resets). Operator routes are not globally rate limited in v1.\n\n## Pagination\n\n**Offset pagination** — CRM customer list (`GET /businesses/:id/customers`):\n\n- Query: `limit` (default 50), `offset` (default 0)\n- Response `data`: `{ customers, total, limit, offset }`\n\n**Cursor pagination** — storefront offering lists (`GET /storefront/locations/:id/offerings`):\n\n- Query: `limit`, `cursor` (opaque; omit on first page)\n- Response `data`: `{ items, nextCursor }` — pass `nextCursor` as `cursor` for the next page; `null` means end.\n\n## Versioning\n\n`info.version` tracks the REST contract. **Breaking** changes (removed fields, renamed paths, semantic changes) bump the major version. Additive changes (new optional fields, new endpoints) are minor. The MCP surface is versioned separately via tool schemas.\n\nDownload this spec from [`/openapi.json`](https://bookable-api.onrender.com/openapi.json) to generate clients or import into Postman.","contact":{"name":"PLACEFULL Developer Support","email":"developers@bookable.app","url":"https://bookable-api.onrender.com"},"license":{"name":"Proprietary","url":"https://bookable-api.onrender.com/terms"},"x-logo":{"url":"https://bookable-api.onrender.com/branding/lockup.png","altText":"PLACEFULL","href":"https://bookable-api.onrender.com"}},"servers":[{"url":"https://bookable-api.onrender.com","description":"Production"},{"url":"http://localhost:3000","description":"Local"}],"tags":[{"name":"system","description":"Process health and platform status"},{"name":"auth","description":"Passwordless authentication"},{"name":"person","description":"Person identities"},{"name":"business","description":"Business profiles and settings"},{"name":"location","description":"Physical locations"},{"name":"catalog","description":"Resources, team, and offerings"},{"name":"availability","description":"Schedule projection and occurrence slots"},{"name":"booking","description":"Operator booking lifecycle"},{"name":"commerce","description":"Payments, balances, and Stripe Connect"},{"name":"crm","description":"Customer records and export"},{"name":"membership","description":"Plans, benefits, and pricing"},{"name":"access","description":"Team roles and feature gates"},{"name":"waitlist","description":"Session waitlists"},{"name":"chat","description":"Operator chat — an LLM agent over the intent tools"},{"name":"me","description":"Customer self-service for the signed-in person"},{"name":"storefront","description":"Public embeddable booking surface"}],"x-tagGroups":[{"name":"Platform","tags":["system","auth","person","access"]},{"name":"Operator API","tags":["business","location","catalog","availability","booking","commerce","crm","membership","waitlist","chat"]},{"name":"Storefront API","tags":["storefront","me"]}],"paths":{"/businesses/{businessId}/assets":{"get":{"operationId":"listAssets","summary":"List library assets","description":"Lists photos in the business library, with search, tag, unused, and sort filters. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"q","schema":{"type":"string"}},{"in":"query","name":"tag","schema":{"type":"string"}},{"in":"query","name":"unused","schema":{"type":"string","enum":["1","true"]}},{"in":"query","name":"archived","schema":{"type":"string","enum":["1","true"]}},{"in":"query","name":"sort","schema":{"type":"string","enum":["recent","used","name"]}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"in":"query","name":"offset","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssetListResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"uploadAsset","summary":"Upload a library asset","description":"Uploads a photo into the business library without attaching it. Identical bytes return the existing asset. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadImageBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Asset"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/assets/{id}":{"get":{"operationId":"getAsset","summary":"Get a library asset","description":"Returns a library photo, its usage count, and the records it is attached to. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AssetIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AssetDetail"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateAsset","summary":"Update asset metadata","description":"Updates a library photo title, alt text, or tags. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AssetIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Asset"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"deleteAsset","summary":"Delete a library asset","description":"Permanently deletes a library photo, its placements, and stored variant objects. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AssetIdParam"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/assets/{id}/archive":{"post":{"operationId":"archiveAsset","summary":"Archive a library asset","description":"Soft-archives a library photo so it no longer appears in the picker. Placements keep rendering. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AssetIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Asset"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/assets/{id}/replace":{"post":{"operationId":"replaceAsset","summary":"Replace asset bytes","description":"Replaces the bytes of a library photo. Existing placements keep the same asset id. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/AssetIdParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadImageBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Asset"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/images/attach":{"post":{"operationId":"attachOfferingImage","summary":"Attach a library photo to an offering","description":"Attaches an existing library photo to an offering. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachAssetBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/resources/{id}/images/attach":{"post":{"operationId":"attachResourceImage","summary":"Attach a library photo to a resource","description":"Attaches an existing library photo to a resource. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachAssetBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/instructor-profiles/{id}/images/attach":{"post":{"operationId":"attachInstructorImage","summary":"Attach a library photo as an instructor headshot","description":"Attaches an existing library photo as an instructor headshot. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/InstructorIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachAssetBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/membership-plans/{id}/images/attach":{"post":{"operationId":"attachMembershipPlanImage","summary":"Attach a library photo as a plan cover","description":"Attaches an existing library photo as a membership plan cover. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/MembershipPlanIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachAssetBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{id}/logo/attach":{"post":{"operationId":"attachBusinessLogo","summary":"Attach a library photo as the business logo","description":"Attaches an existing library photo as the business logo. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachAssetBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses":{"post":{"operationId":"createBusiness","summary":"Create a business and its first location","description":"Registers a new business and its first location for the signed-in owner. Optional `acceptedLegal: true` records Merchant Agreement and Privacy in the same transaction (get-started). Omit it for API/MCP setup — the business cannot take bookings until a person accepts in the console (architecture/18).","tags":["business"],"security":[{"sessionBearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBusinessBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateBusinessResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"business":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null},"location":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listBusinesses","summary":"List businesses","description":"Lists businesses visible to the caller.","tags":["business"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Business"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}}}}},"/businesses/{businessId}/legal/merchant-agreement/accept":{"post":{"operationId":"acceptMerchantAgreement","summary":"Accept the current Merchant Agreement and Privacy Policy","description":"Records acceptance of the current Merchant Agreement and Privacy Policy for a business (one-time, or again after a version change). Session only — not callable with an API key. Returns the updated merchantAgreement status. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"stale":{"type":"boolean"},"currentVersion":{"type":"string"},"currentSummary":{"type":"string"},"currentEffectiveAt":{"type":"string"},"acceptedVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["stale","currentVersion","currentSummary","currentEffectiveAt","acceptedVersion"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{id}":{"get":{"operationId":"getBusiness","summary":"Get a business by ID","description":"Returns a single business profile by ID.","tags":["business"],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Business"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateBusiness","summary":"Update a business","description":"Updates mutable business profile fields. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBusinessBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Business"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{id}/archive":{"post":{"operationId":"archiveBusiness","summary":"Archive a business","description":"Soft-archives a business so it no longer accepts new activity. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Business"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{id}/slug":{"patch":{"operationId":"updateBusinessSlug","summary":"Override a business public slug","description":"Writes the previous slug to history (old links 301). Renaming the business never changes the slug. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Business"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{id}/slug/revert":{"post":{"operationId":"revertBusinessSlug","summary":"Revert a business slug to auto-generated from the current name","description":"Revert a business slug to auto-generated from the current name Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Business"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{id}/logo":{"post":{"operationId":"uploadBusinessLogo","summary":"Upload a business logo","description":"Uploads or replaces the business logo used on public pages and emails. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadBusinessLogoBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"deleteBusinessLogo","summary":"Remove a business logo","description":"Removes the business logo. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdPathParam"}],"responses":{"204":{"description":"No content"},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/api-keys":{"post":{"operationId":"createApiKey","summary":"Create an API key","description":"Issues a business-scoped `bk_` key. The plaintext key is returned once and never again. Session auth only — API keys cannot mint successors. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1}},"required":["label"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","label","lastUsedAt","createdAt","revokedAt"],"additionalProperties":false},"key":{"type":"string"}},"required":["apiKey","key"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listApiKeys","summary":"List API keys","description":"Metadata only — never the hash or plaintext. Session auth only. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","label","lastUsedAt","createdAt","revokedAt"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/api-keys/{id}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key","description":"Sets revoked_at. Scoped to the business in the path (IDOR-safe). Session auth only. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/ApiKeyIdParam"}],"responses":{"204":{"description":"No content"},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings":{"post":{"operationId":"createBooking","summary":"Create a booking hold","description":"Places a capacity hold and returns a booking in held status. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookingBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listBookings","summary":"List bookings for the operator console","description":"Location-scoped roster of bookings whose session starts in [from, to) (local calendar days in the location timezone). Empty days are omitted. Includes canceled bookings unless status is set. Optional filters: status, offeringId, instructorId (business-scoped callers only — instructor scope always forces the caller's own profile), q (customer name/email, listing name, or booking id prefix). Instructor filtering uses the session snapshot. Requires feature `booking.view`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"from","schema":{"type":"string"},"required":true},{"in":"query","name":"to","schema":{"type":"string"},"required":true},{"in":"query","name":"status","schema":{"type":"string","enum":["held","confirmed","completed","canceled","no_show"]}},{"in":"query","name":"offeringId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"instructorId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"q","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBookingListResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/availability":{"get":{"operationId":"getOperatorAvailability","summary":"List bookable occurrences for operators (includes past-cutoff / in-progress)","description":"Lists occurrences for the admin Add-booking picker, including past-cutoff and in-progress slots. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"offeringId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"from","schema":{"type":"string"},"required":true},{"in":"query","name":"to","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OccurrenceSlot"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/carts":{"post":{"operationId":"createOperatorCart","summary":"Create a staff pay-by-link cart","description":"Creates a cart for a customer with held booking items and returns the absolute cart URL. Requires Connect charges-enabled. Provide customerId or email (find-or-create). Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOperatorCartBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayLinkCart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/carts/{token}/email":{"post":{"operationId":"sendOperatorCartPayLink","summary":"Email a pay link to the cart customer","description":"Sends the pay-link email to the cart's attached customer. Transactional (ignores marketing consent). Returns { sent, toMasked } — or sent:false with a reason when there is no recipient, the cart is not open, or mail is not configured. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/CartTokenParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PayLinkEmailResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}":{"get":{"operationId":"getBooking","summary":"Get a booking","description":"Returns booking details including price snapshot and payment state. Requires feature `booking.view`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/confirm":{"post":{"operationId":"confirmBooking","summary":"Confirm a held booking with payment","description":"Captures payment and confirms a held booking. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/collect-balance":{"post":{"operationId":"collectBookingBalance","summary":"Collect remaining booking balance","description":"Charges the remaining balance on a split-pay booking. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectBalanceBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/cancel":{"post":{"operationId":"cancelBooking","summary":"Cancel a booking","description":"Cancels a booking and releases capacity. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/reschedule":{"post":{"operationId":"rescheduleBooking","summary":"Reschedule a booking","description":"Moves a booking to a different occurrence. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescheduleBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/complete":{"post":{"operationId":"completeBooking","summary":"Mark a booking completed","description":"Marks an attended booking as completed. Requires feature `booking.checkin`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/money-effects":{"post":{"operationId":"describeMoneyEffect","summary":"Dry-run: declare the money effect of an action without executing it","description":"Dry-run: declare the money effect of an action without executing it Requires feature `booking.view`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["booking.confirm","booking.collect_balance","booking.cancel","booking.complete","payment.refund","membership.record_payment"]},"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"paymentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"membershipId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"provider":{"type":"string","enum":["stripe","manual"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["action"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"action":{"type":"string"},"currency":{"type":"string"},"movements":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["charge","refund","forfeit"]},"instrument":{"type":"string","enum":["card","cash","credits"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"}},"required":["direction","instrument","amount","label"],"additionalProperties":false}},"requiresApproval":{"type":"boolean"},"summary":{"type":"string"}},"required":["action","currency","movements","requiresApproval","summary"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/uncomplete":{"post":{"operationId":"uncompleteBooking","summary":"Undo check-in (completed → confirmed)","description":"Undoes check-in — returns a completed booking to confirmed. Requires feature `booking.checkin`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/no-show":{"post":{"operationId":"markBookingNoShow","summary":"Mark a booking as no-show","description":"Marks a confirmed booking as no-show. Requires feature `booking.checkin`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/auto-checkin":{"patch":{"operationId":"updateBookingAutoCheckin","summary":"Override auto-check-in for one booking","description":"Sets a per-booking auto-check-in mode (`off`, `start`, `after_minutes`, `end`) or clears the override with `null`. Inherits from listing and business defaults when unset. Requires feature `booking.manage`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"autoCheckinMode":{"anyOf":[{"type":"string","enum":["off","start","after_minutes","end"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OperatorBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/occurrences/{occurrenceId}/positions":{"get":{"operationId":"getOccurrencePositions","summary":"Session host fill map","description":"Positions and occupants for one occurrence. Exclusive or no-space sessions return mode=roster. Requires feature `booking.view`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/OccurrenceIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OccurrencePositionBoard"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440010:2026-09-01T17:00:00.000Z","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Morning Flow","startsAt":"2026-07-24T12:00:00.000Z","endsAt":"2026-08-01T18:00:00.000Z","timezone":"America/Denver","resourceId":"550e8400-e29b-41d4-a716-446655440007","resourceName":"Studio A","exclusive":false,"mode":"positions","positionLayout":"list","capacityTotal":20,"capacityBooked":1,"waitlisted":0,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440030","sortIndex":0,"name":"Window","occupant":{"bookingId":"550e8400-e29b-41d4-a716-446655440005","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-07-24T12:00:00.000Z"}}],"unassignedBookings":[],"roster":[{"bookingId":"550e8400-e29b-41d4-a716-446655440005","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-07-24T12:00:00.000Z"}]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/positions/move":{"post":{"operationId":"moveBookingPosition","summary":"Move, swap, or assign one seat","description":"Moves one booking_positions row to another live place on the same occurrence. Occupied target swaps. Omit fromPositionId to assign one remaining seat (occupied target claims that place). Requires booking.checkin. Requires feature `booking.checkin`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveBookingPositionBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OccurrencePositionBoard"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440010:2026-09-01T17:00:00.000Z","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Morning Flow","startsAt":"2026-07-24T12:00:00.000Z","endsAt":"2026-08-01T18:00:00.000Z","timezone":"America/Denver","resourceId":"550e8400-e29b-41d4-a716-446655440007","resourceName":"Studio A","exclusive":false,"mode":"positions","positionLayout":"list","capacityTotal":20,"capacityBooked":1,"waitlisted":0,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440030","sortIndex":0,"name":"Window","occupant":{"bookingId":"550e8400-e29b-41d4-a716-446655440005","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-07-24T12:00:00.000Z"}}],"unassignedBookings":[],"roster":[{"bookingId":"550e8400-e29b-41d4-a716-446655440005","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-07-24T12:00:00.000Z"}]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/occurrences/{occurrenceId}/message":{"post":{"operationId":"sendOccurrenceMessage","summary":"Email everyone booked on this session","description":"Queues a transactional session note to the host roster (held / confirmed / completed) who have an email. Does not consult marketing consent. Requires booking.checkin. Empty roster or no emails is 400. Requires feature `booking.checkin`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/OccurrenceIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OccurrenceMessageBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OccurrenceMessageResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"batchId":"550e8400-e29b-41d4-a716-446655440040","queued":4,"skippedNoEmail":0,"subject":"Morning Flow · Monday, August 31, 10:00 AM"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/stripe/connect-account":{"post":{"operationId":"createStripeConnectAccount","summary":"Create a Stripe Connect account for the business","description":"Prefills onboarding from the business profile. `entityType` (asked once in the console) sets Stripe `business_type` and, for `individual`, prefills the caller as the representative from their person record's legal name. Omit it to let Stripe ask. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"entityType":{"type":"string","enum":["individual","company"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Business"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/stripe/account-session":{"post":{"operationId":"createStripeAccountSession","summary":"Create a Stripe Account Session for embedded onboarding","description":"Returns a Stripe client secret for embedded Connect onboarding. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConnectAccountSession"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"clientSecret":"acs_example_client_secret","publishableKey":"pk_example","stripeAccountId":"acct_example"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/stripe/status":{"get":{"operationId":"getStripeConnectStatus","summary":"Get the Stripe Connect onboarding status for the business","description":"Get the Stripe Connect onboarding status for the business Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConnectStatus"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/payments":{"post":{"operationId":"createPayment","summary":"Create a payment","description":"Records a new payment intent against a booking, membership, or customer. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Payment"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/payments/{paymentId}":{"get":{"operationId":"getPayment","summary":"Get a payment","description":"Returns payment status and provider references. Requires feature `business.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PaymentIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Payment"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/payments/{paymentId}/authorize":{"post":{"operationId":"authorizePayment","summary":"Authorize a payment","description":"Authorizes a Stripe payment for later capture. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PaymentIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentActionResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"payment":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"clientSecret":"pi_example_client_secret"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/payments/{paymentId}/capture":{"post":{"operationId":"capturePayment","summary":"Capture an authorized payment","description":"Captures a previously authorized payment. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PaymentIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentActionResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"payment":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"clientSecret":"pi_example_client_secret"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/payments/{paymentId}/refund":{"post":{"operationId":"refundPayment","summary":"Refund a payment","description":"Refunds all or part of a captured payment. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PaymentIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundPaymentBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentActionResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"payment":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"clientSecret":"pi_example_client_secret"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/balance":{"get":{"operationId":"getBusinessBalance","summary":"Get business ledger balance","description":"Returns the business's net ledger position — every kind summed, so the platform's application fee is already netted out. Not gross collected. Requires feature `business.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LedgerBalances"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"total":12500,"currency":"USD"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/balance":{"get":{"operationId":"getBookingBalance","summary":"Get booking ledger balance","description":"Returns what the customer has paid on a booking — charge/refund/adjustment only, excluding platform fee rows. Requires feature `booking.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LedgerBalances"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"total":12500,"currency":"USD"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers/{customerId}/balance":{"get":{"operationId":"getCustomerBalance","summary":"Get customer ledger balance","description":"Returns what a customer has paid at a business — charge/refund/adjustment only, excluding platform fee rows. Requires feature `crm.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/CustomerIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LedgerBalances"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"total":12500,"currency":"USD"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/platform-fee-revenue":{"get":{"operationId":"getPlatformFeeRevenue","summary":"Get platform fee revenue for a business","description":"Returns platform application-fee revenue for a business. Requires feature `business.manage`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LedgerBalances"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"total":12500,"currency":"USD"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers":{"get":{"operationId":"listCustomers","summary":"List customers","description":"Searches and paginates CRM customers with derived stats. Requires feature `crm.view`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"q","schema":{"type":"string"}},{"in":"query","name":"tag","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"marketingConsent","schema":{"type":"boolean"}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"in":"query","name":"offset","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerListResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"customers":[{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}}],"total":1,"limit":25,"offset":0}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"createCustomer","summary":"Create a customer","description":"Creates or links a CRM customer with person profile. Requires feature `crm.notes`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerDetail"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers/export":{"get":{"operationId":"exportCustomersCsv","summary":"Export customers as CSV","description":"Downloads customers as a CSV file. Requires feature `crm.export`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","description":"CSV file contents"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":"id,email,displayName\n550e8400-e29b-41d4-a716-446655440006,alex@example.com,Alex Rivera"}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers/import":{"post":{"operationId":"importCustomers","summary":"Import customers from CSV","description":"Bulk-imports customers from CSV. Requires feature `crm.notes`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerImportResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"created":3,"updated":1,"skipped":0}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers/{customerId}":{"get":{"operationId":"getCustomer","summary":"Get a customer","description":"Returns a customer with person profile and lifetime stats. Requires feature `crm.view`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/CustomerIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerDetail"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateCustomer","summary":"Update a customer","description":"Updates tags, notes, or marketing consent on a customer. Requires feature `crm.notes`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/CustomerIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerDetail"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers/{customerId}/archive":{"post":{"operationId":"archiveCustomer","summary":"Archive a customer","description":"Soft-archives a CRM customer. Requires feature `crm.notes`.","tags":["crm"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/CustomerIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/membership-plans":{"post":{"operationId":"createMembershipPlan","summary":"Create a membership plan","description":"Creates a membership plan with optional benefits. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMembershipPlanBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipPlan"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listMembershipPlans","summary":"List membership plans","description":"Lists membership plans for a business. Requires feature `business.view`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MembershipPlan"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/membership-plans/order":{"patch":{"operationId":"reorderMembershipPlans","summary":"Reorder membership plans or packs","description":"Sets catalog display order for membership plans ('membership') or packs ('pack'). ids must match the live set exactly. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"family":{"type":"string","enum":["membership","pack"]},"ids":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["family","ids"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MembershipPlan"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/membership-plans/{planId}":{"get":{"operationId":"getMembershipPlan","summary":"Get a membership plan","description":"Returns a plan with benefit definitions. Requires feature `business.view`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PlanIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipPlan"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateMembershipPlan","summary":"Update a membership plan","description":"Updates a membership plan (benefits replace-all; price locked after first purchase). Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PlanIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMembershipPlanBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipPlan"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/membership-plans/{planId}/publish":{"post":{"operationId":"publishMembershipPlan","summary":"Publish a membership plan","description":"Publishes a draft membership plan for purchase. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PlanIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipPlan"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/membership-plans/{planId}/unpublish":{"post":{"operationId":"unpublishMembershipPlan","summary":"Unpublish a membership plan","description":"Returns a published membership plan to draft. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PlanIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipPlan"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/membership-plans/{planId}/archive":{"post":{"operationId":"archiveMembershipPlan","summary":"Archive a membership plan","description":"Soft-archives a membership plan. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PlanIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipPlan"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/customers/{customerId}/memberships/purchase":{"post":{"operationId":"purchaseMembership","summary":"Purchase a membership for a customer","description":"Purchases a plan for a customer. One-time/manual activates immediately; recurring Stripe returns a Checkout Session URL and creates the membership on webhook. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/CustomerIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseMembershipBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PurchaseMembershipResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"paymentId":"550e8400-e29b-41d4-a716-446655440009","membership":{"id":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","paymentId":"550e8400-e29b-41d4-a716-446655440009","billingMode":"stripe_subscription","stripeSubscriptionId":"sub_test_1","stripeCustomerId":"cus_test_1","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"creditsGranted":10}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/memberships/{membershipId}/record-payment":{"post":{"operationId":"recordMembershipPeriodPayment","summary":"Record a manual period payment for a membership","description":"Records a cash/bank period payment for a manual membership, advances the period, and grants credits. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/MembershipIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordMembershipPeriodPaymentBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"membership":{"$ref":"#/components/schemas/Membership"},"creditsGranted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentId":{"$ref":"#/components/schemas/Uuid"}},"required":["membership","creditsGranted","paymentId"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"membership":{"id":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","paymentId":"550e8400-e29b-41d4-a716-446655440009","billingMode":"stripe_subscription","stripeSubscriptionId":"sub_test_1","stripeCustomerId":"cus_test_1","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"creditsGranted":10,"paymentId":"550e8400-e29b-41d4-a716-446655440009"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/memberships":{"get":{"operationId":"listMemberships","summary":"List memberships for the operator console","description":"Every membership at the business with plan name, holder name/email, status, renewal, billing mode, and credits remaining. The only surface a studio can inspect memberships from (studios have no Stripe dashboard — architecture/05). Requires feature `business.view`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MembershipListResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/memberships/{membershipId}/cancel":{"post":{"operationId":"cancelMembership","summary":"Cancel a membership subscription","description":"Cancels on Stripe (at period end by default). Status is projected back by the subscription webhook — never written locally (architecture/05, build-plan/61). Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/MembershipIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelMembershipBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/memberships/{membershipId}/pause":{"post":{"operationId":"pauseMembership","summary":"Pause a membership subscription","description":"Pauses collection on Stripe; the webhook projects `paused`. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/MembershipIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/memberships/{membershipId}/resume":{"post":{"operationId":"resumeMembership","summary":"Resume a paused membership subscription","description":"Clears the pause on Stripe; the webhook projects `active`. Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/MembershipIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/memberships/{membershipId}/portal":{"post":{"operationId":"createMembershipPortalSession","summary":"Create a Billing Portal session for a membership","description":"Mints a Stripe Billing Customer Portal session for the membership holder and returns its URL. Created as the connected account (direct-charge Customer lives there). Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/MembershipIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalSessionResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/pricing/quote":{"post":{"operationId":"quoteListing","summary":"Quote a listing for a party","description":"Computes price, discounts, and credits for an offering and customer. Requires feature `booking.view`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteListingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingQuote"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/pricing/access-check":{"get":{"operationId":"checkListingAccess","summary":"Check listing access for a customer","description":"Checks whether a customer membership grants required access keys. Requires feature `booking.view`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"offeringId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"customerId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccessCheckResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"allowed":true,"requiredKeys":["premium"],"grantedKeys":["premium"],"missingKeys":[]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/tax-rates":{"get":{"operationId":"listTaxRates","summary":"List active tax rates","description":"Operator-declared sales-tax rates for the business. Archived rates are omitted. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"replaceTaxRates","summary":"Replace active tax rates","description":"Archives every active rate and creates the submitted set in one transaction. At least one rate is required. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"ratePpm":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","ratePpm"]}}},"required":["rates"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/tax-setup":{"get":{"operationId":"getTaxSetup","summary":"Tax setup for the Payments panel","description":"Locations with jurisdiction labels, active rates, and a proposal (Canadian seeds, US guidance, or a missing-address prompt). Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TaxSetup"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/tax-rates/{id}":{"patch":{"operationId":"updateTaxRate","summary":"Update a tax rate","description":"Update a tax rate Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/TaxRateIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"ratePpm":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TaxRate"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/tax-rates/{id}/archive":{"post":{"operationId":"archiveTaxRate","summary":"Archive a tax rate","description":"Soft-archives the rate. Existing bookings keep their snapshotted tax. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/TaxRateIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TaxRate"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/app-config":{"get":{"operationId":"getAppConfig","summary":"Public client configuration","description":"Runtime configuration for browser clients: the product name, the environment, and the currency and date-format options the signup form renders. Unauthenticated, because the console needs it before anyone has signed in. The product name is served rather than compiled into the client so that renaming it is a deployment change, not a rebuild.","tags":["system"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AppConfig"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}}}}},"/me/context":{"get":{"operationId":"getMyContext","summary":"Boot context for the signed-in person","description":"Everything a client needs to decide what to render on load: who the caller is, and the businesses they hold an operator role in, each with its locations and the roles held. Businesses are resolved through UserRole, so this never reveals a business the caller has no relationship with. An empty `businesses` array means the person has signed in but has not created a business yet.","tags":["me"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeContext"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/changes":{"get":{"operationId":"getBusinessChanges","summary":"Console freshness marker","description":"Returns `{ marker }` — the count of `event` rows for the business. Business-scoped and deliberately coarse: answers \"did anything change?\", never \"what changed?\". Not narrowed by location (payment/membership/waitlist/cart events would be silently dropped). Not a cursor; uuid-v7 id order is irrelevant. Requires feature `booking.view`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChangesMarker"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/home":{"get":{"operationId":"getBusinessHome","summary":"Home summary for the operator console","description":"A location-scoped landing summary: today's classes, instructors, bookings that need attention (including failed tasks), money collected / balances due, fill rate over the next 7 days, new customers this week, spaces and rentals for the setup board, and catalog presence counts (classes / instructors / spaces / rentals / membership plans / payments) for empty-tile Invite vs Calm and the setup ramp. Empty sections use empty arrays and zeros. Instructor-scoped operators receive 403 — use my-day instead. Requires feature `location.view`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"day","schema":{"type":"string"}},{"in":"query","name":"bookingsWindow","schema":{"type":"string","enum":["all_time","last_7_days"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/HomeSummary"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/my-day":{"get":{"operationId":"getMyDay","summary":"Day view of sessions and roster","description":"Sessions for one local day with capacity and roster — no money or aggregates. Scoped by the caller's operator scope: instructors see only their own sessions; business-scoped callers see the whole day. Requires feature `booking.view`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"day","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"day":{"type":"string"},"timezone":{"type":"string"},"sessions":{"type":"array","items":{"type":"object","properties":{"startsAt":{"type":"string"},"endsAt":{"type":"string"},"offeringName":{"type":"string"},"locationName":{"type":"string"},"booked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roster":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerName":{"type":"string"},"customerEmail":{"type":"string"},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"}},"required":["bookingId","customerName","customerEmail","partySize","status"],"additionalProperties":false}}},"required":["startsAt","endsAt","offeringName","locationName","booked","capacity","roster"],"additionalProperties":false}}},"required":["day","timezone","sessions"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/schedule-week":{"get":{"operationId":"getBusinessScheduleWeek","summary":"Week of classes for the Schedule tab","description":"Seven local days of class occurrences for one location (draft and hidden included; archived excluded). Each row carries offeringStatus, instructor and space labels, and live capacity. weekStart is the Monday of the ISO week (YYYY-MM-DD); omit it for the current week in the location timezone. Requires feature `location.view`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"weekStart","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduleWeekSummary"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/class-days":{"get":{"operationId":"getBusinessClassDays","summary":"Calendar days that have classes","description":"ISO local dates (YYYY-MM-DD) in the half-open `[from, to)` window with class rows (name, times, active=published). Powers the Home date-picker: up to three dots (lighter for draft/hidden), a + when count > 3, and hover tooltips. Archived excluded. Requires feature `location.view`.","tags":["business"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"from","schema":{"type":"string"},"required":true},{"in":"query","name":"to","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ClassDays"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"days":[{"day":"2026-07-28","count":2,"classes":[{"name":"Yoga Flow","localStart":"2026-07-28T10:00:00.000-06:00","localEnd":"2026-07-28T11:00:00.000-06:00","active":true},{"name":"Draft Wheel","localStart":"2026-07-28T14:00:00.000-06:00","localEnd":"2026-07-28T15:00:00.000-06:00","active":false}]}]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/chat":{"post":{"operationId":"postChat","summary":"Send a message to the operator agent","description":"Starts or continues a conversation and streams the reply as Server-Sent Events. Tools run in-process against the same services REST uses. A tool marked `destructive` is not executed — the stream emits a `proposal` event and stops, and the caller must confirm it explicitly. Responds with `text/event-stream`. Requires feature `booking.view`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"message":{"type":"string"},"ui_context":{"$ref":"#/components/schemas/ChatUiContext"}},"required":["message"]}}}},"responses":{"200":{"description":"SSE stream","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChatStreamNote"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/chat/{sessionId}/confirm":{"post":{"operationId":"postChatConfirm","summary":"Confirm a proposed destructive action","description":"Executes a proposal previously emitted by the agent and resumes the stream. Proposals are single-use and expire after ten minutes. Responds with `text/event-stream`. Requires feature `booking.view`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/SessionIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"proposal_id":{"type":"string"},"ui_context":{"$ref":"#/components/schemas/ChatUiContext"}},"required":["proposal_id"]}}}},"responses":{"200":{"description":"SSE stream","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChatStreamNote"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/chat/sessions":{"get":{"operationId":"listChatSessions","summary":"List chat sessions","description":"Conversations the caller has had with this business, most recently updated first. Scoped to the caller — another person's session is not listed. Requires feature `booking.view`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatSession"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/chat/sessions/{sessionId}":{"get":{"operationId":"getChatSession","summary":"Get a chat transcript","description":"The full message history for one session. A session belonging to another person or business returns 404 rather than 403, so the response never confirms it exists. Requires feature `booking.view`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/SessionIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/ChatSession"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}}},"required":["session","messages"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"archiveChatSession","summary":"Archive a chat session","description":"Soft-archives the conversation. The transcript is retained — \"what did the agent do to this business?\" has to stay answerable. Requires feature `booking.view`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/SessionIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChatSession"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/inline-ai/schedule":{"post":{"operationId":"proposeScheduleInline","summary":"Propose schedules from plain English","description":"Inline AI for the class form: turns a sentence into structured schedule drafts. Does not write schedules — the console confirms and then creates rows. Proposals are HMAC-signed and expire after ten minutes. In `appointment` mode the same sentence is read as availability *windows*: `durationMinutes` is how long the window stays open and `sessionLengthMinutes` is how long one booking inside it runs. Requires feature `location.manage`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"locationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"existing":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"headline":{"type":"string"}},"required":["id","headline"]}},"reviseText":{"type":"string"},"mode":{"type":"string","enum":["class","appointment"]}},"required":["text","locationId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InlineScheduleProposal"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/inline-ai/listing":{"post":{"operationId":"proposeListingInline","summary":"Propose offering form values from plain English","description":"Inline AI for the class and session editors: turns a sentence into field patches and, for a class, optional schedule drafts. Does not write — the console confirms and fills the form. Proposals are HMAC-signed and expire after ten minutes. `offeringType` shapes what may be proposed: a `session` has no schedules and no capacity (its starts come from each deliverer's bookable hours), and carries `durationMinutes` instead. Requires feature `location.manage`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"locationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offeringType":{"type":"string","enum":["class","session"]},"current":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"instructors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]}},"reviseText":{"type":"string"},"transcript":{"type":"array","items":{"$ref":"#/components/schemas/InlineTranscriptTurn"}},"stagedSchedules":{"type":"array","items":{"$ref":"#/components/schemas/InlineScheduleDraft"}},"missingRequired":{"type":"array","items":{"type":"string"}}},"required":["text","locationId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InlineListingProposal"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/inline-ai/resource":{"post":{"operationId":"proposeResourceInline","summary":"Propose a space from plain English","description":"Inline AI for adding a space from the class form: turns a sentence into name, kind, and capacity. Does not write — the console confirms and then creates the resource. Proposals are HMAC-signed and expire after ten minutes. Requires feature `location.manage`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"locationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reviseText":{"type":"string"}},"required":["text","locationId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InlineResourceProposal"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/inline-ai/instructor":{"post":{"operationId":"proposeInstructorInline","summary":"Propose instructor profile values from plain English","description":"Inline AI for the instructor editor: turns a sentence into name, bio, specialties, and optional email. Does not write — the console confirms and fills the form. Never invents an email. Proposals are HMAC-signed and expire after ten minutes. Requires feature `location.manage`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"current":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"reviseText":{"type":"string"},"transcript":{"type":"array","items":{"$ref":"#/components/schemas/InlineTranscriptTurn"}}},"required":["text"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InlineInstructorProposal"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/inline-ai/plan":{"post":{"operationId":"proposePlanInline","summary":"Propose membership or pass form values from plain English","description":"Inline AI for the membership and pass editors: turns a sentence into name, price, description, billing, and benefit hints. Does not write — the console confirms and fills the form. `planSurface` shapes what may be proposed: a pass is a one-time credit bundle; a membership is recurring access. Proposals are HMAC-signed and expire after ten minutes. Requires feature `business.manage`.","tags":["chat"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"planSurface":{"type":"string","enum":["membership","pack"]},"current":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"reviseText":{"type":"string"},"transcript":{"type":"array","items":{"$ref":"#/components/schemas/InlineTranscriptTurn"}},"missingRequired":{"type":"array","items":{"type":"string"}}},"required":["text"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InlinePlanProposal"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/health":{"get":{"operationId":"getHealth","summary":"Health check","description":"Confirms the API process is up and Postgres is reachable.","tags":["system"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/HealthReport"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"status":"ok","db":"up","uptimeSeconds":3600,"timestamp":"2026-07-24T12:00:00.000Z"}}}}}}}}},"/auth/challenges":{"post":{"operationId":"requestAuthChallenge","summary":"Request a passwordless verification challenge","description":"Starts passwordless login by emailing or texting a verification code.","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestChallengeBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RequestChallengeResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"challengeId":"550e8400-e29b-41d4-a716-446655440017","channel":"email_code","expiresAt":"2026-08-01T18:00:00.000Z"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/auth/verify":{"post":{"operationId":"verifyAuthChallenge","summary":"Verify a challenge and receive a session token","description":"Exchanges a verification code for a session bearer token and person record.","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyChallengeBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VerifyChallengeResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"sessionToken":"sess_example_token_not_a_real_secret","sessionExpiresAt":"2026-08-01T18:00:00.000Z","person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"verifyAuthChallengeGet","summary":"Verify a magic-link challenge and land on the right surface","description":"Consumes `challengeId` and `token` query params (from an email_link), writes both session keys (`admin.session` and `sf_session`), and redirects by same-origin `redirectTo`, else last surface, else `/app/`.","tags":["auth"],"parameters":[{"in":"query","name":"challengeId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"token","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"HTML bridge that stores the session and redirects into /app","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/auth/me":{"get":{"operationId":"getAuthMe","summary":"Get the authenticated person (auth namespace)","description":"Returns the person linked to the current session (auth namespace alias).","tags":["auth"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/auth/sign-out":{"post":{"operationId":"signOut","summary":"Revoke the current session","description":"Sessions are long-lived and rolling (architecture/16 § member sign-in), so sign-out is a real server-side revoke — the shared-device escape hatch — not just a client forgetting its token.","tags":["auth"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SignOutResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/persons":{"post":{"operationId":"createPerson","summary":"Create a person","description":"Creates a standalone person record without starting a session.","tags":["person"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePersonBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/persons/{id}":{"get":{"operationId":"getPerson","summary":"Get a person","description":"Fetches a person by ID.","tags":["person"],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updatePerson","summary":"Update a person","description":"Updates profile fields on a person record.","tags":["person"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePersonBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/locations":{"get":{"operationId":"listLocations","summary":"List locations for a business","description":"Lists all locations belonging to a business.","tags":["location"],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"createLocation","summary":"Create a location","description":"Adds a new location under a business. Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLocationBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}":{"get":{"operationId":"getLocation","summary":"Get a location","description":"Returns a location by ID.","tags":["location"],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateLocation","summary":"Update a location","description":"Updates location address, timezone, contact details, or default confirmation message. Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLocationBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/archive":{"post":{"operationId":"archiveLocation","summary":"Archive a location","description":"Soft-archives a location. Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/slug":{"patch":{"operationId":"updateLocationSlug","summary":"Override a location public slug","description":"Override a location public slug Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/slug/revert":{"post":{"operationId":"revertLocationSlug","summary":"Revert a location slug to auto-generated from the current name","description":"Revert a location slug to auto-generated from the current name Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/closures":{"get":{"operationId":"listClosures","summary":"List a location's upcoming closures","description":"Closures a location observes — its own plus any business-wide ones. Negative time that subtracts from availability (a holiday, a one-off closed day). Only rows ending in the future, soonest first. Requires feature `location.view`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Closure"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"createClosure","summary":"Create a closure or holiday","description":"Adds negative time to a location. An **all-day** closure is a `date` (optionally through `endDate`, inclusive) in the location timezone; a **timed** closure passes explicit UTC `startsAt`/`endsAt` for a partial-day close. `annual: true` (all-day only) writes several years of rows sharing a `seriesId`. The response carries `affectedBookings` — active bookings the window would strand, which the console warns on. Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"annual":{"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Closure"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/closures/holiday-suggestions":{"get":{"operationId":"listHolidaySuggestions","summary":"US federal holidays for the location year","description":"A starter list for the closures editor — US federal holidays computed for the location's current year. Suggestions only; the operator accepts the ones the studio actually closes for. Requires feature `location.view`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/HolidaySuggestion"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/calendar-feeds":{"get":{"operationId":"listCalendarFeeds","summary":"List subscribe calendars for a location","description":"Operator calendar feeds for this location (studio, per-space, and the caller’s teaching diary). Returns panel context — whether there is anything to put on a calendar, whether the caller teaches here, and the spaces that can have their own feed. Teaching URLs are only returned to that person. See architecture/23-operator-calendars.md. Requires feature `location.view`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarFeedsPayload"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"createCalendarFeed","summary":"Create a subscribe calendar","description":"Mints a secret subscribe URL for this location. `studio` and `space` need location.manage. `teaching` is allowed when the signed-in person teaches here. The token is a password — anyone with the URL sees class names and times, not customer details. Requires feature `location.view`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/PersonIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["studio","space","teaching"]},"resourceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["kind"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarFeed"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/calendar-feeds/{feedId}/rotate":{"post":{"operationId":"rotateCalendarFeed","summary":"Replace a subscribe calendar link","description":"Issues a new token. The old URL 404s immediately. Add the calendar again in Google or Apple. Requires feature `location.view`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"path","name":"feedId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalendarFeedRotated"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{id}/calendar-feeds/{feedId}/revoke":{"post":{"operationId":"revokeCalendarFeed","summary":"Stop a subscribe calendar","description":"The link stops working. Google and Apple keep showing old classes until the owner removes the calendar there. Requires feature `location.view`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"path","name":"feedId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/closures/{closureId}":{"delete":{"operationId":"deleteClosure","summary":"Delete a closure","description":"Removes a closure. Deleting any row of an annual holiday removes the whole series. Does not cancel bookings that were already made — it only reopens availability. Requires feature `location.manage`.","tags":["location"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"in":"path","name":"closureId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/locations/{locationId}/resources":{"post":{"operationId":"createResource","summary":"Create a resource","description":"Creates a bookable resource (room, equipment, etc.) at a location. Capacity is an ordered list of positions; names are optional. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/LocationIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Resource"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440007","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","kind":"room","name":"Studio A","description":"Heated room with mirrors","capacity":20,"positionLayout":"list","availabilityScheduleId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":0,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":1,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":2,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":3,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":4,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":5,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":6,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":7,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":8,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":9,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":10,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":11,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":12,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":13,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":14,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":15,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":16,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":17,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":18,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":19,"name":null}]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listResources","summary":"List resources at a location","description":"Lists resources configured at a location, including their positions. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/LocationIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440007","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","kind":"room","name":"Studio A","description":"Heated room with mirrors","capacity":20,"positionLayout":"list","availabilityScheduleId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":0,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":1,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":2,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":3,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":4,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":5,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":6,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":7,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":8,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":9,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":10,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":11,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":12,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":13,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":14,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":15,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":16,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":17,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":18,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":19,"name":null}]}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/resources/{id}":{"get":{"operationId":"getResource","summary":"Get a resource","description":"Returns a resource by ID, including its positions. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Resource"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440007","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","kind":"room","name":"Studio A","description":"Heated room with mirrors","capacity":20,"positionLayout":"list","availabilityScheduleId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":0,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":1,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":2,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":3,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":4,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":5,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":6,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":7,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":8,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":9,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":10,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":11,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":12,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":13,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":14,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":15,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":16,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":17,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":18,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":19,"name":null}]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateResource","summary":"Update a resource","description":"Updates resource metadata, capacity, or optional position names and order. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Resource"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440007","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","kind":"room","name":"Studio A","description":"Heated room with mirrors","capacity":20,"positionLayout":"list","availabilityScheduleId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":0,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":1,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":2,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":3,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":4,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":5,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":6,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":7,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":8,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":9,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":10,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":11,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":12,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":13,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":14,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":15,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":16,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":17,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":18,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":19,"name":null}]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/resources/{id}/archive":{"post":{"operationId":"archiveResource","summary":"Archive a resource","description":"Soft-archives a resource. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Resource"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440007","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","kind":"room","name":"Studio A","description":"Heated room with mirrors","capacity":20,"positionLayout":"list","availabilityScheduleId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":0,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":1,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":2,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":3,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":4,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":5,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":6,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":7,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":8,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":9,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":10,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":11,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":12,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":13,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":14,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":15,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":16,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":17,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":18,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":19,"name":null}]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/instructor-profiles":{"post":{"operationId":"createInstructorProfile","summary":"Create an instructor profile","description":"Creates an instructor profile. Pass email (console) to find-or-create the person and grant the instructor role, or personId (API/MCP) for an existing person. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInstructorProfileBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InstructorProfile"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440008","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","bio":"RYT-200 yoga instructor","headshotUrl":"https://cdn.example.com/alex.jpg","specialties":["vinyasa","restorative"],"public":true,"availabilityScheduleId":null,"locationIds":["550e8400-e29b-41d4-a716-446655440003"],"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"alex@example.com","displayName":"Alex Rivera"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listInstructorProfiles","summary":"List instructor profiles","description":"Lists instructor profiles for a business (includes person name and email). Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InstructorProfile"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440008","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","bio":"RYT-200 yoga instructor","headshotUrl":"https://cdn.example.com/alex.jpg","specialties":["vinyasa","restorative"],"public":true,"availabilityScheduleId":null,"locationIds":["550e8400-e29b-41d4-a716-446655440003"],"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"alex@example.com","displayName":"Alex Rivera"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/instructor-profiles/{id}":{"get":{"operationId":"getInstructorProfile","summary":"Get an instructor profile","description":"Returns an instructor profile by ID (includes person name and email). Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/InstructorIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InstructorProfile"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440008","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","bio":"RYT-200 yoga instructor","headshotUrl":"https://cdn.example.com/alex.jpg","specialties":["vinyasa","restorative"],"public":true,"availabilityScheduleId":null,"locationIds":["550e8400-e29b-41d4-a716-446655440003"],"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"alex@example.com","displayName":"Alex Rivera"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateInstructorProfile","summary":"Update an instructor profile","description":"Updates instructor bio, headshot, or specialties. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/InstructorIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInstructorProfileBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InstructorProfile"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440008","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","bio":"RYT-200 yoga instructor","headshotUrl":"https://cdn.example.com/alex.jpg","specialties":["vinyasa","restorative"],"public":true,"availabilityScheduleId":null,"locationIds":["550e8400-e29b-41d4-a716-446655440003"],"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"alex@example.com","displayName":"Alex Rivera"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/instructor-profiles/{id}/archive":{"post":{"operationId":"archiveInstructorProfile","summary":"Archive an instructor profile","description":"Soft-archives an instructor profile. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/InstructorIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InstructorProfile"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440008","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","bio":"RYT-200 yoga instructor","headshotUrl":"https://cdn.example.com/alex.jpg","specialties":["vinyasa","restorative"],"public":true,"availabilityScheduleId":null,"locationIds":["550e8400-e29b-41d4-a716-446655440003"],"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"alex@example.com","displayName":"Alex Rivera"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/locations/{locationId}/offerings":{"post":{"operationId":"createOffering","summary":"Create a listing","description":"Creates a draft offering at a location. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/LocationIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListingBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listOfferings","summary":"List listings at a location","description":"Lists offerings at a location (all statuses). Optional `type` filter: class, session, or space. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/LocationIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Offering"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/locations/{locationId}/offerings/slug-availability":{"get":{"operationId":"checkOfferingSlugAvailability","summary":"Check whether a listing slug is available at a location","description":"Live uniqueness check for the console booking-link field. When taken, includes the next free suggestion (`-2`, `-3`, …). Pass `excludeOfferingId` when editing an existing offering. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/LocationIdParam"},{"in":"query","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"excludeOfferingId","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"available":{"type":"boolean"},"slug":{"type":"string"},"suggestion":{"type":"string"}},"required":["available","slug"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"available":true,"slug":"morning-flow"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/locations/{locationId}/offerings/order":{"patch":{"operationId":"reorderOfferings","summary":"Reorder offerings of one type","description":"Sets catalog display order for offerings of one type at a location. ids must match the live set exactly (classes exclude ended). Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/LocationIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["class","session","space"]},"ids":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["type","ids"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Offering"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}":{"get":{"operationId":"getOffering","summary":"Get a listing","description":"Returns an offering with schedules and images. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateOffering","summary":"Update a listing","description":"Updates offering pricing, capacity, or schedule links. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateListingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/overview":{"get":{"operationId":"getOfferingOverview","summary":"Get a listing tactical overview (derived aggregate)","description":"Get a listing tactical overview (derived aggregate) Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListingOverview"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/slug":{"patch":{"operationId":"updateOfferingSlug","summary":"Override a listing slug (unique per location)","description":"Override a listing slug (unique per location) Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/slug/revert":{"post":{"operationId":"revertOfferingSlug","summary":"Revert a listing slug to auto-generated from the current name","description":"Revert a listing slug to auto-generated from the current name Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/duplicate":{"post":{"operationId":"duplicateOffering","summary":"Copy a listing as a new draft","description":"Copies an offering — price, times, instructors, photos and rules — as a new draft. Schedules are cloned, so retiming the copy leaves the original alone. The booking link regenerates from the copy’s name. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/publish":{"post":{"operationId":"publishOffering","summary":"Show a listing for booking","description":"Shows an offering for booking (draft or hidden → bookable). Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/hide":{"post":{"operationId":"hideOffering","summary":"Hide a listing from booking","description":"Hides a bookable offering — stays in Admin, not bookable. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/archive":{"post":{"operationId":"archiveOffering","summary":"Archive a listing","description":"Soft-archives an offering (gone from Admin). Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Offering"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/availability":{"get":{"operationId":"getAvailability","summary":"Get projected availability slots","description":"Projects open occurrence slots for a location or offering in a date range.","tags":["availability"],"parameters":[{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"offeringId","schema":{"$ref":"#/components/schemas/Uuid"}},{"in":"query","name":"scheduleId","schema":{"$ref":"#/components/schemas/Uuid"}},{"in":"query","name":"resourceId","schema":{"$ref":"#/components/schemas/Uuid"}},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OccurrenceSlot"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","localStart":"2026-08-01T12:00:00","localEnd":"2026-08-01T13:00:00","timezone":"America/Denver","capacityTotal":20,"capacityRemaining":5,"capacityByStatus":{"held":0,"confirmed":5,"completed":0,"noShow":0},"status":"open","materialized":false}]}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/occurrence":{"get":{"operationId":"getOccurrence","summary":"Get a single occurrence slot","description":"Returns one projected occurrence slot with capacity state.","tags":["availability"],"parameters":[{"in":"query","name":"occurrenceId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"offeringId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OccurrenceSlot"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","localStart":"2026-08-01T12:00:00","localEnd":"2026-08-01T13:00:00","timezone":"America/Denver","capacityTotal":20,"capacityRemaining":5,"capacityByStatus":{"held":0,"confirmed":5,"completed":0,"noShow":0},"status":"open","materialized":false}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/occurrences/materialize":{"post":{"operationId":"materializeOccurrence","summary":"Materialize a booked session for an occurrence","description":"Creates a booked session row for an occurrence when capacity is reserved.","tags":["availability"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaterializeOccurrenceBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Occurrence"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","offeringId":"550e8400-e29b-41d4-a716-446655440004","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","timezone":"America/Los_Angeles","capacityOverride":null,"resourceId":null,"instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"status":"scheduled","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/locations/{locationId}/is-open":{"get":{"operationId":"isLocationOpen","summary":"Check whether a location is currently open","description":"Checks whether a location is open right now per its hours schedule.","tags":["availability"],"parameters":[{"$ref":"#/components/parameters/LocationIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IsLocationOpenResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"open":true,"reason":null}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/bookings/{bookingId}/timeline":{"get":{"operationId":"getBookingTimeline","summary":"Get booking event timeline","description":"Returns chronological domain events and pending tasks for a booking. Requires feature `booking.view`.","tags":["booking"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TimelineItem"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"kind":"event","id":"550e8400-e29b-41d4-a716-446655440020","type":"booking.created","at":"2026-07-24T12:00:00.000Z","event":{"id":"550e8400-e29b-41d4-a716-446655440020","type":"booking.created","occurredAt":"2026-07-24T12:00:00.000Z","businessId":"550e8400-e29b-41d4-a716-446655440002","subject":{"type":"booking","id":"550e8400-e29b-41d4-a716-446655440005"},"actor":{"type":"customer","id":"550e8400-e29b-41d4-a716-446655440001"},"data":{"partySize":1}}}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/team":{"get":{"operationId":"listTeam","summary":"List team members","description":"Lists team members with roles and person profiles. Requires feature `team.view`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"userRole":{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null},"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"instructorProfile":null}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"createTeamMember","summary":"Add a team member","description":"Add a team member Requires feature `team.manage`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddTeamMemberBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TeamMember"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/user-roles":{"get":{"operationId":"listUserRoles","summary":"List user roles for a business","description":"Lists raw user-role grants for a business. Requires feature `team.view`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserRole"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"grantUserRole","summary":"Grant a user role","description":"Grants roles and optional feature overrides to a person. Requires feature `team.manage`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUserRoleBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserRole"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/features":{"get":{"operationId":"listBusinessFeatures","summary":"List enabled business features","description":"Lists enabled features and effective access for the caller. Requires feature `business.view`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EffectiveAccess"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"businessEnabled":["booking.view","booking.manage"],"userGranted":["booking.manage"],"effective":["booking.view","booking.manage"]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"setBusinessFeatures","summary":"Set enabled business features","description":"Replaces the enabled feature set for a business. Requires feature `business.manage`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetBusinessFeaturesBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EffectiveAccess"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"businessEnabled":["booking.view","booking.manage"],"userGranted":["booking.manage"],"effective":["booking.view","booking.manage"]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/user-roles/{id}":{"patch":{"operationId":"updateUserRole","summary":"Update a user role","description":"Updates roles or feature overrides on an existing grant. Requires feature `team.manage`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/UserRoleIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserRole"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/user-roles/{id}/archive":{"post":{"operationId":"archiveUserRole","summary":"Archive a user role","description":"Soft-archives a user-role grant. Requires feature `team.manage`.","tags":["access"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/UserRoleIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserRole"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/waitlist/join":{"post":{"operationId":"joinWaitlist","summary":"Join a session waitlist","description":"Adds a customer to the waitlist for a full session. Requires feature `booking.manage`.","tags":["waitlist"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinWaitlistBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WaitlistEntry"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440016","businessId":"550e8400-e29b-41d4-a716-446655440002","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","offeringId":"550e8400-e29b-41d4-a716-446655440004","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1,"status":"waiting","offeredBookingId":null,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/waitlist/{entryId}":{"get":{"operationId":"getWaitlistEntry","summary":"Get a waitlist entry","description":"Returns a waitlist entry and offer status. Requires feature `booking.view`.","tags":["waitlist"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/EntryIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WaitlistEntry"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440016","businessId":"550e8400-e29b-41d4-a716-446655440002","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","offeringId":"550e8400-e29b-41d4-a716-446655440004","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1,"status":"waiting","offeredBookingId":null,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/occurrences/{occurrenceId}/waitlist":{"get":{"operationId":"listWaitlistByOccurrence","summary":"List waitlist entries for a session","description":"Lists waitlist queue for a session ordered by join time. Requires feature `booking.view`.","tags":["waitlist"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/OccurrenceIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WaitlistEntry"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440016","businessId":"550e8400-e29b-41d4-a716-446655440002","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","offeringId":"550e8400-e29b-41d4-a716-446655440004","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1,"status":"waiting","offeredBookingId":null,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/occurrences/{occurrenceId}/waitlist/process-expired":{"post":{"operationId":"processExpiredWaitlistOffers","summary":"Process expired waitlist offers","description":"Expires stale offers and promotes the next waiting party. Requires feature `booking.manage`.","tags":["waitlist"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/OccurrenceIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProcessExpiredWaitlistResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"processed":2,"promoted":1}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/profile":{"get":{"operationId":"getMyProfile","summary":"Get my profile","description":"Returns the signed-in person profile.","tags":["me"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateMyProfile","summary":"Update my profile","description":"Updates the signed-in person profile fields.","tags":["me"],"security":[{"sessionBearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePersonBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Person"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/customers":{"get":{"operationId":"listMyCustomers","summary":"List my customer relationships","description":"Lists businesses where the signed-in person is a customer.","tags":["me"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MeCustomerRelationship"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"},"business":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}]}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/marketing-consents":{"get":{"operationId":"listMyMarketingConsents","summary":"List my marketing email preferences","description":"One row per Customer relationship. globallySuppressed is the platform-wide hard suppress (build-plan/108).","tags":["me"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"globallySuppressed":{"type":"boolean"},"consents":{"type":"array","items":{"type":"object","properties":{"businessId":{"$ref":"#/components/schemas/Uuid"},"businessName":{"type":"string"},"marketingConsent":{"type":"boolean"}},"required":["businessId","businessName","marketingConsent"],"additionalProperties":false}}},"required":["globallySuppressed","consents"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"globallySuppressed":false,"consents":[{"businessId":"550e8400-e29b-41d4-a716-446655440002","businessName":"Riverbend Pottery","marketingConsent":true}]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/marketing-consents/{businessId}":{"patch":{"operationId":"updateMyMarketingConsent","summary":"Update marketing email preference for one business","description":"Opting on clears a prior global suppress. Source: preferences (build-plan/108).","tags":["me"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"marketingConsent":{"type":"boolean"}},"required":["marketingConsent"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"businessId":{"$ref":"#/components/schemas/Uuid"},"businessName":{"type":"string"},"marketingConsent":{"type":"boolean"},"globallySuppressed":{"type":"boolean"}},"required":["businessId","businessName","marketingConsent","globallySuppressed"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"businessId":"550e8400-e29b-41d4-a716-446655440002","businessName":"Riverbend Pottery","marketingConsent":true,"globallySuppressed":false}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/bookings":{"get":{"operationId":"listMyBookings","summary":"List my bookings","description":"Lists upcoming and past bookings for the signed-in person. Optional `businessId` filters to one studio; `limit` caps history (default 20) while upcoming stays unbounded.","tags":["me"],"security":[{"sessionBearer":[]}],"parameters":[{"in":"query","name":"businessId","schema":{"$ref":"#/components/schemas/Uuid"}},{"in":"query","name":"limit","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeBookingsResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"upcoming":[{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[],"businessName":"Sunrise Studio","locationName":"Downtown Studio","locationTimezone":"America/Denver","offeringName":"Morning Flow","listingSlug":"morning-flow","occurrenceStartsAt":"2026-08-01T18:00:00.000Z","occurrenceEndsAt":"2026-08-01T19:00:00.000Z"}],"past":[],"pastHasMore":false}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/memberships":{"get":{"operationId":"listMyMemberships","summary":"List my memberships","description":"Lists active memberships across businesses for the signed-in person.","tags":["me"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MeMembershipsResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"memberships":[{"id":"550e8400-e29b-41d4-a716-446655440011","businessId":"550e8400-e29b-41d4-a716-446655440002","businessName":"Sunrise Studio","customerId":"550e8400-e29b-41d4-a716-446655440006","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","planName":"Unlimited Monthly","billingPeriod":"monthly","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","creditsRemaining":500,"benefits":[{"type":"credit","config":{"amount":10,"period":"monthly","scope":"all","rollover":false}}]}]}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me":{"delete":{"operationId":"deleteMyAccount","summary":"Delete my account and owned businesses","description":"Owner-only hard delete of the signed-in person and every business they own (architecture/01 § Account deletion). Session auth only — API keys cannot call this. Staff receive 403. On success the session is already gone; the client must forget its token.","tags":["me"],"security":[{"sessionBearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteAccountResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/bookings/{bookingId}/cancel":{"post":{"operationId":"cancelMyBooking","summary":"Cancel my booking","description":"Customer self-service cancellation within policy windows.","tags":["me"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/me/bookings/{bookingId}/reschedule":{"post":{"operationId":"rescheduleMyBooking","summary":"Reschedule my booking","description":"Customer self-service reschedule to another open occurrence.","tags":["me"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescheduleBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/slugs/{slug}":{"get":{"operationId":"resolveStorefrontSlug","summary":"Resolve a root public slug to a business or location","description":"Resolve a root public slug to a business or location","tags":["storefront"],"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"business"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"type":"null"}},"required":["type","businessId","locationId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"location"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"}},"required":["type","businessId","locationId"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/slugs/{locationSlug}/{listingSlug}":{"get":{"operationId":"resolveStorefrontListingSlug","summary":"Resolve a location + listing public slug pair","description":"Resolve a location + listing public slug pair","tags":["storefront"],"parameters":[{"in":"path","name":"locationSlug","schema":{"type":"string"},"required":true},{"in":"path","name":"listingSlug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"}},"required":["offeringId"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/businesses/{businessId}":{"get":{"operationId":"getStorefrontBusiness","summary":"Get public business profile","description":"Public business profile with location summaries for embed.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontBusinessProfile"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","locations":[{"id":"550e8400-e29b-41d4-a716-446655440003","name":"Downtown Studio","slug":"sunrise-studio","address":"123 Main St, Denver, CO","timezone":"America/Denver"}]}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/locations/{locationId}":{"get":{"operationId":"getStorefrontLocation","summary":"Get public location profile","description":"Public location profile with hours for embed.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/LocationIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontLocationProfile"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"timezone":"America/Denver","hours":{"timezone":"America/Denver","schedule":{"name":"Regular hours","rrule":"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR","timezone":"America/Denver"}}}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/locations/{locationId}/offerings":{"get":{"operationId":"listStorefrontListings","summary":"List public listings at a location","description":"Cursor-paginated published offerings at a location.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/LocationIdParam"},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontPaginatedListings"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"items":[{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Morning Flow","slug":"morning-flow","description":"All-levels vinyasa","type":"class","priceAmount":3000,"priceCurrency":"USD","image":{"url":"https://cdn.example.com/class.jpg","sortOrder":0,"altText":null}}],"nextCursor":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/offerings/{id}":{"get":{"operationId":"getStorefrontListing","summary":"Get public listing detail","description":"Public offering detail with schedules and team members.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontListingDetail"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440004","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","name":"Morning Flow","slug":"morning-flow","description":"All-levels vinyasa","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"images":[{"url":"https://cdn.example.com/class.jpg","sortOrder":0,"altText":null}],"schedules":[{"id":"550e8400-e29b-41d4-a716-446655440014","name":"Weekday mornings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR","durationMinutes":60}],"instructors":[{"id":"550e8400-e29b-41d4-a716-446655440008","bio":"RYT-200","headshotUrl":null,"specialties":["vinyasa"]}]}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/offerings/{id}/availability":{"get":{"operationId":"getStorefrontListingAvailability","summary":"Get public listing availability","description":"Public availability slots for an offering.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontAvailability"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","locationId":"550e8400-e29b-41d4-a716-446655440003","slots":[{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","localStart":"2026-08-01T12:00:00","localEnd":"2026-08-01T13:00:00","timezone":"America/Denver","capacityTotal":20,"capacityRemaining":5,"capacityByStatus":{"held":0,"confirmed":5,"completed":0,"noShow":0},"status":"open","materialized":false}]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/offerings/{id}/quote":{"post":{"operationId":"quoteStorefrontListing","summary":"Quote a public listing","description":"Public price quote with live capacity check.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorefrontQuoteBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontQuoteResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"quote":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"availability":{"available":true,"capacityRemaining":5,"status":"open"}}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/offerings/{id}/waitlist":{"post":{"operationId":"joinStorefrontWaitlist","summary":"Join a full session's waitlist","description":"Customer-facing waitlist join. Guest email or a signed-in session; idempotent per customer per session. Rejected when the session still has room (\"book directly\"). When a seat frees, the front of the line receives a real held booking and an emailed pay link.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorefrontWaitlistJoinBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontWaitlistJoinResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts":{"post":{"operationId":"createCart","summary":"Create a cart","description":"Opens a cart and returns its token. Pass an `item` to add the first booking in the same call — \"book now\" is a one-item cart.","tags":["storefront"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCartBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}":{"get":{"operationId":"getCart","summary":"Get a cart by token","description":"Items with live per-item state (`held` / `available` / `unavailable` / `confirmed`) and derived totals. A checked-out cart renders as a receipt.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}/answer-suggestions":{"get":{"operationId":"getCartAnswerSuggestions","summary":"Remembered answers for this cart","description":"What the signed-in customer answered these same questions before, offered back so a returning customer taps instead of retypes. Scoped to the caller's own history with this business — the cart token alone does not read it, so an operator pay-link opened by someone else returns nothing. Values a question no longer accepts (a since-removed option) are filtered out; empty for guests, receipts, and carts with no questions.","tags":["storefront"],"security":[{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AnswerSuggestions"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}/items":{"post":{"operationId":"addCartItem","summary":"Add an item to a cart","description":"Creates a held booking on a 10-minute TTL and attaches it to the cart.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartItemBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}/items/{itemId}":{"delete":{"operationId":"removeCartItem","summary":"Remove an item from a cart","description":"Cancels the held booking, releasing its capacity.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"},{"$ref":"#/components/parameters/CartItemIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}/cancel":{"post":{"operationId":"cancelStorefrontCart","summary":"Cancel a cart","description":"Revokes the cart by token: remaining held bookings are canceled and the cart becomes `canceled`. Possession of the token is authorization.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}/holds":{"post":{"operationId":"refreshCartHolds","summary":"Extend or re-acquire cart holds","description":"Refreshes every held booking in an open cart under the standard capacity guard — the same re-acquire checkout uses. Sold-out items are skipped; the response carries live per-item state.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Cart"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/carts/{token}/checkout":{"post":{"operationId":"checkoutCart","summary":"Check out a cart","description":"One charge for the sum of what is due now on one connected account. Every hold is re-acquired first; if any item has sold out the call fails with `item_unavailable` and nothing is charged. Guests check out with a bare `email` in the body — no verification; a signed-in member sends a session bearer instead and their items re-quote at member pricing, downward only. An unverified email never unlocks member pricing, credits, or account data.","tags":["storefront"],"security":[{},{"sessionBearer":[]}],"parameters":[{"$ref":"#/components/parameters/CartTokenParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutCartBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckoutResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/bookings/{bookingId}":{"get":{"operationId":"getStorefrontBooking","summary":"Get a booking by manage-link id","description":"Possession of the booking uuid authorizes this read. Returns the customer-facing view (masked email, money, policy). Unknown and malformed ids both 404 identically.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ManageBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","reference":"BK-550E8400","status":"confirmed","listing":{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Vinyasa Flow","slug":"vinyasa-flow","type":"class","capacity":12,"bookingHorizonDays":28,"confirmationMessage":"Bring a mat."},"when":{"startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","timezone":"America/Denver","dayLabel":"Sat, Aug 1, 2026","timeRangeLabel":"12:00 PM – 1:00 PM","timezoneLabel":"America/Denver"},"location":{"name":"Main Hall","slug":"main-hall","address":"9 Link St","lat":null,"lng":null,"timezone":"America/Denver","contactEmail":"hello@example.com","contactPhone":null},"business":{"name":"Sunrise Studio","slug":"sunrise-studio","contactEmail":"hello@example.com"},"party":{"size":1,"customerName":"Alex Rivera","customerEmailMasked":"a•••@example.com"},"money":{"currency":"USD","amountTotal":4500,"amountPaid":4500,"amountDue":0,"amountTotalLabel":"$45.00","amountPaidLabel":"$45.00","amountDueLabel":"$0.00","refundExpected":true,"refundLabel":"$45.00","balanceCollectAtLabel":null},"policy":{"canCancelOnline":true,"canRescheduleOnline":true,"refundExpected":true,"changesCloseAt":"2026-07-31T18:00:00.000Z","changesCloseAtLabel":"Fri, Jul 31, 2026, 12:00 PM","closedReason":null},"answers":[],"cartHref":null,"locale":"en-US","dateFormat":"MDY"}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/bookings/{bookingId}/availability":{"get":{"operationId":"getStorefrontBookingAvailability","summary":"Availability for rescheduling a booking","description":"Open slots for the same listing that can hold the booking's party size. The current occurrence is omitted. Closed by policy → `reschedule_closed`.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/BookingIdParam"},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorefrontAvailability"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","locationId":"550e8400-e29b-41d4-a716-446655440003","slots":[{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","localStart":"2026-08-01T12:00:00","localEnd":"2026-08-01T13:00:00","timezone":"America/Denver","capacityTotal":20,"capacityRemaining":5,"capacityByStatus":{"held":0,"confirmed":5,"completed":0,"noShow":0},"status":"open","materialized":false}]}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/bookings/{bookingId}/cancel":{"post":{"operationId":"cancelStorefrontBooking","summary":"Cancel a booking via manage link","description":"Cancels when policy allows. Reason is `customer_cancel` in-window or `customer_late_cancel` after the cutoff. Refunds follow the listing cutoff (late cancels do not auto-refund). Actor on the event is `customer`.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/BookingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ManageBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","reference":"BK-550E8400","status":"confirmed","listing":{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Vinyasa Flow","slug":"vinyasa-flow","type":"class","capacity":12,"bookingHorizonDays":28,"confirmationMessage":"Bring a mat."},"when":{"startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","timezone":"America/Denver","dayLabel":"Sat, Aug 1, 2026","timeRangeLabel":"12:00 PM – 1:00 PM","timezoneLabel":"America/Denver"},"location":{"name":"Main Hall","slug":"main-hall","address":"9 Link St","lat":null,"lng":null,"timezone":"America/Denver","contactEmail":"hello@example.com","contactPhone":null},"business":{"name":"Sunrise Studio","slug":"sunrise-studio","contactEmail":"hello@example.com"},"party":{"size":1,"customerName":"Alex Rivera","customerEmailMasked":"a•••@example.com"},"money":{"currency":"USD","amountTotal":4500,"amountPaid":4500,"amountDue":0,"amountTotalLabel":"$45.00","amountPaidLabel":"$45.00","amountDueLabel":"$0.00","refundExpected":true,"refundLabel":"$45.00","balanceCollectAtLabel":null},"policy":{"canCancelOnline":true,"canRescheduleOnline":true,"refundExpected":true,"changesCloseAt":"2026-07-31T18:00:00.000Z","changesCloseAtLabel":"Fri, Jul 31, 2026, 12:00 PM","closedReason":null},"answers":[],"cartHref":null,"locale":"en-US","dateFormat":"MDY"}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/bookings/{bookingId}/reschedule":{"post":{"operationId":"rescheduleStorefrontBooking","summary":"Reschedule a booking via manage link","description":"Moves the booking to another open occurrence of the same listing, same party size. Past cutoff → `reschedule_closed`; lost the capacity race → `slot_unavailable`.","tags":["storefront"],"parameters":[{"$ref":"#/components/parameters/BookingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorefrontRescheduleBookingBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ManageBooking"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440005","reference":"BK-550E8400","status":"confirmed","listing":{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Vinyasa Flow","slug":"vinyasa-flow","type":"class","capacity":12,"bookingHorizonDays":28,"confirmationMessage":"Bring a mat."},"when":{"startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","timezone":"America/Denver","dayLabel":"Sat, Aug 1, 2026","timeRangeLabel":"12:00 PM – 1:00 PM","timezoneLabel":"America/Denver"},"location":{"name":"Main Hall","slug":"main-hall","address":"9 Link St","lat":null,"lng":null,"timezone":"America/Denver","contactEmail":"hello@example.com","contactPhone":null},"business":{"name":"Sunrise Studio","slug":"sunrise-studio","contactEmail":"hello@example.com"},"party":{"size":1,"customerName":"Alex Rivera","customerEmailMasked":"a•••@example.com"},"money":{"currency":"USD","amountTotal":4500,"amountPaid":4500,"amountDue":0,"amountTotalLabel":"$45.00","amountPaidLabel":"$45.00","amountDueLabel":"$0.00","refundExpected":true,"refundLabel":"$45.00","balanceCollectAtLabel":null},"policy":{"canCancelOnline":true,"canRescheduleOnline":true,"refundExpected":true,"changesCloseAt":"2026-07-31T18:00:00.000Z","changesCloseAtLabel":"Fri, Jul 31, 2026, 12:00 PM","closedReason":null},"answers":[],"cartHref":null,"locale":"en-US","dateFormat":"MDY"}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/membership-plans/{planId}/checkout":{"post":{"operationId":"checkoutStorefrontMembershipPlan","summary":"Buy a membership plan","description":"Buy a published plan. A guest supplies a bare `email`; a signed-in member sends a session bearer instead. Recurring plans return a Stripe Checkout URL (`checkoutUrl`); free plans create the membership immediately and return its `manageUrl`. Paid one-time packs are sold at the desk and rejected here.","tags":["storefront"],"security":[{},{"sessionBearer":[]}],"parameters":[{"in":"path","name":"planId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"checkoutUrl":{"type":"string","format":"uri"},"manageUrl":{"type":"string","format":"uri"},"membershipId":{"$ref":"#/components/schemas/Uuid"}},"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/storefront/memberships/{membershipId}/portal":{"post":{"operationId":"openStorefrontMembershipPortal","summary":"Open a membership billing portal","description":"Mints a Stripe Billing Portal session for the membership. Possession of the membership uuid is authorization (same model as the manage-booking link). Unknown and malformed ids both 404 identically.","tags":["storefront"],"parameters":[{"in":"path","name":"membershipId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/questions":{"get":{"operationId":"listQuestions","summary":"List the checkout-question catalog","description":"Active (non-archived) questions for the business. Assignment to listings happens via `questionIds` on listing create/update; customers answer once per cart at checkout.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Question"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"createQuestion","summary":"Create a checkout question","description":"Adds to the business catalog. Choice types need unique options (radio/select ≥ 2, checkboxes ≥ 1); text questions take none. No branching or conditional logic — a question that must behave differently is a second question.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuestionBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Question"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/questions/{questionId}":{"patch":{"operationId":"updateQuestion","summary":"Update a checkout question","description":"Prompt, help text, options, and required are editable; the type is immutable (make a new question instead). Existing booking answers keep their snapshotted prompt — edits never rewrite what a customer was asked.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"path","name":"questionId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuestionBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Question"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/questions/{questionId}/archive":{"post":{"operationId":"archiveQuestion","summary":"Archive a checkout question","description":"Soft-archive: the question stops being asked everywhere it is assigned; answers already given stand.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"path","name":"questionId","schema":{"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Question"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/question-library":{"get":{"operationId":"listQuestionLibrary","summary":"Search the platform question library","description":"Starter checkout questions grouped by category. Filter with `q` (prompt, help text, keywords) and `category`. Copy-on-add via `POST /businesses/{businessId}/questions/from-library`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"in":"query","name":"q","schema":{"type":"string"}},{"in":"query","name":"category","schema":{"type":"string","enum":["contact","event","honoree","safety","logistics","marketing","notes"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QuestionLibrarySearchResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/questions/from-library":{"post":{"operationId":"addQuestionsFromLibrary","summary":"Add questions from the platform library","description":"Copies library entries into the business catalog. Skips prompts that already exist. Optionally appends new questions to an offering via `offeringId`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddQuestionsFromLibraryBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AddQuestionsFromLibraryResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/images":{"post":{"operationId":"uploadOfferingImage","summary":"Upload a listing image","description":"Uploads an offering photo; re-encodes to WebP variants and returns URLs. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadImageBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listOfferingImages","summary":"List listing images","description":"Lists images for an offering in sort order. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/resources/{id}/images":{"post":{"operationId":"uploadResourceImage","summary":"Upload a resource image","description":"Uploads a resource/space photo; re-encodes to WebP variants and returns URLs. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadImageBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listResourceImages","summary":"List resource images","description":"Lists images for a resource in sort order. Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/instructor-profiles/{id}/images":{"post":{"operationId":"uploadInstructorImage","summary":"Upload an instructor headshot","description":"Uploads an instructor headshot (one per profile) and mirrors the md URL onto headshot_url. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/InstructorIdParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadImageBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listInstructorImages","summary":"List instructor headshot images","description":"Lists the instructor headshot (at most one). Requires feature `location.view`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/InstructorIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/membership-plans/{id}/images":{"post":{"operationId":"uploadMembershipPlanImage","summary":"Upload a membership plan photo","description":"Uploads a membership plan cover photo (one per plan). Requires feature `business.manage`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/MembershipPlanIdParam"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadImageBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Image"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listMembershipPlanImages","summary":"List membership plan photos","description":"Lists the membership plan cover photo (at most one). Requires feature `business.view`.","tags":["membership"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/MembershipPlanIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/resources/{id}/images/order":{"patch":{"operationId":"reorderResourceImages","summary":"Reorder resource images","description":"Sets the display order of resource images to the given id list. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderImagesBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/offerings/{id}/images/order":{"patch":{"operationId":"reorderOfferingImages","summary":"Reorder listing images","description":"Sets the display order of offering images to the given id list. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ListingIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderImagesBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Image"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/images/{id}":{"delete":{"operationId":"deleteImage","summary":"Delete an image","description":"Detaches a photo from its owner. The library asset and stored bytes remain. Requires feature `location.manage`.","tags":["catalog"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ImageIdParam"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/site-preview":{"post":{"operationId":"previewSite","summary":"Read one page of a website to pre-fill signup","description":"Reads a single page and answers the questions signup would otherwise ask: name, description, business type, address, contact details, the venue timezone implied by the address, and the product modules the page suggests. Nothing is written and no import run is created. Every field can be null — a site that cannot be read returns an empty preview rather than an error, so signup is never blocked. Session-scoped rather than business-scoped, because this runs before a business exists.","tags":["business"],"security":[{"sessionBearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitePreviewBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SitePreview"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/imports":{"post":{"operationId":"createImport","summary":"Start a website or PlaceFull import","description":"Starts a website or PlaceFull import run and enqueues the worker. 409 if a live run already exists. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImportBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportRun"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict (`conflict`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listImports","summary":"List import runs for a business","description":"Lists import runs for the business, newest first. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ImportRun"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/imports/{importId}":{"get":{"operationId":"getImport","summary":"Get one import run","description":"Returns one import run including snapshot, proposal, and apply receipt. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/ImportIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportRun"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/imports/{importId}/apply":{"post":{"operationId":"applyImport","summary":"Apply selected import proposal items","description":"Writes the operator’s selected proposal items through the existing create services and publishes what catalog rules allow. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/ImportIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyImportBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportApplyResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict (`conflict`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/imports/{importId}/discard":{"post":{"operationId":"discardImport","summary":"Discard an import run","description":"Marks a ready or failed run discarded, or archives entities a completed run created. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/ImportIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ImportRun"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict (`conflict`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/import-links":{"get":{"operationId":"listImportLinks","summary":"List import provenance links","description":"Lists provenance links from applied imports to catalog rows. Requires feature `business.manage`.","tags":["business"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ImportLink"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/places/autocomplete":{"post":{"operationId":"placesAutocomplete","summary":"Autocomplete an address","description":"Server-side proxy for the Google Places autocomplete API: the key never ships to the browser. Returns trimmed suggestions (`placeId`, primary/secondary text). An empty `query` — or a missing Places key in the environment — returns an empty list so the form can fall back to free text.","tags":["system"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceAutocompleteBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlaceAutocompleteResponse"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/places/details":{"post":{"operationId":"placesDetails","summary":"Resolve a place to an address and coordinates","description":"Server-side proxy for the Google Places details API, completing an autocomplete selection. Returns the formatted address, coordinates, and jurisdiction components, or all-null fields when the Places key is unset — the caller treats that as \"keep the free-text address\".","tags":["system"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceDetailsBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlaceDetailsResponse"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/places/resolve":{"post":{"operationId":"placesResolve","summary":"Qualify a free-text address","description":"Text Search for an address that was typed, pasted, or scraped rather than picked from autocomplete. Returns the same shape as details, or all-null fields when Places cannot resolve the string.","tags":["system"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceResolveBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PlaceDetailsResponse"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limited (`too_many_requests`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/reports/money":{"get":{"operationId":"getMoneyReport","summary":"Money report for a period","description":"Cash-basis money statement for a period: collected, refunds, tax, fees, and take-home, plus payouts when Stripe is connected. Requires feature `finance.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"preset","schema":{"type":"string","enum":["last_month","this_month","last_quarter","this_quarter","last_year","this_year"]}},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"timezone":{"type":"string"},"basis":{"type":"string","const":"cash"}},"required":["from","to","timezone","basis"],"additionalProperties":false},"blocks":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deduction":{"type":"boolean"},"subtotal":{"type":"boolean"},"group":{"type":"string","enum":["sales","bank"]},"hint":{"type":"string"},"linkTarget":{"type":"object","properties":{"panel":{"type":"string","enum":["payouts","transactions"]},"payoutId":{"type":"string"}},"required":["panel"],"additionalProperties":false}},"required":["key","label","amount"],"additionalProperties":false}},"takeHome":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"youKeep":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"charged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"slices":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["you_keep","sales_tax","stripe_fees","booking_fees"]},"label":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"number"}},"required":["key","label","amount","share"],"additionalProperties":false}}},"required":["total","youKeep","charged","slices"],"additionalProperties":false},"payouts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"paidAt":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"transactionCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"linkTarget":{"type":"object","properties":{"panel":{"type":"string","enum":["payouts","transactions"]},"payoutId":{"type":"string"}},"required":["panel"],"additionalProperties":false},"transactionsPayoutId":{"type":"string"}},"required":["id","paidAt","amount","transactionCount"],"additionalProperties":false}},"payoutDetailAvailable":{"type":"boolean"},"payoutDetailNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeProcessingFees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unmatchedStripe":{"anyOf":[{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","net","fees"],"additionalProperties":false},{"type":"null"}]}},"required":["currency","lines","takeHome","payouts","payoutDetailAvailable","payoutDetailNote","stripeProcessingFees","unmatchedStripe"],"additionalProperties":false}},"stripeConnected":{"type":"boolean"}},"required":["period","blocks","stripeConnected"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/reports/tax":{"get":{"operationId":"getTaxReport","summary":"Tax report for a period","description":"Cash-basis tax collected and refunded in a period, grouped by configured tax rate. Requires feature `finance.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"preset","schema":{"type":"string","enum":["last_month","this_month","last_quarter","this_quarter","last_year","this_year"]}},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"timezone":{"type":"string"},"basis":{"type":"string","const":"cash"}},"required":["from","to","timezone","basis"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"taxRateId":{"type":"string"},"name":{"type":"string"},"ratePercent":{"type":"number"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxableSales":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxCollected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxRefunded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netTax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["taxRateId","name","ratePercent","jurisdiction","registrationNumber","taxableSales","taxCollected","taxRefunded","netTax"],"additionalProperties":false}},"totalNetTax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"}},"required":["period","rows","totalNetTax","currency"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/reports/transactions":{"get":{"operationId":"getTransactionsReport","summary":"Transaction lines for a period","description":"Paginated cash-basis ledger lines for a period. Optional `paymentIds` restricts to those payments (payout drill-down). Requires feature `finance.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"preset","schema":{"type":"string","enum":["last_month","this_month","last_quarter","this_quarter","last_year","this_year"]}},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"paymentIds","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"timezone":{"type":"string"},"basis":{"type":"string","const":"cash"}},"required":["from","to","timezone","basis"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"localDate":{"type":"string"},"kind":{"type":"string"},"source":{"type":"string"},"customerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cardLast4":{"anyOf":[{"type":"string"},{"type":"null"}]},"bookingReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"listingName":{"anyOf":[{"type":"string"},{"type":"null"}]},"offeringType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessionDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"gross":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingFee":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bookingId":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripePaymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurredAt","localDate","kind","source","customerName","customerId","cardLast4","bookingReference","listingName","offeringType","sessionDate","gross","tax","bookingFee","currency","locationName","paymentId","bookingId","stripePaymentId","memo"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeConnected":{"type":"boolean"},"unmatchedStripe":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"localDate":{"type":"string"},"type":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fee":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"stripePaymentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurredAt","localDate","type","amount","fee","net","currency","stripePaymentId"],"additionalProperties":false}}},"required":["period","rows","nextCursor","stripeConnected","unmatchedStripe"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/reports/transactions/export":{"get":{"operationId":"exportTransactionsCsv","summary":"Export transaction lines as CSV","description":"Same transaction lines as the report, as a CSV download. Requires feature `finance.export`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"preset","schema":{"type":"string","enum":["last_month","this_month","last_quarter","this_quarter","last_year","this_year"]}},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"CSV file contents","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/reports/payouts/{payoutId}/transactions":{"get":{"operationId":"getPayoutTransactions","summary":"Transaction lines for one Stripe payout","description":"Transaction lines that settled in one Stripe payout. `payoutId` is the Stripe payout id (`po_…`). Requires feature `finance.view`.","tags":["commerce"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"$ref":"#/components/parameters/PayoutIdParam"},{"in":"query","name":"from","schema":{"type":"string"}},{"in":"query","name":"to","schema":{"type":"string"}},{"in":"query","name":"preset","schema":{"type":"string","enum":["last_month","this_month","last_quarter","this_quarter","last_year","this_year"]}},{"in":"query","name":"locationId","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"timezone":{"type":"string"},"basis":{"type":"string","const":"cash"}},"required":["from","to","timezone","basis"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"localDate":{"type":"string"},"kind":{"type":"string"},"source":{"type":"string"},"customerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cardLast4":{"anyOf":[{"type":"string"},{"type":"null"}]},"bookingReference":{"anyOf":[{"type":"string"},{"type":"null"}]},"listingName":{"anyOf":[{"type":"string"},{"type":"null"}]},"offeringType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessionDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"gross":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingFee":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bookingId":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripePaymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"memo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurredAt","localDate","kind","source","customerName","customerId","cardLast4","bookingReference","listingName","offeringType","sessionDate","gross","tax","bookingFee","currency","locationName","paymentId","bookingId","stripePaymentId","memo"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeConnected":{"type":"boolean"},"unmatchedStripe":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"localDate":{"type":"string"},"type":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fee":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"stripePaymentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","occurredAt","localDate","type","amount","fee","net","currency","stripePaymentId"],"additionalProperties":false}}},"required":["period","rows","nextCursor","stripeConnected","unmatchedStripe"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/businesses/{businessId}/schedules":{"post":{"operationId":"createSchedule","summary":"Create a schedule","description":"Creates a recurring schedule with structured or raw RRULE input. Requires feature `location.manage`.","tags":["availability"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Schedule"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","name":"Tuesday evenings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=TU;BYHOUR=18;BYMINUTE=0","startDate":"2026-01-06","until":null,"durationMinutes":90,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"operationId":"listSchedules","summary":"List schedules for a business","description":"Lists schedules for a business, optionally filtered by location. Requires feature `location.view`.","tags":["availability"],"parameters":[{"$ref":"#/components/parameters/BusinessIdParam"},{"in":"query","name":"locationId","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":[{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","name":"Tuesday evenings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=TU;BYHOUR=18;BYMINUTE=0","startDate":"2026-01-06","until":null,"durationMinutes":90,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}]}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/schedules/{id}":{"get":{"operationId":"getSchedule","summary":"Get a schedule","description":"Returns a schedule by ID. Requires feature `location.view`.","tags":["availability"],"parameters":[{"$ref":"#/components/parameters/ScheduleIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Schedule"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","name":"Tuesday evenings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=TU;BYHOUR=18;BYMINUTE=0","startDate":"2026-01-06","until":null,"durationMinutes":90,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"updateSchedule","summary":"Update a schedule","description":"Updates schedule recurrence, timezone, or duration. Requires feature `location.manage`.","tags":["availability"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ScheduleIdParam"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduleBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Schedule"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","name":"Tuesday evenings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=TU;BYHOUR=18;BYMINUTE=0","startDate":"2026-01-06","until":null,"durationMinutes":90,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"deleteSchedule","summary":"Delete a schedule (not supported)","description":"Delete a schedule (not supported)","tags":["availability"],"parameters":[{"$ref":"#/components/parameters/ScheduleIdParam"}],"responses":{"405":{"description":"Method not allowed — schedules are archived, not deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string","const":"method_not_allowed"}},"required":["code"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}}}}},"/schedules/{id}/archive":{"post":{"operationId":"archiveSchedule","summary":"Archive a schedule","description":"Soft-archives a schedule when no live offering references it. Requires feature `location.manage`.","tags":["availability"],"security":[{"sessionBearer":[]},{"apiKey":[]}],"parameters":[{"$ref":"#/components/parameters/ScheduleIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Schedule"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope","example":{"data":{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","name":"Tuesday evenings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=TU;BYHOUR=18;BYMINUTE=0","startDate":"2026-01-06","until":null,"durationMinutes":90,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":"2026-07-24T12:00:00.000Z"}}}}}},"401":{"description":"Authentication required (`unauthorized`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Insufficient permissions (`forbidden`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/schedules/{id}/health":{"get":{"operationId":"getScheduleHealth","summary":"Validate that a schedule projects sane occurrences","description":"Validates a schedule projects sane, non-degenerate occurrences — catches bad RRULEs, zero duration, and timezone typos before they reach a customer. Requires feature `location.view`.","tags":["availability"],"parameters":[{"$ref":"#/components/parameters/ScheduleIdParam"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduleHealthReport"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/schedules/{id}/occurrences":{"get":{"operationId":"listScheduleOccurrences","summary":"Project schedule occurrences in a window","description":"Projects concrete occurrence times for a schedule in a date window. Requires feature `location.view`.","tags":["availability"],"parameters":[{"$ref":"#/components/parameters/ScheduleIdParam"},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduleOccurrencesResult"}},"required":["data"],"additionalProperties":false,"description":"Success response envelope"}}}},"400":{"description":"Validation error (`validation`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found (`not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"schemas":{"Uuid":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUID identifier","example":"550e8400-e29b-41d4-a716-446655440000"},"UploadImageBody":{"type":"object","properties":{"file":{"type":"string","description":"Image file (JPEG, PNG, or WebP)","format":"binary"}},"required":["file"],"example":{"file":"(binary)"}},"UpdateAssetBody":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"altText":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}}},"example":{"altText":"Hands shaping clay","tags":["studio"]}},"AttachAssetBody":{"type":"object","properties":{"assetId":{"$ref":"#/components/schemas/Uuid"}},"required":["assetId"],"example":{"assetId":"550e8400-e29b-41d4-a716-446655440019"}},"CreateBusinessBody":{"type":"object","properties":{"name":{"type":"string"},"contactEmail":{"$ref":"#/components/schemas/Email"},"businessType":{"$ref":"#/components/schemas/BusinessType"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"locale":{"$ref":"#/components/schemas/Locale"},"dateFormat":{"$ref":"#/components/schemas/DateFormat"},"location":{"type":"object","properties":{"name":{"type":"string","example":"Downtown Studio"},"address":{"type":"string","example":"123 Main St, Denver, CO"},"timezone":{"type":"string","example":"America/Denver","description":"IANA timezone identifier"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}]},"defaultConfirmationMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","address","timezone"]},"legalGivenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalFamilyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalName":{"description":"Full name from the single intake field — split into given/family server-side when the split fields are absent","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedLegal":{"type":"boolean","const":true}},"required":["name","contactEmail","businessType","location"],"example":{"name":"Sunrise Studio","contactEmail":"hello@sunrise.example.com","businessType":"art_maker","currency":"USD","locale":"en-US","dateFormat":"MDY","location":{"name":"Downtown Studio","address":"123 Main St, Denver, CO","timezone":"America/Denver"},"acceptedLegal":true}},"Email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Email address","example":"alex@example.com"},"BusinessType":{"type":"string","enum":["fitness_movement","art_maker","music_performance","wellness_bodywork","sports_recreation","venue_event_space","other"],"description":"Marketing taxonomy for what the business does. Required on create; null on legacy rows. Labels/hints come from GET /app-config. Not a routing field.","example":"art_maker"},"CurrencyCode":{"type":"string","enum":["AUD","CAD","CHF","DKK","EUR","GBP","INR","JPY","MXN","NOK","NZD","SEK","SGD","USD","ZAR"],"description":"ISO 4217. The business default — new listings and membership plans inherit it. Money already written keeps its own currency.","example":"USD"},"Locale":{"type":"string","description":"BCP 47 language tag. Drives number/currency display style only — not UI language. See architecture/15-locale.md.","example":"en-US"},"DateFormat":{"type":"string","enum":["MDY","DMY","YMD"],"description":"Display ordering for calendar dates (MDY/DMY/YMD). Never affects storage — timestamps are UTC and time-of-day belongs to the location timezone. See architecture/15-locale.md.","example":"MDY"},"UpdateBusinessBody":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"$ref":"#/components/schemas/Email"},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"locale":{"$ref":"#/components/schemas/Locale"},"dateFormat":{"$ref":"#/components/schemas/DateFormat"},"businessType":{"$ref":"#/components/schemas/BusinessType"},"feeMode":{"type":"string","enum":["absorb","split","pass"]},"feeCustomerPct":{"type":"integer","minimum":0,"maximum":100},"enabledModules":{"type":"array","items":{"type":"string","enum":["classes","sessions","spaces","memberships","packs"]}},"ctaColor":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]}},"example":{"name":"Sunrise Studio LLC","currency":"GBP","locale":"en-GB","dateFormat":"DMY","businessType":"fitness_movement","enabledModules":["instructors","spaces"]}},"UploadBusinessLogoBody":{"type":"object","properties":{"file":{"type":"string","description":"Logo image (JPEG, PNG, or WebP), already framed to the chosen shape","format":"binary"},"shape":{"description":"Display shape. Auto-detected from aspect ratio when omitted.","type":"string","enum":["square","round","rect"]}},"required":["file"],"example":{"file":"(binary)","shape":"square"}},"CreateBookingBody":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"channel":{"type":"string","enum":["online","staff","api"]},"redeemCredits":{"type":"boolean"},"idempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["offeringId","occurrenceId","customerId","partySize"],"example":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1,"channel":"staff"}},"CreateOperatorCartBody":{"type":"object","properties":{"items":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CartItemBody"}},"customerId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":200},"note":{"type":"string","maxLength":2000},"channel":{"type":"string","enum":["staff","api"]}},"required":["items"],"example":{"items":[{"offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","partySize":1}],"customerId":"550e8400-e29b-41d4-a716-446655440006","channel":"staff","note":"See you Tuesday!"}},"CartItemBody":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["offeringId","occurrenceId","partySize"],"example":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","partySize":1}},"ConfirmBookingBody":{"type":"object","properties":{"provider":{"type":"string","enum":["stripe","manual"]},"expectedEffect":{"$ref":"#/components/schemas/ExpectedMoneyEffect"}},"required":["provider","expectedEffect"],"example":{"provider":"stripe","expectedEffect":{"currency":"USD","movements":[{"direction":"charge","instrument":"card","amount":5000}]}}},"ExpectedMoneyEffect":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"movements":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["charge","refund","forfeit"]},"instrument":{"type":"string","enum":["card","cash","credits"]},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["direction","instrument","amount"]}}},"required":["currency","movements"],"example":{"currency":"USD","movements":[{"direction":"charge","instrument":"cash","amount":5000}]}},"CollectBalanceBody":{"type":"object","properties":{"provider":{"type":"string","enum":["stripe","manual"]},"expectedEffect":{"$ref":"#/components/schemas/ExpectedMoneyEffect"}},"required":["provider","expectedEffect"],"example":{"provider":"stripe","expectedEffect":{"currency":"USD","movements":[{"direction":"charge","instrument":"card","amount":5000}]}}},"CancelBookingBody":{"type":"object","properties":{"reason":{"type":"string"},"expectedEffect":{"$ref":"#/components/schemas/ExpectedMoneyEffect"}},"required":["expectedEffect"],"example":{"reason":"Schedule conflict","expectedEffect":{"currency":"USD","movements":[]}}},"RescheduleBookingBody":{"type":"object","properties":{"newOccurrenceId":{"$ref":"#/components/schemas/Uuid"}},"required":["newOccurrenceId"],"example":{"newOccurrenceId":"550e8400-e29b-41d4-a716-446655440013"}},"CompleteBookingBody":{"type":"object","properties":{"expectedEffect":{"$ref":"#/components/schemas/ExpectedMoneyEffect"}},"required":["expectedEffect"],"example":{"expectedEffect":{"currency":"USD","movements":[]}}},"MoveBookingPositionBody":{"type":"object","properties":{"fromPositionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"toPositionId":{"$ref":"#/components/schemas/Uuid"}},"required":["toPositionId"],"example":{"fromPositionId":"550e8400-e29b-41d4-a716-446655440030","toPositionId":"550e8400-e29b-41d4-a716-446655440031"}},"OccurrenceMessageBody":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":8000}},"required":["subject","body"],"example":{"subject":"Morning Flow · Monday, August 31, 10:00 AM","body":"Studio B today — use the side door."}},"CreatePaymentBody":{"type":"object","properties":{"provider":{"type":"string","enum":["stripe","manual"]},"purpose":{"type":"string","enum":["booking_deposit","booking_balance","booking_full","membership","open","cart"]},"amount":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"type":"string","minLength":3,"maxLength":3},"customerId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bookingId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"membershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["provider","purpose","amount"],"example":{"provider":"stripe","purpose":"booking_deposit","amount":1500,"bookingId":"550e8400-e29b-41d4-a716-446655440005"}},"MoneyAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Amount in minor currency units (e.g. cents)","example":2500},"RefundPaymentBody":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/MoneyAmount"},"expectedEffect":{"$ref":"#/components/schemas/ExpectedMoneyEffect"}},"required":["amount","expectedEffect"],"example":{"amount":1500,"expectedEffect":{"currency":"USD","movements":[{"direction":"refund","instrument":"card","amount":1500}]}}},"CreateCustomerBody":{"type":"object","properties":{"email":{"$ref":"#/components/schemas/Email"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalGivenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalFamilyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string","enum":["booking","import","manual"]},"tags":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"marketingConsent":{"type":"boolean"}},"required":["email"],"example":{"email":"alex@example.com","displayName":"Alex Rivera","marketingConsent":true}},"UpdateCustomerBody":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"marketingConsent":{"type":"boolean"}},"example":{"tags":["vip"],"marketingConsent":true}},"CreateMembershipPlanBody":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"type":"string","minLength":3,"maxLength":3},"billingPeriod":{"type":"string","enum":["none","one_time","monthly","yearly"]},"benefits":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["access","price","credit"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"mode":"percent","value":10,"scope":"all"}}},"required":["type","config"]}}},"required":["name","priceAmount","billingPeriod"],"example":{"name":"Unlimited Monthly","priceAmount":9900,"billingPeriod":"monthly"}},"UpdateMembershipPlanBody":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"billingPeriod":{"type":"string","enum":["none","one_time","monthly","yearly"]},"benefits":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["access","price","credit"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"mode":"percent","value":10,"scope":"all"}}},"required":["type","config"]}}},"example":{"name":"Unlimited Monthly","priceAmount":9900,"billingPeriod":"monthly"}},"PurchaseMembershipBody":{"type":"object","properties":{"planId":{"$ref":"#/components/schemas/Uuid"},"provider":{"type":"string","enum":["stripe","manual"]}},"required":["planId","provider"],"example":{"planId":"550e8400-e29b-41d4-a716-446655440010","provider":"stripe"}},"RecordMembershipPeriodPaymentBody":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"expectedEffect":{"$ref":"#/components/schemas/ExpectedMoneyEffect"}},"required":["expectedEffect"],"example":{"amount":9000,"currency":"USD","expectedEffect":{"currency":"USD","movements":[{"direction":"charge","instrument":"cash","amount":9000}]}}},"CancelMembershipBody":{"type":"object","properties":{"atPeriodEnd":{"description":"Cancel at period end (default true). Set false to cancel immediately.","type":"boolean"}},"example":{"atPeriodEnd":true}},"QuoteListingBody":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"redeemCredits":{"type":"boolean"}},"required":["offeringId","customerId","partySize"],"example":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1}},"ChatUiContext":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["booking","offering","customer","page","money"]},"entity_id":{"type":"string"},"reference":{"type":"string","maxLength":40}},"required":["label"]},"InlineTranscriptTurn":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"}},"required":["role","text"]},"InlineScheduleDraft":{"type":"object","properties":{"freq":{"type":"string","enum":["daily","weekly","monthly","dates"]},"interval":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byWeekday":{"type":"array","items":{"type":"string","enum":["MO","TU","WE","TH","FR","SA","SU"]}},"dates":{"type":"array","items":{"type":"string"}},"startTime":{"type":"string"},"startDate":{"type":"string"},"durationMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sessionLengthMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"until":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["freq","interval","byWeekday","dates","startTime","startDate","durationMinutes","sessionLengthMinutes","until"]},"RequestChallengeBody":{"type":"object","properties":{"email":{"$ref":"#/components/schemas/Email"},"channel":{"description":"Defaults to email_code","$ref":"#/components/schemas/VerificationChannel"},"surface":{"description":"Which surface requested sign-in — baked into magic-link redirect when channel is email_link","type":"string","enum":["console","customer"]},"redirectTo":{"description":"Same-origin root-relative path only (e.g. /account). Ignored if absolute or protocol-relative.","type":"string"}},"required":["email"],"example":{"email":"alex@example.com","channel":"email_code"}},"VerificationChannel":{"type":"string","enum":["email_link","email_code","sms_code"],"example":"email_code"},"VerifyChallengeBody":{"type":"object","properties":{"challengeId":{"$ref":"#/components/schemas/Uuid"},"code":{"type":"string","description":"Verification code from email/SMS","example":"123456"}},"required":["challengeId","code"],"example":{"challengeId":"550e8400-e29b-41d4-a716-446655440017","code":"123456"}},"CreatePersonBody":{"type":"object","properties":{"email":{"$ref":"#/components/schemas/Email"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalGivenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalFamilyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["email"],"example":{"email":"alex@example.com","displayName":"Alex Rivera"}},"UpdatePersonBody":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalGivenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalFamilyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"example":{"displayName":"Alex R."}},"CreateLocationBody":{"type":"object","properties":{"name":{"type":"string","example":"Downtown Studio"},"address":{"type":"string","example":"123 Main St, Denver, CO"},"timezone":{"type":"string","example":"America/Denver","description":"IANA timezone identifier"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}]},"defaultConfirmationMessage":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","address","timezone"],"example":{"name":"Downtown Studio","address":"123 Main St, Denver, CO","timezone":"America/Denver","country":"US","region":"CO","city":"Denver","postalCode":"80202"}},"UpdateLocationBody":{"type":"object","properties":{"name":{"type":"string","example":"Downtown Studio"},"address":{"type":"string","example":"123 Main St, Denver, CO"},"timezone":{"type":"string","example":"America/Denver","description":"IANA timezone identifier"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}]},"defaultConfirmationMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"hoursScheduleIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"example":{"name":"Downtown Studio — Updated"}},"CreateResourceBody":{"type":"object","properties":{"kind":{"type":"string","enum":["room","equipment"]},"name":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"availabilityScheduleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"positionLayout":{"type":"string","enum":["list","grid"]},"positions":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["kind","name","capacity"],"example":{"kind":"room","name":"Studio A","capacity":20}},"UpdateResourceBody":{"type":"object","properties":{"kind":{"type":"string","enum":["room","equipment"]},"name":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"availabilityScheduleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"positionLayout":{"type":"string","enum":["list","grid"]},"positions":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"example":{"capacity":24}},"CreateInstructorProfileBody":{"type":"object","properties":{"personId":{"$ref":"#/components/schemas/Uuid"},"email":{"$ref":"#/components/schemas/Email"},"name":{"type":"string"},"bio":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"specialties":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"availabilityScheduleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"locationIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"example":{"email":"teacher@example.com","name":"Alex Rivera","bio":"RYT-200 instructor"}},"UpdateInstructorProfileBody":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"specialties":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"availabilityScheduleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"locationIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"example":{"bio":"E-RYT 500 instructor"}},"CreateListingBody":{"type":"object","properties":{"type":{"type":"string","enum":["class","session","space"]},"exclusive":{"type":"boolean"},"name":{"type":"string"},"slug":{"type":"string"},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"type":"string","minLength":3,"maxLength":3},"depositType":{"type":"string","enum":["none","fixed","percent"]},"depositAmount":{"anyOf":[{"$ref":"#/components/schemas/MoneyAmount"},{"type":"null"}]},"capacity":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"creditCost":{"description":"Credits to cover one seat (default 1; 0 is free without consuming credits).","type":"integer","minimum":0,"maximum":9007199254740991},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"slotGranularityMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookingHorizonDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingCutoffMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancellationCutoffHours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"instructorIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"requiredAccessKeys":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"confirmationMessage":{"description":"Override location default confirmation copy; null inherits.","anyOf":[{"type":"string"},{"type":"null"}]},"autoCheckinMode":{"description":"Per-listing auto-check-in override; null inherits the business setting.","anyOf":[{"type":"string","enum":["off","start","after_minutes","end"]},{"type":"null"}]},"autoCheckinMinutes":{"description":"Minutes after session start when autoCheckinMode is after_minutes; null inherits.","anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"level":{"description":"Short level label — e.g. Beginner, All levels (build-plan/72).","anyOf":[{"type":"string"},{"type":"null"}]},"whatToBring":{"description":"What to bring — plain text or short markdown (build-plan/72).","anyOf":[{"type":"string"},{"type":"null"}]},"scheduleIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"questionIds":{"description":"Ordered checkout questions from the business catalog (asked once per cart at checkout).","type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["type","name","slug","priceAmount","capacity"],"example":{"type":"class","name":"Morning Flow","slug":"morning-flow","priceAmount":3000,"capacity":20}},"UpdateListingBody":{"type":"object","properties":{"type":{"type":"string","enum":["class","session","space"]},"exclusive":{"type":"boolean"},"name":{"type":"string"},"slug":{"type":"string"},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"type":"string","minLength":3,"maxLength":3},"depositType":{"type":"string","enum":["none","fixed","percent"]},"depositAmount":{"anyOf":[{"$ref":"#/components/schemas/MoneyAmount"},{"type":"null"}]},"capacity":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"creditCost":{"description":"Credits to cover one seat (default 1; 0 is free without consuming credits).","type":"integer","minimum":0,"maximum":9007199254740991},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"slotGranularityMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookingHorizonDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingCutoffMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancellationCutoffHours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"instructorIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"requiredAccessKeys":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"confirmationMessage":{"description":"Override location default confirmation copy; null inherits.","anyOf":[{"type":"string"},{"type":"null"}]},"autoCheckinMode":{"description":"Per-listing auto-check-in override; null inherits the business setting.","anyOf":[{"type":"string","enum":["off","start","after_minutes","end"]},{"type":"null"}]},"autoCheckinMinutes":{"description":"Minutes after session start when autoCheckinMode is after_minutes; null inherits.","anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"level":{"description":"Short level label — e.g. Beginner, All levels (build-plan/72).","anyOf":[{"type":"string"},{"type":"null"}]},"whatToBring":{"description":"What to bring — plain text or short markdown (build-plan/72).","anyOf":[{"type":"string"},{"type":"null"}]},"scheduleIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"questionIds":{"description":"Ordered checkout questions from the business catalog (asked once per cart at checkout).","type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"example":{"priceAmount":3500}},"MaterializeOccurrenceBody":{"type":"object","properties":{"occurrenceId":{"$ref":"#/components/schemas/Uuid"},"offeringId":{"$ref":"#/components/schemas/Uuid"}},"required":["occurrenceId","offeringId"],"example":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","offeringId":"550e8400-e29b-41d4-a716-446655440004"}},"AddTeamMemberBody":{"type":"object","properties":{"email":{"$ref":"#/components/schemas/Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"profile":{"anyOf":[{"type":"object","properties":{"bio":{"type":"string"},"specialties":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"}}},{"type":"null"}]}},"required":["email"],"example":{"email":"casey@mdholt.com","name":"Casey Morgan","roles":["manager"],"profile":{"bio":"Vinyasa and restorative.","specialties":["Vinyasa"],"public":true}}},"GrantUserRoleBody":{"type":"object","properties":{"personId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"featureOverrides":{"$ref":"#/components/schemas/FeatureOverrides"}},"required":["personId","roles"],"example":{"personId":"550e8400-e29b-41d4-a716-446655440001","roles":["employee"]}},"FeatureOverrides":{"type":"object","properties":{"grant":{"type":"array","items":{"type":"string"}},"revoke":{"type":"array","items":{"type":"string"}}},"required":["grant","revoke"],"example":{"grant":["booking.manage"],"revoke":[]}},"SetBusinessFeaturesBody":{"type":"object","properties":{"features":{"type":"array","items":{"type":"string"}}},"required":["features"],"example":{"features":["booking.view","booking.manage"]}},"UpdateUserRoleBody":{"type":"object","properties":{"roles":{"type":"array","items":{"type":"string"}},"featureOverrides":{"$ref":"#/components/schemas/FeatureOverrides"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"example":{"roles":["manager"]}},"JoinWaitlistBody":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["offeringId","occurrenceId","customerId","partySize"],"example":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1}},"StorefrontQuoteBody":{"type":"object","properties":{"occurrenceId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"redeemCredits":{"type":"boolean"}},"required":["occurrenceId","partySize"],"example":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","partySize":1}},"StorefrontWaitlistJoinBody":{"type":"object","properties":{"occurrenceId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"}},"required":["occurrenceId"],"example":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","partySize":1,"email":"maya@example.com","name":"Maya Rivera"}},"CreateCartBody":{"type":"object","properties":{"businessId":{"$ref":"#/components/schemas/Uuid"},"item":{"$ref":"#/components/schemas/CartItemBody"}},"example":{"item":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","partySize":1}}},"CheckoutCartBody":{"type":"object","properties":{"provider":{"type":"string","enum":["stripe","manual"]},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"answers":{"type":"array","items":{"type":"object","properties":{"questionId":{"$ref":"#/components/schemas/Uuid"},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["questionId","value"]}},"attendees":{"type":"array","items":{"type":"object","properties":{"bookingId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":200}},"required":["bookingId","email"]}},"marketingEmailConsent":{"type":"boolean"}},"required":["provider"],"example":{"provider":"stripe","email":"sam@example.com"}},"StorefrontRescheduleBookingBody":{"type":"object","properties":{"occurrenceId":{"$ref":"#/components/schemas/Uuid"}},"required":["occurrenceId"],"example":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013"}},"CreateQuestionBody":{"type":"object","properties":{"prompt":{"type":"string","example":"Any wheel experience?"},"helpText":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["text","radio","select","checkboxes"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"required":{"type":"boolean"}},"required":["prompt","type"],"example":{"prompt":"Any wheel experience?","type":"radio","options":["None","Some","Lots"],"required":true}},"UpdateQuestionBody":{"type":"object","properties":{"prompt":{"type":"string"},"helpText":{"anyOf":[{"type":"string"},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"required":{"type":"boolean"}},"example":{"required":false}},"AddQuestionsFromLibraryBody":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"},"example":["contact.phone","marketing.terms"]},"offeringId":{"$ref":"#/components/schemas/Uuid"}},"required":["keys"],"example":{"keys":["contact.phone","marketing.terms"]}},"ReorderImagesBody":{"type":"object","properties":{"ids":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["ids"],"example":{"ids":["550e8400-e29b-41d4-a716-446655440020"]}},"SitePreviewBody":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"example":{"url":"studio.test"}},"CreateImportBody":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["website","placefull"]}},"example":{"url":"https://studio.test"}},"ApplyImportBody":{"type":"object","properties":{"applyBusiness":{"type":"boolean"},"applyLocation":{"type":"boolean"},"applyBrand":{"type":"boolean"},"selections":{"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string","enum":["offering","resource","instructor_profile","membership_plan","schedule","customer","image"]},"sourceRef":{"type":"string"},"edit":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["entityType","sourceRef"]}}},"example":{"applyBusiness":true,"applyLocation":true,"applyBrand":true,"selections":[{"entityType":"offering","sourceRef":"page#o1"}]}},"PlaceAutocompleteBody":{"type":"object","properties":{"query":{"type":"string","description":"Address text typed so far."},"sessionToken":{"type":"string","description":"Autocomplete session token; required once suggestions have been shown."},"timezone":{"description":"Operator IANA timezone (e.g. America/Denver). Biases suggestions near them when the request is server-proxied — Google otherwise sees the datacenter IP.","type":"string"}},"required":["query","sessionToken"]},"PlaceDetailsBody":{"type":"object","properties":{"placeId":{"type":"string","description":"The placeId chosen from autocomplete."},"sessionToken":{"type":"string","description":"The same session token from autocomplete."}},"required":["placeId","sessionToken"]},"PlaceResolveBody":{"type":"object","properties":{"query":{"type":"string","description":"A full or partial address to qualify."}},"required":["query"]},"CreateScheduleBody":{"type":"object","properties":{"name":{"type":"string"},"startDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"durationMinutes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"timezone":{"type":"string"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"recurrence":{"type":"object","properties":{"freq":{"type":"string","enum":["once","daily","weekly","monthly"]},"interval":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"byWeekday":{"type":"array","items":{"type":"string","enum":["MO","TU","WE","TH","FR","SA","SU"]}},"startTime":{"type":"string"}},"required":["freq","startTime"]},"rrule":{"type":"string"},"startTime":{"type":"string"}},"required":["name","startDate","durationMinutes"],"example":{"name":"Tuesday evenings","recurrence":{"freq":"weekly","byWeekday":["TU"],"startTime":"18:00"},"startDate":"2026-01-06","durationMinutes":90,"locationId":"550e8400-e29b-41d4-a716-446655440003"}},"UpdateScheduleBody":{"type":"object","properties":{"name":{"type":"string"},"startDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"durationMinutes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"timezone":{"type":"string"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"recurrence":{"type":"object","properties":{"freq":{"type":"string","enum":["once","daily","weekly","monthly"]},"interval":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"byWeekday":{"type":"array","items":{"type":"string","enum":["MO","TU","WE","TH","FR","SA","SU"]}},"startTime":{"type":"string"}},"required":["freq","startTime"]},"rrule":{"type":"string"},"startTime":{"type":"string"}},"example":{"name":"Tuesday evenings — updated"}},"AssetListResult":{"type":"object","properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/Asset"}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"usedBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["assets","total","limit","offset","usedBytes"],"additionalProperties":false,"example":{"assets":[],"total":0,"limit":50,"offset":0,"usedBytes":0}},"Asset":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","const":"image"},"url":{"type":"string"},"urls":{"type":"object","properties":{"sm":{"type":"string"},"md":{"type":"string"},"lg":{"type":"string"},"orig":{"type":"string"}},"required":["sm","md","lg","orig"],"additionalProperties":false},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byteSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"altText":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["upload","import"]},"usageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offeringUsageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","kind","url","urls","width","height","byteSize","title","altText","tags","source","usageCount","offeringUsageCount","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440019","kind":"image","url":"https://cdn.example.com/biz/assets/ast/md.webp","urls":{"sm":"https://cdn.example.com/biz/assets/ast/sm.webp","md":"https://cdn.example.com/biz/assets/ast/md.webp","lg":"https://cdn.example.com/biz/assets/ast/lg.webp","orig":"https://cdn.example.com/biz/assets/ast/orig.webp"},"width":1600,"height":1200,"byteSize":120000,"title":"Wheel throwing","altText":"Hands shaping clay on a wheel","tags":["studio"],"source":"upload","usageCount":2,"offeringUsageCount":2,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"Timestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"ISO-8601 timestamp","example":"2026-07-24T12:00:00.000Z"},"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"Human-readable error message","example":"email is required"},"details":{"description":"Optional structured error details"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Standard API error response","example":{"error":{"code":"validation","message":"email is required"}}},"ErrorCode":{"type":"string","enum":["validation","unauthorized","forbidden","not_found","conflict","too_many_requests","internal_error"],"description":"Machine-readable error code","example":"validation"},"AssetDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","const":"image"},"url":{"type":"string"},"urls":{"type":"object","properties":{"sm":{"type":"string"},"md":{"type":"string"},"lg":{"type":"string"},"orig":{"type":"string"}},"required":["sm","md","lg","orig"],"additionalProperties":false},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byteSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"altText":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["upload","import"]},"usageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offeringUsageCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"links":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["offering","resource","instructorProfile","membershipPlan","businessLogo"]},"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"}},"required":["type","id","name"],"additionalProperties":false}}},"required":["id","kind","url","urls","width","height","byteSize","title","altText","tags","source","usageCount","offeringUsageCount","createdAt","updatedAt","archivedAt","links"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440019","kind":"image","url":"https://cdn.example.com/biz/assets/ast/md.webp","urls":{"sm":"https://cdn.example.com/biz/assets/ast/sm.webp","md":"https://cdn.example.com/biz/assets/ast/md.webp","lg":"https://cdn.example.com/biz/assets/ast/lg.webp","orig":"https://cdn.example.com/biz/assets/ast/orig.webp"},"width":1600,"height":1200,"byteSize":120000,"title":"Wheel throwing","altText":"Hands shaping clay on a wheel","tags":["studio"],"source":"upload","usageCount":1,"offeringUsageCount":1,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"links":[{"type":"offering","id":"550e8400-e29b-41d4-a716-446655440004","name":"Wheel Throwing"}]}},"Image":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"assetId":{"$ref":"#/components/schemas/Uuid"},"url":{"type":"string"},"urls":{"type":"object","properties":{"sm":{"type":"string"},"md":{"type":"string"},"lg":{"type":"string"},"orig":{"type":"string"}},"required":["sm","md","lg","orig"],"additionalProperties":false},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"altText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","url","urls","width","height","sortOrder","createdAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440019","assetId":"550e8400-e29b-41d4-a716-446655440019","url":"https://cdn.example.com/biz/listing/lst/img/md.webp","urls":{"sm":"https://cdn.example.com/biz/listing/lst/img/sm.webp","md":"https://cdn.example.com/biz/listing/lst/img/md.webp","lg":"https://cdn.example.com/biz/listing/lst/img/lg.webp","orig":"https://cdn.example.com/biz/listing/lst/img/orig.webp"},"width":1600,"height":1200,"sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","altText":null}},"CreateBusinessResult":{"type":"object","properties":{"business":{"$ref":"#/components/schemas/Business"},"location":{"$ref":"#/components/schemas/Location"}},"required":["business","location"],"additionalProperties":false,"example":{"business":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null},"location":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}},"Business":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"slug":{"type":"string"},"slugIsCustom":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"$ref":"#/components/schemas/Email"},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeChargesEnabled":{"type":"boolean"},"stripePayoutsEnabled":{"type":"boolean"},"stripeOnboardingStatus":{"$ref":"#/components/schemas/StripeOnboardingStatus"},"platformFeeBps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Per-merchant platform fee override in bps; null = PLATFORM_FEE_BPS"},"feeMode":{"type":"string","enum":["absorb","split","pass"],"description":"Who bears the platform fee (build-plan/70)"},"feeCustomerPct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Customer share percent when feeMode is split (0–100, steps of 5)"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"locale":{"$ref":"#/components/schemas/Locale"},"dateFormat":{"$ref":"#/components/schemas/DateFormat"},"businessType":{"anyOf":[{"$ref":"#/components/schemas/BusinessType"},{"type":"null"}]},"enabledModules":{"type":"array","items":{"type":"string","enum":["classes","sessions","spaces","memberships","packs"]},"description":"Optional product modules shown in admin chrome (architecture/11)"},"modulesSelected":{"type":"boolean","description":"True once get-started picker or Settings Features was submitted"},"ctaColor":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"description":"Customer-facing CTA color for emails and public pages"},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business logo URL (md variant)"},"logoShape":{"anyOf":[{"type":"string","enum":["square","round","rect"]},{"type":"null"}],"description":"How the logo is framed on public pages and emails"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","name","slug","slugIsCustom","description","url","contactEmail","contactPhone","stripeAccountId","stripeChargesEnabled","stripePayoutsEnabled","stripeOnboardingStatus","platformFeeBps","feeMode","feeCustomerPct","currency","locale","dateFormat","businessType","enabledModules","modulesSelected","ctaColor","logoUrl","logoShape","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"StripeOnboardingStatus":{"type":"string","enum":["not_started","pending","complete"],"example":"complete"},"Location":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"slug":{"type":"string"},"slugIsCustom":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"type":"string"},"hoursScheduleIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"defaultConfirmationMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","businessId","name","slug","slugIsCustom","description","address","lat","lng","country","region","city","postalCode","contactPhone","contactEmail","timezone","hoursScheduleIds","defaultConfirmationMessage","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"country":"US","region":"CO","city":"Denver","postalCode":"80202","contactPhone":"+15559876543","contactEmail":"downtown@sunrise.example.com","timezone":"America/Denver","hoursScheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"defaultConfirmationMessage":"See you at the studio — bring a water bottle.","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"Booking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"type":"string"},"customerId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bookedBy":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"cartId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"channel":{"type":"string","enum":["online","staff","api"]},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["held","confirmed","completed","canceled","no_show"]},"holdExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"priceSnapshot":{"$ref":"#/components/schemas/BookingQuote"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"appliedMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditsApplied":{"$ref":"#/components/schemas/MoneyAmount"},"platformFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"customerFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"taxAmount":{"$ref":"#/components/schemas/MoneyAmount"},"feeBpsSnapshot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"feeModeSnapshot":{"anyOf":[{"type":"string","enum":["absorb","split","pass"]},{"type":"null"}]},"cancellationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"amountPaid":{"$ref":"#/components/schemas/MoneyAmount"},"amountDue":{"$ref":"#/components/schemas/MoneyAmount"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/BookingAssignedPosition"}}},"required":["id","businessId","locationId","offeringId","occurrenceId","customerId","bookedBy","cartId","channel","partySize","status","holdExpiresAt","priceSnapshot","amountTotal","currency","appliedMembershipId","creditMembershipId","creditsApplied","platformFeeAmount","customerFeeAmount","feeBpsSnapshot","feeModeSnapshot","cancellationReason","idempotencyKey","reference","createdAt","updatedAt","amountPaid","amountDue"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[]}},"BookingQuote":{"type":"object","properties":{"base":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/QuoteAdjustment"}},"discountedSubtotal":{"$ref":"#/components/schemas/MoneyAmount"},"creditsApplied":{"$ref":"#/components/schemas/MoneyAmount"},"amountDueTotal":{"$ref":"#/components/schemas/MoneyAmount"},"amountDueNow":{"$ref":"#/components/schemas/MoneyAmount"},"amountDueLater":{"$ref":"#/components/schemas/MoneyAmount"},"creditRedemptionAvailable":{"type":"boolean"},"appliedMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"platformFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"customerFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"feeBps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"feeMode":{"type":"string","enum":["absorb","split","pass"]},"taxes":{"type":"array","items":{"type":"object","properties":{"taxRateId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"ratePpm":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/MoneyAmount"}},"required":["taxRateId","name","ratePpm","amount"],"additionalProperties":false}},"taxTotal":{"$ref":"#/components/schemas/MoneyAmount"}},"required":["base","currency","partySize","adjustments","discountedSubtotal","creditsApplied","amountDueTotal","amountDueNow","amountDueLater","creditRedemptionAvailable","appliedMembershipId","creditMembershipId","platformFeeAmount","customerFeeAmount","feeBps","feeMode"],"additionalProperties":false,"example":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]}},"Currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO-4217 currency code","example":"USD"},"QuoteAdjustment":{"type":"object","properties":{"kind":{"type":"string","enum":["discount","booking_fee","tax"]},"membershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"membershipPlanId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"benefitId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"label":{"type":"string"},"amount":{"$ref":"#/components/schemas/MoneyAmount"}},"required":["kind","membershipId","membershipPlanId","benefitId","label","amount"],"additionalProperties":false,"example":{"kind":"discount","membershipId":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","benefitId":"550e8400-e29b-41d4-a716-446655440018","label":"Member 10% off","amount":-300}},"BookingAssignedPosition":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"sortIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","sortIndex","name"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440030","sortIndex":0,"name":"Window"}},"OperatorBookingListResult":{"type":"object","properties":{"timezone":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"bookings":{"type":"array","items":{"$ref":"#/components/schemas/OperatorBooking"}}},"required":["day","bookings"],"additionalProperties":false}}},"required":["timezone","from","to","days"],"additionalProperties":false,"example":{"timezone":"America/Denver","from":"2026-07-27","to":"2026-08-03","days":[{"day":"2026-08-01","bookings":[{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[],"offeringName":"Morning Flow","customerName":"Alex Rivera","customerEmail":"alex@example.com","occurrenceStartsAt":"2026-08-01T18:00:00.000Z","occurrenceEndsAt":"2026-08-01T19:00:00.000Z","latestPaymentStatus":null,"amountRefunded":0,"balanceCollection":null}]}]}},"OperatorBooking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"type":"string"},"customerId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bookedBy":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"cartId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"channel":{"type":"string","enum":["online","staff","api"]},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["held","confirmed","completed","canceled","no_show"]},"holdExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"priceSnapshot":{"$ref":"#/components/schemas/BookingQuote"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"appliedMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditsApplied":{"$ref":"#/components/schemas/MoneyAmount"},"platformFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"customerFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"taxAmount":{"$ref":"#/components/schemas/MoneyAmount"},"feeBpsSnapshot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"feeModeSnapshot":{"anyOf":[{"type":"string","enum":["absorb","split","pass"]},{"type":"null"}]},"cancellationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"amountPaid":{"$ref":"#/components/schemas/MoneyAmount"},"amountDue":{"$ref":"#/components/schemas/MoneyAmount"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/BookingAssignedPosition"}},"offeringName":{"type":"string"},"customerName":{"type":"string"},"customerEmail":{"$ref":"#/components/schemas/Email"},"occurrenceStartsAt":{"$ref":"#/components/schemas/Timestamp"},"occurrenceEndsAt":{"$ref":"#/components/schemas/Timestamp"},"latestPaymentStatus":{"anyOf":[{"type":"string","enum":["requires_action","authorized","captured","canceled","failed","refunded","partially_refunded"]},{"type":"null"}]},"amountRefunded":{"$ref":"#/components/schemas/MoneyAmount"},"answers":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["prompt","value"],"additionalProperties":false}},"balanceCollection":{"anyOf":[{"type":"object","properties":{"runAt":{"$ref":"#/components/schemas/Timestamp"},"status":{"type":"string","enum":["scheduled","failed"]}},"required":["runAt","status"],"additionalProperties":false},{"type":"null"}]},"moneyEffects":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["booking.confirm","booking.collect_balance","booking.cancel","booking.complete","payment.refund","membership.record_payment"]},"currency":{"type":"string"},"movements":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["charge","refund","forfeit"]},"instrument":{"type":"string","enum":["card","cash","credits"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"}},"required":["direction","instrument","amount","label"],"additionalProperties":false}},"requiresApproval":{"type":"boolean"},"summary":{"type":"string"}},"required":["action","currency","movements","requiresApproval","summary"],"additionalProperties":false}}},"required":["id","businessId","locationId","offeringId","occurrenceId","customerId","bookedBy","cartId","channel","partySize","status","holdExpiresAt","priceSnapshot","amountTotal","currency","appliedMembershipId","creditMembershipId","creditsApplied","platformFeeAmount","customerFeeAmount","feeBpsSnapshot","feeModeSnapshot","cancellationReason","idempotencyKey","reference","createdAt","updatedAt","amountPaid","amountDue","offeringName","customerName","customerEmail","occurrenceStartsAt","occurrenceEndsAt","latestPaymentStatus","amountRefunded"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[],"offeringName":"Morning Flow","customerName":"Alex Rivera","customerEmail":"alex@example.com","occurrenceStartsAt":"2026-08-01T18:00:00.000Z","occurrenceEndsAt":"2026-08-01T19:00:00.000Z","latestPaymentStatus":null,"amountRefunded":0,"balanceCollection":null}},"OccurrenceSlot":{"type":"object","properties":{"occurrenceId":{"type":"string"},"scheduleId":{"$ref":"#/components/schemas/Uuid"},"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"localStart":{"type":"string"},"localEnd":{"type":"string"},"timezone":{"type":"string"},"capacityTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityRemaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityByStatus":{"$ref":"#/components/schemas/ScheduleCapacityByStatus"},"status":{"type":"string","enum":["open","full","blacked_out","closed"]},"materialized":{"type":"boolean"}},"required":["occurrenceId","scheduleId","startsAt","endsAt","localStart","localEnd","timezone","capacityTotal","capacityRemaining","capacityByStatus","status","materialized"],"additionalProperties":false,"example":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","localStart":"2026-08-01T12:00:00","localEnd":"2026-08-01T13:00:00","timezone":"America/Denver","capacityTotal":20,"capacityRemaining":5,"capacityByStatus":{"held":0,"confirmed":5,"completed":0,"noShow":0},"status":"open","materialized":false}},"ScheduleCapacityByStatus":{"type":"object","properties":{"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"noShow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["held","confirmed","completed","noShow"],"additionalProperties":false,"example":{"held":0,"confirmed":3,"completed":1,"noShow":0}},"PayLinkCart":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"token":{"type":"string"},"businessId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["open","checked_out","canceled"]},"channel":{"type":"string","enum":["online","staff","api"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"currency":{"$ref":"#/components/schemas/Currency"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerFirstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedOutAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItem"}},"amountDueNow":{"$ref":"#/components/schemas/MoneyAmount"},"amountDueLater":{"$ref":"#/components/schemas/MoneyAmount"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"amountTax":{"$ref":"#/components/schemas/MoneyAmount"},"amountCustomerFee":{"$ref":"#/components/schemas/MoneyAmount"},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"prompt":{"type":"string"},"helpText":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["text","radio","select","checkboxes"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"required":{"type":"boolean"}},"required":["id","prompt","helpText","type","options","required"],"additionalProperties":false}},"url":{"type":"string","format":"uri"},"qrSvg":{"type":"string","description":"Inline SVG QR of `url` for scan-to-pay at the counter."}},"required":["id","token","businessId","status","channel","createdBy","currency","note","customerFirstName","checkedOutAt","createdAt","items","amountDueNow","amountDueLater","amountTotal","amountCustomerFee","questions","url","qrSvg"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440022","token":"wS3nQ8xKf1JqL7ZtB4gYcR2v","businessId":"550e8400-e29b-41d4-a716-446655440002","status":"open","createdBy":null,"channel":"online","currency":"USD","note":null,"customerFirstName":null,"checkedOutAt":null,"createdAt":"2026-07-24T12:00:00.000Z","items":[{"id":"550e8400-e29b-41d4-a716-446655440023","itemType":"booking","bookingId":"550e8400-e29b-41d4-a716-446655440005","state":"held","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Beginner Wheel Throwing","listingSlug":"beginner-wheel-throwing","locationSlug":"riverbend-pottery","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T20:00:00.000Z","timezone":"America/Denver","partySize":1,"holdExpiresAt":"2026-08-01T18:00:00.000Z","cancellationCutoffHours":24,"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"taxAmount":0,"customerFeeAmount":0,"currency":"USD","taxes":[],"adjustments":[],"answers":[],"attendeeFirstName":null}],"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"amountTax":0,"amountCustomerFee":0,"questions":[{"id":"550e8400-e29b-41d4-a716-446655440077","prompt":"Any wheel experience?","helpText":null,"type":"radio","options":["None","Some","Lots"],"required":true}],"url":"https://app.example.com/cart/tok_example","qrSvg":"<svg xmlns=\"http://www.w3.org/2000/svg\">…</svg>"}},"CartItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"itemType":{"type":"string","enum":["booking"]},"bookingId":{"$ref":"#/components/schemas/Uuid"},"state":{"type":"string","enum":["held","available","unavailable","confirmed"]},"offeringId":{"$ref":"#/components/schemas/Uuid"},"offeringName":{"type":"string"},"listingSlug":{"type":"string"},"locationSlug":{"type":"string"},"occurrenceId":{"type":"string"},"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"timezone":{"type":"string"},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"cancellationCutoffHours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountDueNow":{"$ref":"#/components/schemas/MoneyAmount"},"amountDueLater":{"$ref":"#/components/schemas/MoneyAmount"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"taxAmount":{"$ref":"#/components/schemas/MoneyAmount"},"customerFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"adjustments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["discount","booking_fee","tax"]},"label":{"type":"string"},"amount":{"$ref":"#/components/schemas/MoneyAmount"}},"required":["label","amount"],"additionalProperties":false}},"taxes":{"type":"array","items":{"type":"object","properties":{"taxRateId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"ratePpm":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"$ref":"#/components/schemas/MoneyAmount"}},"required":["name","ratePpm","amount"],"additionalProperties":false}},"answers":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["prompt","value"],"additionalProperties":false}},"attendeeFirstName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","itemType","bookingId","state","offeringId","offeringName","listingSlug","locationSlug","occurrenceId","startsAt","endsAt","timezone","partySize","holdExpiresAt","cancellationCutoffHours","amountDueNow","amountDueLater","amountTotal","customerFeeAmount","currency","adjustments","answers","attendeeFirstName"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440023","itemType":"booking","bookingId":"550e8400-e29b-41d4-a716-446655440005","state":"held","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Beginner Wheel Throwing","listingSlug":"beginner-wheel-throwing","locationSlug":"riverbend-pottery","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T20:00:00.000Z","timezone":"America/Denver","partySize":1,"holdExpiresAt":"2026-08-01T18:00:00.000Z","cancellationCutoffHours":24,"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"taxAmount":0,"customerFeeAmount":0,"currency":"USD","taxes":[],"adjustments":[],"answers":[],"attendeeFirstName":null}},"PayLinkEmailResult":{"type":"object","properties":{"sent":{"type":"boolean"},"toMasked":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"type":"string","enum":["no_recipient","mail_not_configured","not_open"]}},"required":["sent","toMasked"],"additionalProperties":false,"description":"Outcome of emailing a pay link to the cart customer.","example":{"sent":true,"toMasked":"j•••@example.com"}},"OccurrencePositionBoard":{"type":"object","properties":{"occurrenceId":{"type":"string"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"offeringName":{"type":"string"},"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"timezone":{"type":"string"},"resourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"resourceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"exclusive":{"type":"boolean"},"mode":{"type":"string","enum":["positions","roster"]},"positionLayout":{"type":"string","enum":["list","grid"]},"capacityTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityBooked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitlisted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"positions":{"type":"array","items":{"$ref":"#/components/schemas/OccurrencePositionCell"}},"unassignedBookings":{"type":"array","items":{"$ref":"#/components/schemas/OccurrencePositionOccupant"}},"roster":{"type":"array","items":{"$ref":"#/components/schemas/OccurrencePositionOccupant"}}},"required":["occurrenceId","offeringId","offeringName","startsAt","endsAt","timezone","resourceId","resourceName","exclusive","mode","positionLayout","capacityTotal","capacityBooked","waitlisted","positions","unassignedBookings","roster"],"additionalProperties":false,"example":{"occurrenceId":"550e8400-e29b-41d4-a716-446655440010:2026-09-01T17:00:00.000Z","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Morning Flow","startsAt":"2026-07-24T12:00:00.000Z","endsAt":"2026-08-01T18:00:00.000Z","timezone":"America/Denver","resourceId":"550e8400-e29b-41d4-a716-446655440007","resourceName":"Studio A","exclusive":false,"mode":"positions","positionLayout":"list","capacityTotal":20,"capacityBooked":1,"waitlisted":0,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440030","sortIndex":0,"name":"Window","occupant":{"bookingId":"550e8400-e29b-41d4-a716-446655440005","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-07-24T12:00:00.000Z"}}],"unassignedBookings":[],"roster":[{"bookingId":"550e8400-e29b-41d4-a716-446655440005","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-07-24T12:00:00.000Z"}]}},"OccurrencePositionCell":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"sortIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"occupant":{"anyOf":[{"$ref":"#/components/schemas/OccurrencePositionOccupant"},{"type":"null"}]}},"required":["id","sortIndex","name","occupant"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440030","sortIndex":0,"name":"Window","occupant":{"bookingId":"550e8400-e29b-41d4-a716-446655440040","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-09-01T17:00:00.000Z"}}},"OccurrencePositionOccupant":{"type":"object","properties":{"bookingId":{"$ref":"#/components/schemas/Uuid"},"customerName":{"type":"string"},"customerEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["held","confirmed","completed","canceled","no_show"]},"autoCheckinMode":{"type":"string","enum":["off","start","after_minutes","end"]},"autoCheckinAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"answers":{"type":"array","items":{"type":"object","properties":{"questionId":{"$ref":"#/components/schemas/Uuid"},"prompt":{"type":"string"},"type":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["questionId","prompt","type","value"],"additionalProperties":false}}},"required":["bookingId","customerName","customerEmail","partySize","status","autoCheckinMode","autoCheckinAt"],"additionalProperties":false,"example":{"bookingId":"550e8400-e29b-41d4-a716-446655440040","customerName":"Ada Lovelace","customerEmail":"ada@example.com","partySize":1,"status":"confirmed","autoCheckinMode":"start","autoCheckinAt":"2026-09-01T17:00:00.000Z"}},"OccurrenceMessageResult":{"type":"object","properties":{"batchId":{"$ref":"#/components/schemas/Uuid"},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skippedNoEmail":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"}},"required":["batchId","queued","skippedNoEmail","subject"],"additionalProperties":false,"example":{"batchId":"550e8400-e29b-41d4-a716-446655440040","queued":4,"skippedNoEmail":0,"subject":"Morning Flow · Monday, August 31, 10:00 AM"}},"ConnectAccountSession":{"type":"object","properties":{"clientSecret":{"type":"string","description":"Stripe Account Session client secret for embedded onboarding","example":"acs_example_client_secret"},"publishableKey":{"type":"string","description":"Stripe publishable key the client initializes Connect.js with","example":"pk_example"},"stripeAccountId":{"type":"string","description":"Connected account the embedded components target","example":"acct_example"}},"required":["clientSecret","publishableKey","stripeAccountId"],"additionalProperties":false,"example":{"clientSecret":"acs_example_client_secret","publishableKey":"pk_example","stripeAccountId":"acct_example"}},"ConnectStatus":{"type":"object","properties":{"state":{"type":"string","enum":["not_connected","onboarding","connected"],"description":"The three-state payments onboarding status"},"stripeAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"chargesEnabled":{"type":"boolean"},"payoutsEnabled":{"type":"boolean"},"detailsSubmitted":{"type":"boolean"},"requirementsCurrentlyDue":{"type":"array","items":{"type":"string"},"description":"Stripe requirements the studio still owes"},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"onboardingStatus":{"type":"string"},"feeBps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Effective platform fee in basis points (business override ?? PLATFORM_FEE_BPS); Stripe processing fee is separate"},"feeMode":{"type":"string","enum":["absorb","split","pass"],"description":"Who bears the platform fee"},"feeCustomerPct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Customer share percent when feeMode is split"},"feeModeImpact":{"type":"object","properties":{"sessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spaces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instructors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sessions","spaces","instructors"],"additionalProperties":false,"description":"Published listing counts for fee-mode save confirmation (\"changes displayed price of N classes…\")"},"availableBalance":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Stripe available balance in business currency (minor units); null when unknown / not connected. Home Payouts tile."},"pendingBalance":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Stripe pending balance in business currency (minor units); null when unknown / not connected"},"balanceCurrency":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO currency for availableBalance / pendingBalance (uppercase), or null"},"statementDescriptor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Card statement descriptor customers see (Stripe settings); null when unknown / not set"},"payoutBank":{"anyOf":[{"type":"object","properties":{"bankName":{"anyOf":[{"type":"string"},{"type":"null"}]},"last4":{"type":"string"},"currency":{"type":"string"}},"required":["bankName","last4","currency"],"additionalProperties":false},{"type":"null"}],"description":"Default payout bank on the connected account; null when unknown / none on file"}},"required":["state","stripeAccountId","chargesEnabled","payoutsEnabled","detailsSubmitted","requirementsCurrentlyDue","disabledReason","onboardingStatus","feeBps","feeMode","feeCustomerPct","feeModeImpact","availableBalance","pendingBalance","balanceCurrency","statementDescriptor","payoutBank"],"additionalProperties":false,"example":{"state":"connected","stripeAccountId":"acct_example","chargesEnabled":true,"payoutsEnabled":true,"detailsSubmitted":true,"requirementsCurrentlyDue":[],"disabledReason":null,"onboardingStatus":"complete","feeBps":200,"feeMode":"absorb","feeCustomerPct":50,"feeModeImpact":{"classes":14,"sessions":3,"spaces":0},"availableBalance":124050,"pendingBalance":5000,"balanceCurrency":"USD","statementDescriptor":"MDHOLT.COM","payoutBank":{"bankName":"STRIPE TEST BANK","last4":"6789","currency":"USD"}}},"Payment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bookingId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"membershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"cartId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"provider":{"type":"string","enum":["stripe","manual"]},"providerRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"connectedAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"applicationFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"amount":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"purpose":{"type":"string","enum":["booking_deposit","booking_balance","booking_full","membership","open","cart"]},"status":{"type":"string","enum":["requires_action","authorized","captured","canceled","failed","refunded","partially_refunded"]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","businessId","customerId","bookingId","membershipId","cartId","provider","providerRef","connectedAccountId","applicationFeeAmount","amount","currency","purpose","status","createdAt","updatedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}},"PaymentActionResult":{"type":"object","properties":{"payment":{"$ref":"#/components/schemas/Payment"},"clientSecret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["payment"],"additionalProperties":false,"example":{"payment":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"clientSecret":"pi_example_client_secret"}},"LedgerBalances":{"type":"object","properties":{"total":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"}},"required":["total","currency"],"additionalProperties":false,"example":{"total":12500,"currency":"USD"}},"CustomerListResult":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/CustomerDetail"}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["customers","total","limit","offset"],"additionalProperties":false,"example":{"customers":[{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}}],"total":1,"limit":25,"offset":0}},"CustomerDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"personId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["active","archived"]},"source":{"type":"string","enum":["booking","import","manual"]},"tags":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"marketingConsent":{"type":"boolean"},"consentUpdatedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"person":{"$ref":"#/components/schemas/Person"},"stats":{"$ref":"#/components/schemas/CustomerDerivedStats"}},"required":["id","businessId","personId","status","source","tags","notes","marketingConsent","consentUpdatedAt","createdAt","updatedAt","archivedAt","person","stats"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}}},"Person":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalGivenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalFamilyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"$ref":"#/components/schemas/Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","displayName","legalGivenName","legalFamilyName","email","phone","createdAt","updatedAt"],"additionalProperties":false,"description":"A person identity in Bookable","example":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}},"CustomerDerivedStats":{"type":"object","properties":{"firstSeenAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"lastSeenAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"bookingsCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"noShowCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lifetimeSpendAmount":{"anyOf":[{"$ref":"#/components/schemas/MoneyAmount"},{"type":"null"}]},"lifetimeSpendCurrency":{"anyOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]}},"required":["firstSeenAt","lastSeenAt","bookingsCount","noShowCount","lifetimeSpendAmount","lifetimeSpendCurrency"],"additionalProperties":false,"example":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"}},"CustomerImportResult":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","updated","skipped"],"additionalProperties":false,"example":{"created":3,"updated":1,"skipped":0}},"Customer":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"personId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["active","archived"]},"source":{"type":"string","enum":["booking","import","manual"]},"tags":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"marketingConsent":{"type":"boolean"},"consentUpdatedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","businessId","personId","status","source","tags","notes","marketingConsent","consentUpdatedAt","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"MembershipPlan":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"$ref":"#/components/schemas/Currency"},"billingPeriod":{"type":"string","enum":["none","one_time","monthly","yearly"]},"status":{"type":"string","enum":["draft","published","archived"]},"stripePriceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeProductId":{"anyOf":[{"type":"string"},{"type":"null"}]},"benefits":{"type":"array","items":{"$ref":"#/components/schemas/Benefit"}},"displayOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Operator-controlled order within membership or pack family — build-plan/93."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","businessId","name","description","priceAmount","priceCurrency","billingPeriod","status","stripePriceId","stripeProductId","benefits","displayOrder","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Unlimited Monthly","description":"10% off all classes","priceAmount":9900,"priceCurrency":"USD","billingPeriod":"monthly","status":"published","stripePriceId":"price_test_monthly","stripeProductId":"prod_test_monthly","benefits":[{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"Benefit":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"membershipPlanId":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string","enum":["access","price","credit"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","membershipPlanId","type","config","createdAt","updatedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440018","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","type":"price","config":{"mode":"percent","value":10,"scope":"all"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}},"PurchaseMembershipResult":{"type":"object","properties":{"paymentId":{"type":"string"},"membership":{"$ref":"#/components/schemas/Membership"},"creditsGranted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"checkoutUrl":{"description":"Stripe Checkout Session URL for recurring purchases — no membership until webhook.","type":"string","format":"uri"}},"required":["paymentId","creditsGranted"],"additionalProperties":false,"example":{"paymentId":"550e8400-e29b-41d4-a716-446655440009","membership":{"id":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","paymentId":"550e8400-e29b-41d4-a716-446655440009","billingMode":"stripe_subscription","stripeSubscriptionId":"sub_test_1","stripeCustomerId":"cus_test_1","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"creditsGranted":10}},"Membership":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"membershipPlanId":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["active","past_due","paused","canceled","expired"]},"startedAt":{"$ref":"#/components/schemas/Timestamp"},"currentPeriodEnd":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"paymentId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"billingMode":{"type":"string","enum":["stripe_subscription","manual","none"]},"stripeSubscriptionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","membershipPlanId","businessId","customerId","status","startedAt","currentPeriodEnd","paymentId","billingMode","stripeSubscriptionId","stripeCustomerId","createdAt","updatedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","paymentId":"550e8400-e29b-41d4-a716-446655440009","billingMode":"stripe_subscription","stripeSubscriptionId":"sub_test_1","stripeCustomerId":"cus_test_1","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}},"MembershipListResult":{"type":"object","properties":{"memberships":{"type":"array","items":{"$ref":"#/components/schemas/MembershipDetail"}}},"required":["memberships"],"additionalProperties":false,"example":{"memberships":[{"id":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","paymentId":"550e8400-e29b-41d4-a716-446655440009","billingMode":"stripe_subscription","stripeSubscriptionId":"sub_test_1","stripeCustomerId":"cus_test_1","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","planName":"Unlimited Monthly","planBillingPeriod":"monthly","customerName":"Alex Rivera","customerEmail":"alex@example.com","creditsRemaining":8}]}},"MembershipDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"membershipPlanId":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["active","past_due","paused","canceled","expired"]},"startedAt":{"$ref":"#/components/schemas/Timestamp"},"currentPeriodEnd":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"paymentId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"billingMode":{"type":"string","enum":["stripe_subscription","manual","none"]},"stripeSubscriptionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"planName":{"type":"string"},"planBillingPeriod":{"type":"string","enum":["none","one_time","monthly","yearly"]},"customerName":{"type":"string"},"customerEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"creditsRemaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","membershipPlanId","businessId","customerId","status","startedAt","currentPeriodEnd","paymentId","billingMode","stripeSubscriptionId","stripeCustomerId","createdAt","updatedAt","planName","planBillingPeriod","customerName","customerEmail","creditsRemaining"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440011","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","paymentId":"550e8400-e29b-41d4-a716-446655440009","billingMode":"stripe_subscription","stripeSubscriptionId":"sub_test_1","stripeCustomerId":"cus_test_1","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","planName":"Unlimited Monthly","planBillingPeriod":"monthly","customerName":"Alex Rivera","customerEmail":"alex@example.com","creditsRemaining":8}},"PortalSessionResult":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false,"example":{"url":"https://billing.stripe.com/p/session/test_1"}},"AccessCheckResult":{"type":"object","properties":{"allowed":{"type":"boolean"},"requiredKeys":{"type":"array","items":{"type":"string"}},"grantedKeys":{"type":"array","items":{"type":"string"}},"missingKeys":{"type":"array","items":{"type":"string"}}},"required":["allowed","requiredKeys","grantedKeys","missingKeys"],"additionalProperties":false,"example":{"allowed":true,"requiredKeys":["premium"],"grantedKeys":["premium"],"missingKeys":[]}},"TaxRate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"name":{"type":"string"},"ratePpm":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","businessId","locationId","name","ratePpm","registrationNumber","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440024","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"name":"HST","ratePpm":130000,"registrationNumber":"123456789RT0001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"TaxSetup":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"jurisdictionLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","region","jurisdictionLabel"],"additionalProperties":false}},"rates":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}},"proposal":{"type":"object","properties":{"kind":{"type":"string","enum":["missing","canada","us"]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"seededRates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"ratePpm":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["name","ratePpm","locationId"],"additionalProperties":false}}},"required":["kind","message","seededRates"],"additionalProperties":false}},"required":["locations","rates","proposal"],"additionalProperties":false,"example":{"locations":[{"id":"550e8400-e29b-41d4-a716-446655440003","name":"Main","country":"CA","region":"ON","jurisdictionLabel":"Ontario, Canada"}],"rates":[{"id":"550e8400-e29b-41d4-a716-446655440024","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"name":"HST","ratePpm":130000,"registrationNumber":"123456789RT0001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}],"proposal":{"kind":"canada","message":null,"seededRates":[{"name":"HST","ratePpm":130000,"locationId":null}]}}},"AppConfig":{"type":"object","properties":{"productName":{"type":"string"},"appEnv":{"type":"string"},"appBaseUrl":{"type":"string"},"currencies":{"type":"array","items":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/CurrencyCode"},"name":{"type":"string"},"minorUnitDigits":{"anyOf":[{"type":"number","const":0},{"type":"number","const":2},{"type":"number","const":3}]}},"required":["code","name","minorUnitDigits"],"additionalProperties":false}},"dateFormats":{"type":"array","items":{"$ref":"#/components/schemas/DateFormat"}},"businessTypes":{"type":"array","items":{"type":"object","properties":{"value":{"$ref":"#/components/schemas/BusinessType"},"label":{"type":"string"},"hint":{"type":"string"}},"required":["value","label","hint"],"additionalProperties":false}},"productModules":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"primer":{"type":"string"},"locked":{"type":"boolean"}},"required":["key","label","primer","locked"],"additionalProperties":false}}},"required":["productName","appEnv","currencies","dateFormats","businessTypes","productModules"],"additionalProperties":false,"example":{"productName":"PLACEFULL","appEnv":"production","currencies":[{"code":"USD","name":"US dollar","minorUnitDigits":2},{"code":"GBP","name":"British pound","minorUnitDigits":2},{"code":"JPY","name":"Japanese yen","minorUnitDigits":0}],"dateFormats":["MDY","DMY","YMD"],"businessTypes":[{"value":"fitness_movement","label":"Fitness & movement","hint":"yoga, pilates, barre, dance, gym"},{"value":"art_maker","label":"Art & maker","hint":"pottery, painting, woodworking, craft"}],"productModules":[{"key":"classes","label":"Classes","primer":"Scheduled group sessions customers book by the seat.","locked":false},{"key":"instructors","label":"Instructors","primer":"Name the people who teach and assign them to classes.","locked":false},{"key":"sessions","label":"Reservations","primer":"Private time with a person — lessons, readings, consults.","locked":false},{"key":"spaces","label":"Spaces","primer":"Rooms and equipment — constrain classes and can be rented by the hour.","locked":false}]}},"MeContext":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"$ref":"#/components/schemas/Email"},"legalGivenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"legalFamilyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","legalGivenName","legalFamilyName","displayName"],"additionalProperties":false},"businesses":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"locale":{"$ref":"#/components/schemas/Locale"},"dateFormat":{"$ref":"#/components/schemas/DateFormat"},"stripeOnboardingStatus":{"$ref":"#/components/schemas/StripeOnboardingStatus"},"businessType":{"anyOf":[{"$ref":"#/components/schemas/BusinessType"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"enabledModules":{"type":"array","items":{"type":"string","enum":["classes","sessions","spaces","memberships","packs"]}},"modulesSelected":{"type":"boolean"},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","slug","timezone"],"additionalProperties":false}},"merchantAgreement":{"type":"object","properties":{"stale":{"type":"boolean"},"currentVersion":{"type":"string"},"currentSummary":{"type":"string"},"currentEffectiveAt":{"type":"string"},"acceptedVersion":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["stale","currentVersion","currentSummary","currentEffectiveAt","acceptedVersion"],"additionalProperties":false}},"required":["id","name","currency","locale","dateFormat","stripeOnboardingStatus","businessType","roles","enabledModules","modulesSelected","locations","merchantAgreement"],"additionalProperties":false}},"customerBusinessCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"upcomingBookingCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["person","businesses","customerBusinessCount","upcomingBookingCount"],"additionalProperties":false,"example":{"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"ada@sunrise.example.com","legalGivenName":"Ada","legalFamilyName":"Potter","displayName":"Ada"},"businesses":[{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","currency":"USD","locale":"en-US","dateFormat":"MDY","stripeOnboardingStatus":"complete","businessType":"fitness_movement","roles":["owner"],"enabledModules":["classes","instructors","spaces","memberships"],"modulesSelected":true,"locations":[{"id":"550e8400-e29b-41d4-a716-446655440003","name":"Downtown Studio","slug":"sunrise-studio","timezone":"America/Denver"}],"merchantAgreement":{"stale":false,"currentVersion":"2026-08-30","currentSummary":"PlaceFull Acquisition Inc merchant agreement — location-based fee, marketing, Colorado law.","currentEffectiveAt":"2026-08-30T00:00:00.000Z","acceptedVersion":"2026-08-30"}}],"customerBusinessCount":1,"upcomingBookingCount":2}},"ChangesMarker":{"type":"object","properties":{"marker":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["marker"],"additionalProperties":false},"HomeSummary":{"type":"object","properties":{"timezone":{"type":"string"},"day":{"type":"string"},"classesOnDay":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleClassRow"}},"nextClass":{"anyOf":[{"$ref":"#/components/schemas/ScheduleClassRow"},{"type":"null"}]},"instructors":{"type":"array","items":{"$ref":"#/components/schemas/HomeInstructorRow"}},"totalBookings":{"type":"object","properties":{"window":{"type":"string","enum":["all_time","last_7_days"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["window","count"],"additionalProperties":false},"memberships":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inactive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentIssue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","inactive","paymentIssue"],"additionalProperties":false},"bookingMetrics":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string","enum":["upcoming","last_week","all_time"]},"counts":{"$ref":"#/components/schemas/BookingStatusCounts"}},"required":["scope","counts"],"additionalProperties":false}},"bookingsTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","count"],"additionalProperties":false}},"needsYou":{"type":"array","items":{"$ref":"#/components/schemas/HomeNeedsYouItem"}},"money":{"$ref":"#/components/schemas/HomeMoneyBlock"},"fillRate":{"$ref":"#/components/schemas/HomeFillRateBlock"},"newCustomers":{"$ref":"#/components/schemas/HomeNewCustomersBlock"},"catalog":{"type":"object","properties":{"classes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"instructors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"membershipPlans":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spaces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rentals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payments":{"type":"string","enum":["not_connected","onboarding","connected"]}},"required":["classes","instructors","membershipPlans","spaces","rentals","sessions","payments"],"additionalProperties":false},"spaces":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"classesOnDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","capacity","classesOnDay"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false},"rentals":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false}},"required":["timezone","day","classesOnDay","nextClass","instructors","totalBookings","memberships","bookingMetrics","bookingsTrend","needsYou","money","fillRate","newCustomers","catalog","spaces","rentals"],"additionalProperties":false},"ScheduleClassRow":{"type":"object","properties":{"kind":{"type":"string","enum":["class","rental"]},"occurrenceId":{"type":"string"},"offeringId":{"type":"string"},"offeringName":{"type":"string"},"offeringColor":{"type":"string","enum":["clay","moss","slate","plum","marigold","teal","rose","stone"]},"offeringStatus":{"type":"string","enum":["draft","published","hidden","archived"]},"localStart":{"type":"string"},"localEnd":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"capacityTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityBooked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityRemaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityByStatus":{"$ref":"#/components/schemas/ScheduleCapacityByStatus"},"instructorIds":{"type":"array","items":{"type":"string"}},"instructors":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleClassInstructor"}},"instructorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"instructorHeadshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"spaceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"listingImageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","occurrenceId","offeringId","offeringName","offeringColor","offeringStatus","localStart","localEnd","startsAt","endsAt","capacityTotal","capacityBooked","capacityRemaining","capacityByStatus","instructorIds","instructors","instructorName","instructorHeadshotUrl","spaceName","listingImageUrl"],"additionalProperties":false},"ScheduleClassInstructor":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","headshotUrl"],"additionalProperties":false},"HomeInstructorRow":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"workingOnDay":{"type":"boolean"},"nextClass":{"anyOf":[{"type":"object","properties":{"offeringId":{"type":"string"},"offeringName":{"type":"string"},"localStart":{"type":"string"}},"required":["offeringId","offeringName","localStart"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","headshotUrl","workingOnDay","nextClass"],"additionalProperties":false},"BookingStatusCounts":{"type":"object","properties":{"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"no_show":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["held","confirmed","completed","canceled","no_show"],"additionalProperties":false},"HomeNeedsYouItem":{"type":"object","properties":{"kind":{"type":"string","enum":["hold_expiring","balance_due","task_failed","payments_setup","membership_past_due","confirmation_email_failed"]},"bookingId":{"type":"string"},"offeringId":{"type":"string"},"offeringName":{"type":"string"},"customerName":{"type":"string"},"occurrenceStartsAt":{"type":"string"},"localStart":{"type":"string"},"amountDue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"taskType":{"type":"string"},"taskId":{"type":"string"},"membershipId":{"type":"string"},"planName":{"type":"string"},"failureDetail":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind"],"additionalProperties":false},"HomeMoneyBlock":{"type":"object","properties":{"collectedToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectedLast7Days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"balancesDue":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["count","total"],"additionalProperties":false}},"required":["collectedToday","collectedLast7Days","currency","balancesDue"],"additionalProperties":false},"HomeFillRateBlock":{"type":"object","properties":{"window":{"type":"string","const":"next_7_days"},"capacityTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityBooked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pct":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emptyOccurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitlistedOccurrences":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["window","capacityTotal","capacityBooked","pct","emptyOccurrences","waitlistedOccurrences"],"additionalProperties":false},"HomeNewCustomersBlock":{"type":"object","properties":{"thisWeekCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"firstTimersToday":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string"},"displayName":{"type":"string"},"offeringName":{"type":"string"},"localStart":{"type":"string"}},"required":["customerId","displayName","offeringName","localStart"],"additionalProperties":false}}},"required":["thisWeekCount","firstTimersToday"],"additionalProperties":false},"ScheduleWeekSummary":{"type":"object","properties":{"timezone":{"type":"string"},"weekStart":{"type":"string"},"weekEnd":{"type":"string"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"classes":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleClassRow"}}},"required":["day","classes"],"additionalProperties":false}}},"required":["timezone","weekStart","weekEnd","days"],"additionalProperties":false},"ClassDays":{"type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"classes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"localStart":{"type":"string"},"localEnd":{"type":"string"},"active":{"type":"boolean"}},"required":["name","localStart","localEnd","active"],"additionalProperties":false}}},"required":["day","count","classes"],"additionalProperties":false}}},"required":["days"],"additionalProperties":false},"ChatStreamNote":{"type":"object","properties":{"note":{"type":"string"}},"required":["note"],"additionalProperties":false,"description":"Placeholder. This endpoint responds with `text/event-stream`, not JSON. Events: `message_start`, `text_delta`, `tool_start`, `tool_end`, `proposal`, `error`, `done`. A comment heartbeat is sent every 15 seconds so intermediaries do not close the stream."},"ChatSession":{"type":"object","properties":{"id":{"type":"string"},"businessId":{"type":"string"},"locationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"tokenBudgetUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","businessId","locationId","title","tokenBudgetUsed","createdAt","updatedAt","archivedAt"],"additionalProperties":false},"ChatMessage":{"type":"object","properties":{"id":{"type":"string"},"sessionId":{"type":"string"},"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"role":{"type":"string","enum":["user","assistant","tool"]},"content":{},"toolName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toolCallId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","sessionId","seq","role","content","toolName","toolCallId","createdAt"],"additionalProperties":false},"InlineScheduleProposal":{"type":"object","properties":{"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string"},"drafts":{"type":"array","items":{"$ref":"#/components/schemas/InlineScheduleDraftOutput"}},"expiresAt":{"type":"string"},"signature":{"type":"string"}},"required":["proposalId","summary","drafts","expiresAt","signature"],"additionalProperties":false},"InlineListingProposal":{"type":"object","properties":{"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"schedules":{"type":"array","items":{"$ref":"#/components/schemas/InlineScheduleDraftOutput"}},"instructorIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"instructorsToCreate":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"bio":{"type":"string"},"specialties":{"type":"array","items":{"type":"string"}}},"required":["name"],"additionalProperties":false}},"expiresAt":{"type":"string"},"signature":{"type":"string"}},"required":["proposalId","summary","fields","schedules","instructorIds","instructorsToCreate","expiresAt","signature"],"additionalProperties":false},"InlineResourceProposal":{"type":"object","properties":{"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["room","vehicle","equipment","other"]},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"},"signature":{"type":"string"}},"required":["proposalId","summary","name","kind","capacity","description","expiresAt","signature"],"additionalProperties":false},"InlineInstructorProposal":{"type":"object","properties":{"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expiresAt":{"type":"string"},"signature":{"type":"string"}},"required":["proposalId","summary","fields","expiresAt","signature"],"additionalProperties":false},"InlinePlanProposal":{"type":"object","properties":{"proposalId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"summary":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"expiresAt":{"type":"string"},"signature":{"type":"string"}},"required":["proposalId","summary","fields","expiresAt","signature"],"additionalProperties":false},"HealthReport":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"db":{"type":"string","const":"up"},"uptimeSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timestamp":{"$ref":"#/components/schemas/Timestamp"}},"required":["status","db","uptimeSeconds","timestamp"],"additionalProperties":false,"example":{"status":"ok","db":"up","uptimeSeconds":3600,"timestamp":"2026-07-24T12:00:00.000Z"}},"RequestChallengeResult":{"type":"object","properties":{"challengeId":{"$ref":"#/components/schemas/Uuid"},"channel":{"$ref":"#/components/schemas/VerificationChannel"},"expiresAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["challengeId","channel","expiresAt"],"additionalProperties":false,"example":{"challengeId":"550e8400-e29b-41d4-a716-446655440017","channel":"email_code","expiresAt":"2026-08-01T18:00:00.000Z"}},"VerifyChallengeResult":{"type":"object","properties":{"sessionToken":{"type":"string","description":"Bearer token for subsequent authenticated requests","example":"sess_example_token_not_a_real_secret"},"sessionExpiresAt":{"$ref":"#/components/schemas/Timestamp"},"person":{"$ref":"#/components/schemas/Person"}},"required":["sessionToken","sessionExpiresAt","person"],"additionalProperties":false,"example":{"sessionToken":"sess_example_token_not_a_real_secret","sessionExpiresAt":"2026-08-01T18:00:00.000Z","person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}},"SignOutResult":{"type":"object","properties":{"signedOut":{"type":"boolean"}},"required":["signedOut"],"additionalProperties":false,"example":{"signedOut":true}},"Closure":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"resourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"instructorId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"reason":{"type":"string"},"allDay":{"type":"boolean"},"seriesId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"affectedBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","businessId","locationId","resourceId","instructorId","startsAt","endsAt","reason","allDay","seriesId","createdAt","updatedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","resourceId":null,"instructorId":null,"startsAt":"2026-12-25T05:00:00.000Z","endsAt":"2026-12-26T05:00:00.000Z","reason":"Christmas Day","allDay":true,"seriesId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","affectedBookings":0}},"HolidaySuggestion":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"date":{"type":"string"}},"required":["key","name","date"],"additionalProperties":false,"example":{"key":"thanksgiving","name":"Thanksgiving","date":"2026-11-26"}},"CalendarFeedsPayload":{"type":"object","properties":{"locationName":{"type":"string"},"hasClasses":{"type":"boolean"},"hasReservationListings":{"type":"boolean"},"teachesHere":{"type":"boolean"},"canManage":{"type":"boolean"},"spaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"hasFeed":{"type":"boolean"}},"required":["id","name","hasFeed"],"additionalProperties":false}},"feeds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["studio","space","teaching"]},"resourceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resourceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"personId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"token":{"type":"string"},"subscribeUrl":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","kind","resourceId","resourceName","personId","name","token","subscribeUrl","createdAt"],"additionalProperties":false}}},"required":["locationName","hasClasses","hasReservationListings","teachesHere","canManage","spaces","feeds"],"additionalProperties":false},"CalendarFeed":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["studio","space","teaching"]},"resourceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resourceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"personId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"token":{"type":"string"},"subscribeUrl":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","kind","resourceId","resourceName","personId","name","token","subscribeUrl","createdAt"],"additionalProperties":false},"CalendarFeedRotated":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["studio","space","teaching"]},"resourceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"resourceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"personId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"token":{"type":"string"},"subscribeUrl":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","kind","resourceId","resourceName","personId","name","token","subscribeUrl","createdAt"],"additionalProperties":false},"Resource":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["room","equipment"]},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"positionLayout":{"type":"string","enum":["list","grid"]},"availabilityScheduleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"positions":{"type":"array","items":{"$ref":"#/components/schemas/ResourcePosition"}}},"required":["id","businessId","locationId","kind","name","description","capacity","positionLayout","availabilityScheduleId","createdAt","updatedAt","archivedAt","positions"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440007","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","kind":"room","name":"Studio A","description":"Heated room with mirrors","capacity":20,"positionLayout":"list","availabilityScheduleId":"550e8400-e29b-41d4-a716-446655440014","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"positions":[{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":0,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":1,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":2,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":3,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":4,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":5,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":6,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":7,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":8,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":9,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":10,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":11,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":12,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":13,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":14,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":15,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":16,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":17,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":18,"name":null},{"id":"550e8400-e29b-41d4-a716-446655440007","sortIndex":19,"name":null}]}},"ResourcePosition":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"sortIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","sortIndex","name"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440030","sortIndex":0,"name":"Window"}},"InstructorProfile":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"personId":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"bio":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"specialties":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"availabilityScheduleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"locationIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"person":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"$ref":"#/components/schemas/Email"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","displayName"],"additionalProperties":false},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","personId","businessId","bio","headshotUrl","specialties","public","availabilityScheduleId","locationIds","person","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440008","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","bio":"RYT-200 yoga instructor","headshotUrl":"https://cdn.example.com/alex.jpg","specialties":["vinyasa","restorative"],"public":true,"availabilityScheduleId":null,"locationIds":["550e8400-e29b-41d4-a716-446655440003"],"person":{"id":"550e8400-e29b-41d4-a716-446655440001","email":"alex@example.com","displayName":"Alex Rivera"},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"Offering":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string","enum":["class","session","space"]},"exclusive":{"type":"boolean"},"name":{"type":"string"},"slug":{"type":"string"},"slugIsCustom":{"type":"boolean"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Short level label — e.g. Beginner, All levels (build-plan/72)."},"whatToBring":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What to bring — plain text or short markdown (build-plan/72)."},"color":{"type":"string","enum":["clay","moss","slate","plum","marigold","teal","rose","stone"],"description":"Category edge colour on schedule and home — auto-assigned hash(id) % 8 on create."},"status":{"type":"string","enum":["draft","published","hidden","archived"]},"lifecycle":{"type":"string","enum":["live","upcoming","ended","unscheduled"]},"nextOccurrenceAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"lastOccurrenceAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"$ref":"#/components/schemas/Currency"},"depositType":{"type":"string","enum":["none","fixed","percent"]},"depositAmount":{"anyOf":[{"$ref":"#/components/schemas/MoneyAmount"},{"type":"null"}]},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditCost":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Credits required to cover one seat (architecture/05). Default 1; 0 is free without consuming credits."},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"slotGranularityMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookingHorizonDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingCutoffMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancellationCutoffHours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"instructorIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"requiredAccessKeys":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"confirmationMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduleIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"questionIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"},"description":"Ordered checkout questions (architecture/16 § Questions at checkout)"},"images":{"type":"array","items":{"$ref":"#/components/schemas/OfferingImage"}},"displayOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Operator-controlled catalog order within (location, type) — build-plan/93."},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","businessId","locationId","type","exclusive","name","slug","slugIsCustom","description","level","whatToBring","color","status","lifecycle","nextOccurrenceAt","lastOccurrenceAt","priceAmount","priceCurrency","depositType","depositAmount","capacity","creditCost","durationMinutes","slotGranularityMinutes","bookingHorizonDays","bookingCutoffMinutes","cancellationCutoffHours","resourceId","instructorIds","requiredAccessKeys","confirmationMessage","scheduleIds","questionIds","images","displayOrder","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440004","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","exclusive":false,"name":"Morning Flow","slug":"morning-flow","slugIsCustom":false,"description":"All-levels vinyasa","level":"All levels","whatToBring":"A mat and water.","color":"clay","status":"published","lifecycle":"live","nextOccurrenceAt":"2026-07-24T12:00:00.000Z","lastOccurrenceAt":"2026-07-24T12:00:00.000Z","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"creditCost":1,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"resourceId":"550e8400-e29b-41d4-a716-446655440007","instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"requiredAccessKeys":null,"confirmationMessage":null,"scheduleIds":["550e8400-e29b-41d4-a716-446655440014"],"questionIds":[],"images":[{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}],"displayOrder":0,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"OfferingImage":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"url":{"type":"string"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","offeringId","url","sortOrder","createdAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440019","offeringId":"550e8400-e29b-41d4-a716-446655440004","url":"https://cdn.example.com/class.jpg","sortOrder":0,"createdAt":"2026-07-24T12:00:00.000Z"}},"ListingOverview":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"timezone":{"type":"string"},"upcoming":{"type":"array","items":{"$ref":"#/components/schemas/ListingOverviewScheduleClassRow"}},"seats":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fillRatePct":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["total","booked","fillRatePct"],"additionalProperties":false},"bookings":{"type":"object","properties":{"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last30Days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["upcoming","last30Days"],"additionalProperties":false},"waitlist":{"type":"object","properties":{"entries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["entries","sessions"],"additionalProperties":false},"money":{"type":"object","properties":{"currency":{"type":"string"},"collectedLast30Days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectedAllTime":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balancesDue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","collectedLast30Days","collectedAllTime","balancesDue"],"additionalProperties":false}},"required":["offeringId","timezone","upcoming","seats","bookings","waitlist","money"],"additionalProperties":false},"ListingOverviewScheduleClassRow":{"type":"object","properties":{"kind":{"type":"string","enum":["class","rental"]},"occurrenceId":{"type":"string"},"offeringId":{"type":"string"},"offeringName":{"type":"string"},"offeringStatus":{"type":"string","enum":["draft","published","hidden","archived"]},"localStart":{"type":"string"},"localEnd":{"type":"string"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"capacityTotal":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityBooked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityRemaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capacityByStatus":{"$ref":"#/components/schemas/ScheduleCapacityByStatus"},"instructorIds":{"type":"array","items":{"type":"string"}},"instructors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","headshotUrl"],"additionalProperties":false}},"instructorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"instructorHeadshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"spaceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"listingImageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","occurrenceId","offeringId","offeringName","offeringStatus","localStart","localEnd","startsAt","endsAt","capacityTotal","capacityBooked","capacityRemaining","capacityByStatus","instructorIds","instructors","instructorName","instructorHeadshotUrl","spaceName","listingImageUrl"],"additionalProperties":false},"Occurrence":{"type":"object","properties":{"id":{"type":"string"},"scheduleId":{"$ref":"#/components/schemas/Uuid"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"timezone":{"type":"string"},"capacityOverride":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"instructorIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"status":{"type":"string","enum":["scheduled","canceled","completed"]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","scheduleId","offeringId","startsAt","endsAt","timezone","capacityOverride","resourceId","instructorIds","status","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","offeringId":"550e8400-e29b-41d4-a716-446655440004","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","timezone":"America/Los_Angeles","capacityOverride":null,"resourceId":null,"instructorIds":["550e8400-e29b-41d4-a716-446655440008"],"status":"scheduled","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"IsLocationOpenResult":{"type":"object","properties":{"open":{"type":"boolean"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["open","reason"],"additionalProperties":false,"example":{"open":true,"reason":null}},"TimelineItem":{"type":"object","properties":{"kind":{"type":"string","enum":["event","task"]},"id":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string"},"at":{"$ref":"#/components/schemas/Timestamp"},"status":{"type":"string"},"event":{"$ref":"#/components/schemas/EventEnvelope"},"task":{"$ref":"#/components/schemas/ScheduledTask"}},"required":["kind","id","type","at"],"additionalProperties":false,"example":{"kind":"event","id":"550e8400-e29b-41d4-a716-446655440020","type":"booking.created","at":"2026-07-24T12:00:00.000Z","event":{"id":"550e8400-e29b-41d4-a716-446655440020","type":"booking.created","occurredAt":"2026-07-24T12:00:00.000Z","businessId":"550e8400-e29b-41d4-a716-446655440002","subject":{"type":"booking","id":"550e8400-e29b-41d4-a716-446655440005"},"actor":{"type":"customer","id":"550e8400-e29b-41d4-a716-446655440001"},"data":{"partySize":1}}}},"EventEnvelope":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/Timestamp"},"businessId":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/Uuid"}},"required":["type","id"],"additionalProperties":false},"actor":{"type":"object","properties":{"type":{"type":"string","enum":["customer","user","system"]},"id":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["type","id"],"additionalProperties":false},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","occurredAt","businessId","subject","actor","data"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440020","type":"booking.created","occurredAt":"2026-07-24T12:00:00.000Z","businessId":"550e8400-e29b-41d4-a716-446655440002","subject":{"type":"booking","id":"550e8400-e29b-41d4-a716-446655440005"},"actor":{"type":"customer","id":"550e8400-e29b-41d4-a716-446655440001"},"data":{"partySize":1}}},"ScheduledTask":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string"},"subjectType":{"type":"string"},"subjectId":{"$ref":"#/components/schemas/Uuid"},"runAt":{"$ref":"#/components/schemas/Timestamp"},"status":{"type":"string"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxAttempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","businessId","type","subjectType","subjectId","runAt","status","attempts","maxAttempts","lastError","result","payload","createdAt","updatedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440021","businessId":"550e8400-e29b-41d4-a716-446655440002","type":"booking.hold_expiry","subjectType":"booking","subjectId":"550e8400-e29b-41d4-a716-446655440005","runAt":"2026-08-01T18:00:00.000Z","status":"pending","attempts":0,"maxAttempts":5,"lastError":null,"result":null,"payload":{},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}},"TeamMember":{"type":"object","properties":{"userRole":{"$ref":"#/components/schemas/UserRole"},"person":{"$ref":"#/components/schemas/Person"},"instructorProfile":{"anyOf":[{"$ref":"#/components/schemas/InstructorProfile"},{"type":"null"}]}},"required":["userRole","person","instructorProfile"],"additionalProperties":false,"example":{"userRole":{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null},"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"instructorProfile":null}},"UserRole":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"personId":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"featureOverrides":{"$ref":"#/components/schemas/FeatureOverridesOutput"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","personId","businessId","locationId","roles","featureOverrides","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440015","personId":"550e8400-e29b-41d4-a716-446655440001","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":null,"roles":["owner"],"featureOverrides":{"grant":["booking.manage"],"revoke":[]},"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"EffectiveAccess":{"type":"object","properties":{"businessEnabled":{"type":"array","items":{"type":"string"}},"userGranted":{"type":"array","items":{"type":"string"}},"effective":{"type":"array","items":{"type":"string"}}},"required":["businessEnabled","userGranted","effective"],"additionalProperties":false,"example":{"businessEnabled":["booking.view","booking.manage"],"userGranted":["booking.manage"],"effective":["booking.view","booking.manage"]}},"WaitlistEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"type":"string"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"$ref":"#/components/schemas/Uuid"},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["waiting","offered","converted","expired","canceled"]},"offeredBookingId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","businessId","occurrenceId","offeringId","customerId","partySize","status","offeredBookingId","createdAt","updatedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440016","businessId":"550e8400-e29b-41d4-a716-446655440002","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","offeringId":"550e8400-e29b-41d4-a716-446655440004","customerId":"550e8400-e29b-41d4-a716-446655440006","partySize":1,"status":"waiting","offeredBookingId":null,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}},"ProcessExpiredWaitlistResult":{"type":"object","properties":{"processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"promoted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["processed","promoted"],"additionalProperties":false,"example":{"processed":2,"promoted":1}},"MeCustomerRelationship":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"personId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["active","archived"]},"source":{"type":"string","enum":["booking","import","manual"]},"tags":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"marketingConsent":{"type":"boolean"},"consentUpdatedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"person":{"$ref":"#/components/schemas/Person"},"stats":{"$ref":"#/components/schemas/CustomerDerivedStats"},"business":{"$ref":"#/components/schemas/Business"}},"required":["id","businessId","personId","status","source","tags","notes","marketingConsent","consentUpdatedAt","createdAt","updatedAt","archivedAt","person","stats","business"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440006","businessId":"550e8400-e29b-41d4-a716-446655440002","personId":"550e8400-e29b-41d4-a716-446655440001","status":"active","source":"booking","tags":["regular"],"notes":"Prefers front row","marketingConsent":true,"consentUpdatedAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null,"person":{"id":"550e8400-e29b-41d4-a716-446655440001","displayName":"Alex Rivera","legalGivenName":"Alex","legalFamilyName":"Rivera","email":"alex@example.com","phone":"+15551234567","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"},"stats":{"firstSeenAt":"2026-07-24T12:00:00.000Z","lastSeenAt":"2026-07-24T12:00:00.000Z","bookingsCount":12,"noShowCount":0,"lifetimeSpendAmount":36000,"lifetimeSpendCurrency":"USD"},"business":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","slug":"sunrise-studio","slugIsCustom":false,"description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","contactEmail":"hello@sunrise.example.com","contactPhone":"+15559876543","stripeAccountId":"acct_123","stripeChargesEnabled":true,"stripePayoutsEnabled":true,"stripeOnboardingStatus":"complete","platformFeeBps":null,"feeMode":"absorb","feeCustomerPct":50,"currency":"USD","locale":"en-US","dateFormat":"MDY","businessType":"art_maker","enabledModules":["instructors","spaces","memberships"],"modulesSelected":true,"ctaColor":"#2563eb","logoUrl":"https://cdn.example/sunrise/logo/md.webp","logoShape":"square","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}}},"MeBookingsResult":{"type":"object","properties":{"upcoming":{"type":"array","items":{"$ref":"#/components/schemas/MeBooking"}},"past":{"type":"array","items":{"$ref":"#/components/schemas/MeBooking"}},"pastHasMore":{"type":"boolean"}},"required":["upcoming","past","pastHasMore"],"additionalProperties":false,"example":{"upcoming":[{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[],"businessName":"Sunrise Studio","locationName":"Downtown Studio","locationTimezone":"America/Denver","offeringName":"Morning Flow","listingSlug":"morning-flow","occurrenceStartsAt":"2026-08-01T18:00:00.000Z","occurrenceEndsAt":"2026-08-01T19:00:00.000Z"}],"past":[],"pastHasMore":false}},"MeBooking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"offeringId":{"$ref":"#/components/schemas/Uuid"},"occurrenceId":{"type":"string"},"customerId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bookedBy":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"cartId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"channel":{"type":"string","enum":["online","staff","api"]},"partySize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["held","confirmed","completed","canceled","no_show"]},"holdExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"priceSnapshot":{"$ref":"#/components/schemas/BookingQuote"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"appliedMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditMembershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"creditsApplied":{"$ref":"#/components/schemas/MoneyAmount"},"platformFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"customerFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"taxAmount":{"$ref":"#/components/schemas/MoneyAmount"},"feeBpsSnapshot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"feeModeSnapshot":{"anyOf":[{"type":"string","enum":["absorb","split","pass"]},{"type":"null"}]},"cancellationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"amountPaid":{"$ref":"#/components/schemas/MoneyAmount"},"amountDue":{"$ref":"#/components/schemas/MoneyAmount"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/BookingAssignedPosition"}},"businessName":{"type":"string"},"locationName":{"type":"string"},"locationTimezone":{"type":"string"},"offeringName":{"type":"string"},"listingSlug":{"type":"string"},"occurrenceStartsAt":{"$ref":"#/components/schemas/Timestamp"},"occurrenceEndsAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","businessId","locationId","offeringId","occurrenceId","customerId","bookedBy","cartId","channel","partySize","status","holdExpiresAt","priceSnapshot","amountTotal","currency","appliedMembershipId","creditMembershipId","creditsApplied","platformFeeAmount","customerFeeAmount","feeBpsSnapshot","feeModeSnapshot","cancellationReason","idempotencyKey","reference","createdAt","updatedAt","amountPaid","amountDue","businessName","locationName","locationTimezone","offeringName","listingSlug","occurrenceStartsAt","occurrenceEndsAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440005","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","offeringId":"550e8400-e29b-41d4-a716-446655440004","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","customerId":"550e8400-e29b-41d4-a716-446655440006","bookedBy":"550e8400-e29b-41d4-a716-446655440001","cartId":"550e8400-e29b-41d4-a716-446655440022","channel":"online","partySize":1,"status":"held","holdExpiresAt":"2026-08-01T18:00:00.000Z","priceSnapshot":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"amountTotal":3000,"currency":"USD","appliedMembershipId":null,"creditMembershipId":null,"creditsApplied":0,"platformFeeAmount":60,"customerFeeAmount":0,"feeBpsSnapshot":200,"feeModeSnapshot":"absorb","cancellationReason":null,"idempotencyKey":null,"reference":"BK-00000001","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","amountPaid":0,"amountDue":3000,"positions":[],"businessName":"Sunrise Studio","locationName":"Downtown Studio","locationTimezone":"America/Denver","offeringName":"Morning Flow","listingSlug":"morning-flow","occurrenceStartsAt":"2026-08-01T18:00:00.000Z","occurrenceEndsAt":"2026-08-01T19:00:00.000Z"}},"MeMembershipsResult":{"type":"object","properties":{"memberships":{"type":"array","items":{"$ref":"#/components/schemas/MeMembership"}}},"required":["memberships"],"additionalProperties":false,"example":{"memberships":[{"id":"550e8400-e29b-41d4-a716-446655440011","businessId":"550e8400-e29b-41d4-a716-446655440002","businessName":"Sunrise Studio","customerId":"550e8400-e29b-41d4-a716-446655440006","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","planName":"Unlimited Monthly","billingPeriod":"monthly","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","creditsRemaining":500,"benefits":[{"type":"credit","config":{"amount":10,"period":"monthly","scope":"all","rollover":false}}]}]}},"MeMembership":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"businessName":{"type":"string"},"customerId":{"$ref":"#/components/schemas/Uuid"},"membershipPlanId":{"$ref":"#/components/schemas/Uuid"},"planName":{"type":"string"},"billingPeriod":{"type":"string","enum":["none","one_time","monthly","yearly"]},"status":{"type":"string","enum":["active","past_due","paused","canceled","expired"]},"startedAt":{"$ref":"#/components/schemas/Timestamp"},"currentPeriodEnd":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"creditsRemaining":{"$ref":"#/components/schemas/MoneyAmount"},"benefits":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","config"],"additionalProperties":false}}},"required":["id","businessId","businessName","customerId","membershipPlanId","planName","billingPeriod","status","startedAt","currentPeriodEnd","creditsRemaining","benefits"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440011","businessId":"550e8400-e29b-41d4-a716-446655440002","businessName":"Sunrise Studio","customerId":"550e8400-e29b-41d4-a716-446655440006","membershipPlanId":"550e8400-e29b-41d4-a716-446655440010","planName":"Unlimited Monthly","billingPeriod":"monthly","status":"active","startedAt":"2026-07-24T12:00:00.000Z","currentPeriodEnd":"2026-08-01T18:00:00.000Z","creditsRemaining":500,"benefits":[{"type":"credit","config":{"amount":10,"period":"monthly","scope":"all","rollover":false}}]}},"DeleteAccountResult":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false,"example":{"deleted":true}},"StorefrontBusinessProfile":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"slug":{"type":"string"},"address":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","slug","address","timezone"],"additionalProperties":false}}},"required":["id","name","description","url","locations"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440002","name":"Sunrise Studio","description":"Yoga and pilates in Denver","url":"https://sunrise.example.com","locations":[{"id":"550e8400-e29b-41d4-a716-446655440003","name":"Downtown Studio","slug":"sunrise-studio","address":"123 Main St, Denver, CO","timezone":"America/Denver"}]}},"StorefrontLocationProfile":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"timezone":{"type":"string"},"schedule":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"rrule":{"type":"string"},"timezone":{"type":"string"}},"required":["name","rrule","timezone"],"additionalProperties":false},{"type":"null"}]}},"required":["timezone","schedule"],"additionalProperties":false}},"required":["id","businessId","name","description","address","lat","lng","timezone","hours"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440003","businessId":"550e8400-e29b-41d4-a716-446655440002","name":"Downtown Studio","description":"Main street location","address":"123 Main St, Denver, CO","lat":39.7392,"lng":-104.9903,"timezone":"America/Denver","hours":{"timezone":"America/Denver","schedule":{"name":"Regular hours","rrule":"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR","timezone":"America/Denver"}}}},"StorefrontPaginatedListings":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StorefrontListingSummary"}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false,"example":{"items":[{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Morning Flow","slug":"morning-flow","description":"All-levels vinyasa","type":"class","priceAmount":3000,"priceCurrency":"USD","image":{"url":"https://cdn.example.com/class.jpg","sortOrder":0,"altText":null}}],"nextCursor":null}},"StorefrontListingSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"$ref":"#/components/schemas/Currency"},"image":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"altText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["url","sortOrder"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","slug","description","type","priceAmount","priceCurrency","image"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Morning Flow","slug":"morning-flow","description":"All-levels vinyasa","type":"class","priceAmount":3000,"priceCurrency":"USD","image":{"url":"https://cdn.example.com/class.jpg","sortOrder":0,"altText":null}}},"StorefrontListingDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priceAmount":{"$ref":"#/components/schemas/MoneyAmount"},"priceCurrency":{"$ref":"#/components/schemas/Currency"},"depositType":{"type":"string"},"depositAmount":{"anyOf":[{"$ref":"#/components/schemas/MoneyAmount"},{"type":"null"}]},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"slotGranularityMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookingHorizonDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingCutoffMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancellationCutoffHours":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"images":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"altText":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["url","sortOrder"],"additionalProperties":false}},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"timezone":{"type":"string"},"rrule":{"type":"string"},"durationMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","timezone","rrule","durationMinutes"],"additionalProperties":false}},"instructors":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"bio":{"type":"string"},"headshotUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"specialties":{"type":"array","items":{"type":"string"}}},"required":["id","bio","headshotUrl","specialties"],"additionalProperties":false}}},"required":["id","locationId","type","name","slug","description","priceAmount","priceCurrency","depositType","depositAmount","capacity","durationMinutes","slotGranularityMinutes","bookingHorizonDays","bookingCutoffMinutes","cancellationCutoffHours","images","schedules","instructors"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440004","locationId":"550e8400-e29b-41d4-a716-446655440003","type":"class","name":"Morning Flow","slug":"morning-flow","description":"All-levels vinyasa","priceAmount":3000,"priceCurrency":"USD","depositType":"percent","depositAmount":50,"capacity":20,"durationMinutes":60,"slotGranularityMinutes":null,"bookingHorizonDays":30,"bookingCutoffMinutes":60,"cancellationCutoffHours":24,"images":[{"url":"https://cdn.example.com/class.jpg","sortOrder":0,"altText":null}],"schedules":[{"id":"550e8400-e29b-41d4-a716-446655440014","name":"Weekday mornings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR","durationMinutes":60}],"instructors":[{"id":"550e8400-e29b-41d4-a716-446655440008","bio":"RYT-200","headshotUrl":null,"specialties":["vinyasa"]}]}},"StorefrontAvailability":{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"$ref":"#/components/schemas/Uuid"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/OccurrenceSlot"}}},"required":["offeringId","locationId","slots"],"additionalProperties":false,"example":{"offeringId":"550e8400-e29b-41d4-a716-446655440004","locationId":"550e8400-e29b-41d4-a716-446655440003","slots":[{"occurrenceId":"550e8400-e29b-41d4-a716-446655440013","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","localStart":"2026-08-01T12:00:00","localEnd":"2026-08-01T13:00:00","timezone":"America/Denver","capacityTotal":20,"capacityRemaining":5,"capacityByStatus":{"held":0,"confirmed":5,"completed":0,"noShow":0},"status":"open","materialized":false}]}},"StorefrontQuoteResult":{"type":"object","properties":{"quote":{"$ref":"#/components/schemas/BookingQuote"},"availability":{"type":"object","properties":{"available":{"type":"boolean"},"capacityRemaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["open","full","blacked_out","closed"]}},"required":["available","capacityRemaining","status"],"additionalProperties":false}},"required":["quote","availability"],"additionalProperties":false,"example":{"quote":{"base":3000,"currency":"USD","partySize":1,"adjustments":[],"discountedSubtotal":3000,"creditsApplied":0,"amountDueTotal":3000,"amountDueNow":1500,"amountDueLater":1500,"creditRedemptionAvailable":false,"appliedMembershipId":null,"creditMembershipId":null,"platformFeeAmount":60,"customerFeeAmount":0,"feeBps":200,"feeMode":"absorb","taxTotal":0,"taxes":[]},"availability":{"available":true,"capacityRemaining":5,"status":"open"}}},"StorefrontWaitlistJoinResult":{"type":"object","properties":{"status":{"type":"string"},"position":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"alreadyJoined":{"type":"boolean"}},"required":["status","position","alreadyJoined"],"additionalProperties":false,"example":{"status":"waiting","position":2,"alreadyJoined":false}},"Cart":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"token":{"type":"string"},"businessId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["open","checked_out","canceled"]},"channel":{"type":"string","enum":["online","staff","api"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"currency":{"$ref":"#/components/schemas/Currency"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerFirstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedOutAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItem"}},"amountDueNow":{"$ref":"#/components/schemas/MoneyAmount"},"amountDueLater":{"$ref":"#/components/schemas/MoneyAmount"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"amountTax":{"$ref":"#/components/schemas/MoneyAmount"},"amountCustomerFee":{"$ref":"#/components/schemas/MoneyAmount"},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"prompt":{"type":"string"},"helpText":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["text","radio","select","checkboxes"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"required":{"type":"boolean"}},"required":["id","prompt","helpText","type","options","required"],"additionalProperties":false}}},"required":["id","token","businessId","status","channel","createdBy","currency","note","customerFirstName","checkedOutAt","createdAt","items","amountDueNow","amountDueLater","amountTotal","amountCustomerFee","questions"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440022","token":"wS3nQ8xKf1JqL7ZtB4gYcR2v","businessId":"550e8400-e29b-41d4-a716-446655440002","status":"open","createdBy":null,"channel":"online","currency":"USD","note":null,"customerFirstName":null,"checkedOutAt":null,"createdAt":"2026-07-24T12:00:00.000Z","items":[{"id":"550e8400-e29b-41d4-a716-446655440023","itemType":"booking","bookingId":"550e8400-e29b-41d4-a716-446655440005","state":"held","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Beginner Wheel Throwing","listingSlug":"beginner-wheel-throwing","locationSlug":"riverbend-pottery","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T20:00:00.000Z","timezone":"America/Denver","partySize":1,"holdExpiresAt":"2026-08-01T18:00:00.000Z","cancellationCutoffHours":24,"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"taxAmount":0,"customerFeeAmount":0,"currency":"USD","taxes":[],"adjustments":[],"answers":[],"attendeeFirstName":null}],"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"amountTax":0,"amountCustomerFee":0,"questions":[{"id":"550e8400-e29b-41d4-a716-446655440077","prompt":"Any wheel experience?","helpText":null,"type":"radio","options":["None","Some","Lots"],"required":true}]}},"AnswerSuggestions":{"type":"array","items":{"type":"object","properties":{"questionId":{"$ref":"#/components/schemas/Uuid"},"suggestions":{"type":"array","items":{"type":"object","properties":{"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"lastAnsweredAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["value","lastAnsweredAt"],"additionalProperties":false}}},"required":["questionId","suggestions"],"additionalProperties":false},"example":[{"questionId":"550e8400-e29b-41d4-a716-446655440077","suggestions":[{"value":"Some","lastAnsweredAt":"2026-07-24T12:00:00.000Z"}]}]},"CheckoutResult":{"type":"object","properties":{"cart":{"$ref":"#/components/schemas/Cart"},"payment":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"customerId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bookingId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"membershipId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"cartId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"provider":{"type":"string","enum":["stripe","manual"]},"providerRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"connectedAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"applicationFeeAmount":{"$ref":"#/components/schemas/MoneyAmount"},"amount":{"$ref":"#/components/schemas/MoneyAmount"},"currency":{"$ref":"#/components/schemas/Currency"},"purpose":{"type":"string","enum":["booking_deposit","booking_balance","booking_full","membership","open","cart"]},"status":{"type":"string","enum":["requires_action","authorized","captured","canceled","failed","refunded","partially_refunded"]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"clientSecret":{"type":"string"}},"required":["id","businessId","customerId","bookingId","membershipId","cartId","provider","providerRef","connectedAccountId","applicationFeeAmount","amount","currency","purpose","status","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["cart","payment"],"additionalProperties":false,"example":{"cart":{"id":"550e8400-e29b-41d4-a716-446655440022","token":"wS3nQ8xKf1JqL7ZtB4gYcR2v","businessId":"550e8400-e29b-41d4-a716-446655440002","status":"checked_out","createdBy":null,"channel":"online","currency":"USD","note":null,"customerFirstName":null,"checkedOutAt":"2026-07-24T12:00:00.000Z","createdAt":"2026-07-24T12:00:00.000Z","items":[{"id":"550e8400-e29b-41d4-a716-446655440023","itemType":"booking","bookingId":"550e8400-e29b-41d4-a716-446655440005","state":"held","offeringId":"550e8400-e29b-41d4-a716-446655440004","offeringName":"Beginner Wheel Throwing","listingSlug":"beginner-wheel-throwing","locationSlug":"riverbend-pottery","occurrenceId":"550e8400-e29b-41d4-a716-446655440013","startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T20:00:00.000Z","timezone":"America/Denver","partySize":1,"holdExpiresAt":"2026-08-01T18:00:00.000Z","cancellationCutoffHours":24,"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"taxAmount":0,"customerFeeAmount":0,"currency":"USD","taxes":[],"adjustments":[],"answers":[],"attendeeFirstName":null}],"amountDueNow":3000,"amountDueLater":0,"amountTotal":3000,"amountTax":0,"amountCustomerFee":0,"questions":[{"id":"550e8400-e29b-41d4-a716-446655440077","prompt":"Any wheel experience?","helpText":null,"type":"radio","options":["None","Some","Lots"],"required":true}]},"payment":{"id":"550e8400-e29b-41d4-a716-446655440009","businessId":"550e8400-e29b-41d4-a716-446655440002","customerId":"550e8400-e29b-41d4-a716-446655440006","bookingId":"550e8400-e29b-41d4-a716-446655440005","membershipId":null,"cartId":null,"provider":"stripe","providerRef":"pi_123","connectedAccountId":"acct_123","applicationFeeAmount":150,"amount":3000,"currency":"USD","purpose":"booking_deposit","status":"authorized","createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z"}}},"ManageBooking":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"reference":{"type":"string"},"status":{"type":"string","enum":["held","confirmed","completed","canceled","no_show"]},"listing":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capacity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookingHorizonDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmationMessage":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","slug","type","capacity","bookingHorizonDays","confirmationMessage"],"additionalProperties":false},"when":{"type":"object","properties":{"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"timezone":{"type":"string"},"dayLabel":{"type":"string"},"timeRangeLabel":{"type":"string"},"timezoneLabel":{"type":"string"}},"required":["startsAt","endsAt","timezone","dayLabel","timeRangeLabel","timezoneLabel"],"additionalProperties":false},"location":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"address":{"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"timezone":{"type":"string"},"contactEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","slug","address","lat","lng","timezone","contactEmail","contactPhone"],"additionalProperties":false},"business":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"contactEmail":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","slug","contactEmail"],"additionalProperties":false},"party":{"type":"object","properties":{"size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerEmailMasked":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["size","customerName","customerEmailMasked"],"additionalProperties":false},"money":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/Currency"},"amountTotal":{"$ref":"#/components/schemas/MoneyAmount"},"amountPaid":{"$ref":"#/components/schemas/MoneyAmount"},"amountDue":{"$ref":"#/components/schemas/MoneyAmount"},"amountTotalLabel":{"type":"string"},"amountPaidLabel":{"type":"string"},"amountDueLabel":{"type":"string"},"refundExpected":{"type":"boolean"},"refundLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"balanceCollectAtLabel":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["currency","amountTotal","amountPaid","amountDue","amountTotalLabel","amountPaidLabel","amountDueLabel","refundExpected","refundLabel","balanceCollectAtLabel"],"additionalProperties":false},"policy":{"type":"object","properties":{"canCancelOnline":{"type":"boolean"},"canRescheduleOnline":{"type":"boolean"},"refundExpected":{"type":"boolean"},"changesCloseAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]},"changesCloseAtLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"closedReason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["canCancelOnline","canRescheduleOnline","refundExpected","changesCloseAt","changesCloseAtLabel","closedReason"],"additionalProperties":false},"answers":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string"},"valueLabel":{"type":"string"}},"required":["prompt","valueLabel"],"additionalProperties":false}},"cartHref":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"type":"string"},"dateFormat":{"type":"string","enum":["MDY","DMY","YMD"]}},"required":["id","reference","status","listing","when","location","business","party","money","policy","answers","cartHref","locale","dateFormat"],"additionalProperties":false,"description":"Capability-surface booking view for the manage link (architecture/17). Email is masked; no booked_by or payment identifiers.","example":{"id":"550e8400-e29b-41d4-a716-446655440005","reference":"BK-550E8400","status":"confirmed","listing":{"id":"550e8400-e29b-41d4-a716-446655440004","name":"Vinyasa Flow","slug":"vinyasa-flow","type":"class","capacity":12,"bookingHorizonDays":28,"confirmationMessage":"Bring a mat."},"when":{"startsAt":"2026-08-01T18:00:00.000Z","endsAt":"2026-08-01T19:00:00.000Z","timezone":"America/Denver","dayLabel":"Sat, Aug 1, 2026","timeRangeLabel":"12:00 PM – 1:00 PM","timezoneLabel":"America/Denver"},"location":{"name":"Main Hall","slug":"main-hall","address":"9 Link St","lat":null,"lng":null,"timezone":"America/Denver","contactEmail":"hello@example.com","contactPhone":null},"business":{"name":"Sunrise Studio","slug":"sunrise-studio","contactEmail":"hello@example.com"},"party":{"size":1,"customerName":"Alex Rivera","customerEmailMasked":"a•••@example.com"},"money":{"currency":"USD","amountTotal":4500,"amountPaid":4500,"amountDue":0,"amountTotalLabel":"$45.00","amountPaidLabel":"$45.00","amountDueLabel":"$0.00","refundExpected":true,"refundLabel":"$45.00","balanceCollectAtLabel":null},"policy":{"canCancelOnline":true,"canRescheduleOnline":true,"refundExpected":true,"changesCloseAt":"2026-07-31T18:00:00.000Z","changesCloseAtLabel":"Fri, Jul 31, 2026, 12:00 PM","closedReason":null},"answers":[],"cartHref":null,"locale":"en-US","dateFormat":"MDY"}},"Question":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"prompt":{"type":"string"},"helpText":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["text","radio","select","checkboxes"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"required":{"type":"boolean"}},"required":["id","prompt","helpText","type","options","required"],"additionalProperties":false,"description":"A checkout question from the business catalog (architecture/16 § Questions at checkout)","example":{"id":"550e8400-e29b-41d4-a716-446655440077","prompt":"Any wheel experience?","helpText":"Helps us group the class.","type":"radio","options":["None","Some","Lots"],"required":true}},"QuestionLibrarySearchResult":{"type":"object","properties":{"total":{"type":"number"},"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["contact","event","honoree","safety","logistics","marketing","notes"]},"entries":{"type":"array","items":{"$ref":"#/components/schemas/QuestionLibraryEntry"}}},"required":["category","entries"],"additionalProperties":false}}},"required":["total","categories"],"additionalProperties":false,"example":{"total":1,"categories":[{"category":"contact","entries":[{"key":"contact.phone","category":"contact","prompt":"Best Contact Phone Number","helpText":"In case we need to reach you before your visit.","type":"text","options":null,"required":true,"keywords":["mobile","cell","telephone"]}]}]}},"QuestionLibraryEntry":{"type":"object","properties":{"key":{"type":"string"},"category":{"type":"string","enum":["contact","event","honoree","safety","logistics","marketing","notes"]},"prompt":{"type":"string"},"helpText":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["text","radio","select","checkboxes"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"required":{"type":"boolean"},"merchantSpecific":{"type":"boolean","const":true},"keywords":{"type":"array","items":{"type":"string"}}},"required":["key","category","prompt","helpText","type","options","required"],"additionalProperties":false,"description":"A platform starter checkout question (architecture/16 § Question library)","example":{"key":"contact.phone","category":"contact","prompt":"Best Contact Phone Number","helpText":"In case we need to reach you before your visit.","type":"text","options":null,"required":true,"keywords":["mobile","cell","telephone"]}},"AddQuestionsFromLibraryResult":{"type":"object","properties":{"created":{"type":"array","items":{"$ref":"#/components/schemas/Question"}},"skipped":{"type":"array","items":{"type":"string"}},"assignedTo":{"anyOf":[{"type":"object","properties":{"offeringId":{"$ref":"#/components/schemas/Uuid"},"offeringName":{"type":"string"},"questionIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["offeringId","offeringName","questionIds"],"additionalProperties":false},{"type":"null"}]}},"required":["created","skipped","assignedTo"],"additionalProperties":false,"example":{"created":[{"id":"550e8400-e29b-41d4-a716-446655440077","prompt":"Any wheel experience?","helpText":"Helps us group the class.","type":"radio","options":["None","Some","Lots"],"required":true}],"skipped":["contact.company"],"assignedTo":null}},"SitePreview":{"type":"object","properties":{"url":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"businessType":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"modules":{"type":"array","items":{"type":"string"}}},"required":["url","name","description","businessType","address","contactPhone","contactEmail","timezone","modules"],"additionalProperties":false,"example":{"url":"https://studio.test/","name":"Sunrise Clay Studio","description":"Pottery classes and studio rental in Falls Church.","businessType":"art_maker","address":"12 Kiln Road, Falls Church, VA 22046","contactPhone":"(703) 555-0142","contactEmail":"hello@studio.test","timezone":"America/New_York","modules":["classes","spaces"]}},"ImportRun":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"source":{"type":"string","enum":["website","placefull"]},"status":{"type":"string","enum":["pending","fetching","extracting","ready","applying","applied","failed","discarded"]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"legacyAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"legacyMatch":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"snapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"proposal":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"applied":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"}},"required":["id","businessId","source","status","url","legacyAccountId","legacyMatch","snapshot","proposal","applied","error","createdAt","updatedAt"],"additionalProperties":false,"description":"One website or PlaceFull import attempt","example":{"id":"550e8400-e29b-41d4-a716-446655440000","businessId":"550e8400-e29b-41d4-a716-446655440001","source":"website","status":"ready","url":"https://studio.test","legacyAccountId":null,"legacyMatch":null,"snapshot":{"pages":[]},"proposal":{"version":"import_proposal_v1"},"applied":null,"error":null,"createdAt":"2026-08-27T12:00:00.000Z","updatedAt":"2026-08-27T12:00:00.000Z"}},"ImportApplyResult":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/ImportRun"},"receipt":{"$ref":"#/components/schemas/ImportApplyReceipt"}},"required":["run","receipt"],"additionalProperties":false,"example":{"run":{"id":"550e8400-e29b-41d4-a716-446655440000","businessId":"550e8400-e29b-41d4-a716-446655440001","source":"website","status":"applied","url":"https://studio.test","legacyAccountId":null,"legacyMatch":null,"snapshot":{"pages":[]},"proposal":{"version":"import_proposal_v1"},"applied":{"counts":{"created":0,"skipped":0,"failed":0}},"error":null,"createdAt":"2026-08-27T12:00:00.000Z","updatedAt":"2026-08-27T12:00:00.000Z"},"receipt":{"appliedAt":"2026-08-27T12:00:00.000Z","business":true,"location":true,"brand":true,"items":[],"counts":{"created":0,"skipped":0,"failed":0}}}},"ImportApplyReceipt":{"type":"object","properties":{"appliedAt":{"$ref":"#/components/schemas/Timestamp"},"business":{"type":"boolean"},"location":{"type":"boolean"},"brand":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"entityType":{"type":"string"},"sourceRef":{"type":"string"},"status":{"type":"string","enum":["created","skipped","failed"]},"entityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["entityType","sourceRef","status"],"additionalProperties":false}},"counts":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","skipped","failed"],"additionalProperties":false}},"required":["appliedAt","business","location","brand","items","counts"],"additionalProperties":false,"example":{"appliedAt":"2026-08-27T12:00:00.000Z","business":true,"location":true,"brand":true,"items":[],"counts":{"created":0,"skipped":0,"failed":0}}},"ImportLink":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"entityType":{"type":"string","enum":["offering","resource","instructor_profile","membership_plan","schedule","customer","image"]},"entityId":{"$ref":"#/components/schemas/Uuid"},"sourceRef":{"type":"string"}},"required":["id","entityType","entityId","sourceRef"],"additionalProperties":false,"description":"Provenance from an import run to a created catalog row","example":{"id":"550e8400-e29b-41d4-a716-446655440002","entityType":"offering","entityId":"550e8400-e29b-41d4-a716-446655440003","sourceRef":"page#o1"}},"PlaceAutocompleteResponse":{"type":"object","properties":{"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/PlaceSuggestion"}}},"required":["suggestions"],"additionalProperties":false},"PlaceSuggestion":{"type":"object","properties":{"placeId":{"type":"string"},"primaryText":{"type":"string"},"secondaryText":{"type":"string"}},"required":["placeId","primaryText","secondaryText"],"additionalProperties":false},"PlaceDetailsResponse":{"type":"object","properties":{"formattedAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["formattedAddress","lat","lng","country","region","city","postalCode"],"additionalProperties":false},"Schedule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"businessId":{"$ref":"#/components/schemas/Uuid"},"locationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"name":{"type":"string"},"timezone":{"type":"string"},"rrule":{"type":"string"},"startDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"durationMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"updatedAt":{"$ref":"#/components/schemas/Timestamp"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/Timestamp"},{"type":"null"}]}},"required":["id","businessId","locationId","name","timezone","rrule","startDate","until","durationMinutes","createdAt","updatedAt","archivedAt"],"additionalProperties":false,"example":{"id":"550e8400-e29b-41d4-a716-446655440014","businessId":"550e8400-e29b-41d4-a716-446655440002","locationId":"550e8400-e29b-41d4-a716-446655440003","name":"Tuesday evenings","timezone":"America/Denver","rrule":"FREQ=WEEKLY;BYDAY=TU;BYHOUR=18;BYMINUTE=0","startDate":"2026-01-06","until":null,"durationMinutes":90,"createdAt":"2026-07-24T12:00:00.000Z","updatedAt":"2026-07-24T12:00:00.000Z","archivedAt":null}},"ScheduleHealthReport":{"type":"object","properties":{"scheduleId":{"$ref":"#/components/schemas/Uuid"},"healthy":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"invalid_timezone | zero_duration | invalid_rrule | no_occurrences"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}}},"required":["scheduleId","healthy","issues"],"additionalProperties":false,"example":{"scheduleId":"550e8400-e29b-41d4-a716-446655440014","healthy":false,"issues":[{"code":"no_occurrences","message":"Schedule does not project any occurrences in a forward probe window"}]}},"ScheduleOccurrencesResult":{"type":"object","properties":{"scheduleId":{"$ref":"#/components/schemas/Uuid"},"from":{"type":"string"},"to":{"type":"string"},"occurrences":{"type":"array","items":{"$ref":"#/components/schemas/ProjectedOccurrence"}}},"required":["scheduleId","from","to","occurrences"],"additionalProperties":false,"example":{"scheduleId":"550e8400-e29b-41d4-a716-446655440014","from":"2026-01-01T00:00:00.000Z","to":"2026-04-01T00:00:00.000Z","occurrences":[{"occurrenceId":"sched:550e8400-e29b-41d4-a716-446655440014:2026-01-07T01:00:00.000Z","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-01-07T01:00:00.000Z","endsAt":"2026-01-07T02:30:00.000Z","localStart":"2026-01-06T18:00:00.000-07:00","localEnd":"2026-01-06T19:30:00.000-07:00","timezone":"America/Denver"}]}},"ProjectedOccurrence":{"type":"object","properties":{"occurrenceId":{"type":"string"},"scheduleId":{"$ref":"#/components/schemas/Uuid"},"startsAt":{"$ref":"#/components/schemas/Timestamp"},"endsAt":{"$ref":"#/components/schemas/Timestamp"},"localStart":{"type":"string"},"localEnd":{"type":"string"},"timezone":{"type":"string"}},"required":["occurrenceId","scheduleId","startsAt","endsAt","localStart","localEnd","timezone"],"additionalProperties":false,"example":{"occurrenceId":"sched:550e8400-e29b-41d4-a716-446655440014:2026-01-07T01:00:00.000Z","scheduleId":"550e8400-e29b-41d4-a716-446655440014","startsAt":"2026-01-07T01:00:00.000Z","endsAt":"2026-01-07T02:30:00.000Z","localStart":"2026-01-06T18:00:00.000-07:00","localEnd":"2026-01-06T19:30:00.000-07:00","timezone":"America/Denver"}},"InlineScheduleDraftOutput":{"type":"object","properties":{"freq":{"type":"string","enum":["daily","weekly","monthly","dates"]},"interval":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byWeekday":{"type":"array","items":{"type":"string","enum":["MO","TU","WE","TH","FR","SA","SU"]}},"dates":{"type":"array","items":{"type":"string"}},"startTime":{"type":"string"},"startDate":{"type":"string"},"durationMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sessionLengthMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"until":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["freq","interval","byWeekday","dates","startTime","startDate","durationMinutes","sessionLengthMinutes","until"],"additionalProperties":false},"FeatureOverridesOutput":{"type":"object","properties":{"grant":{"type":"array","items":{"type":"string"}},"revoke":{"type":"array","items":{"type":"string"}}},"required":["grant","revoke"],"additionalProperties":false,"example":{"grant":["booking.manage"],"revoke":[]}}},"parameters":{"BusinessIdParam":{"in":"path","name":"businessId","schema":{"param":{"id":"BusinessIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"AssetIdParam":{"in":"path","name":"id","schema":{"param":{"id":"AssetIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"ListingIdParam":{"in":"path","name":"id","schema":{"param":{"id":"ListingIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"ResourceIdParam":{"in":"path","name":"id","schema":{"param":{"id":"ResourceIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"InstructorIdParam":{"in":"path","name":"id","schema":{"param":{"id":"InstructorIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"MembershipPlanIdParam":{"in":"path","name":"id","schema":{"param":{"id":"MembershipPlanIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"BusinessIdPathParam":{"in":"path","name":"id","schema":{"param":{"id":"BusinessIdPathParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"ApiKeyIdParam":{"in":"path","name":"id","schema":{"param":{"id":"ApiKeyIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"CartTokenParam":{"in":"path","name":"token","schema":{"type":"string"},"required":true},"BookingIdParam":{"in":"path","name":"bookingId","schema":{"param":{"id":"BookingIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"OccurrenceIdParam":{"in":"path","name":"occurrenceId","schema":{"type":"string"},"required":true},"PaymentIdParam":{"in":"path","name":"paymentId","schema":{"param":{"id":"PaymentIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"CustomerIdParam":{"in":"path","name":"customerId","schema":{"param":{"id":"CustomerIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"PlanIdParam":{"in":"path","name":"planId","schema":{"param":{"id":"PlanIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"MembershipIdParam":{"in":"path","name":"membershipId","schema":{"param":{"id":"MembershipIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"TaxRateIdParam":{"in":"path","name":"id","schema":{"param":{"id":"TaxRateIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"SessionIdParam":{"in":"path","name":"sessionId","schema":{"param":{"id":"SessionIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"PersonIdParam":{"in":"path","name":"id","schema":{"param":{"id":"PersonIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"LocationIdParam":{"in":"path","name":"locationId","schema":{"param":{"id":"LocationIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"UserRoleIdParam":{"in":"path","name":"id","schema":{"param":{"id":"UserRoleIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"EntryIdParam":{"in":"path","name":"entryId","schema":{"param":{"id":"EntryIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"CartItemIdParam":{"in":"path","name":"itemId","schema":{"param":{"id":"CartItemIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"ImageIdParam":{"in":"path","name":"id","schema":{"param":{"id":"ImageIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"ImportIdParam":{"in":"path","name":"importId","schema":{"param":{"id":"ImportIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"},"PayoutIdParam":{"in":"path","name":"payoutId","schema":{"type":"string"},"required":true},"ScheduleIdParam":{"in":"path","name":"id","schema":{"param":{"id":"ScheduleIdParam"},"$ref":"#/components/schemas/Uuid"},"required":true,"description":"UUID identifier"}},"securitySchemes":{"sessionBearer":{"type":"http","scheme":"bearer","bearerFormat":"session","description":"Passwordless session token returned by POST /auth/verify"},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"bk_","description":"Machine API key prefixed with `bk_`. Sent as `Authorization: Bearer bk_…`."}}}}