{
  "openapi": "3.1.0",
  "info": {
    "title": "Hapana Member API",
    "version": "2026-01-10",
    "description": "> **Status: Beta — Coming Soon.** This is the modernised member-facing API surface. The endpoints below describe the planned shape; production traffic today flows through the legacy `/v2/client/*` and `/v2/site/*` endpoints (see Business API for the current surface). Use this document to plan integrations against the upcoming Member API.\n\nThe Hapana Member API provides mobile app, kiosk, and embedded widget access to member-facing features.\n\n## Authentication\n\nMember authentication uses **Firebase Authentication**:\n\n1. User authenticates via Firebase SDK in the mobile app (email/password, Google, Apple Sign-In)\n2. Firebase returns an ID token (JWT)\n3. Include the Firebase ID token in the `Authorization: Bearer TOKEN` header\n4. Include the site ID in the `X-Site-ID` header\n5. Firebase handles token refresh automatically on the client side\n\n**Note:** There are no login/logout endpoints on this API. All authentication is handled by Firebase on the client.\n\n## Required Headers\n\nAll authenticated endpoints require:\n- `Authorization: Bearer <firebase-id-token>` - Firebase ID token\n- `X-Site-ID: <site-id>` - The site/location ID for the request\n\n## Premium Requirement\n\nMember API access requires a **Professional** or **Enterprise** subscription tier. Requests from Basic tier API keys will receive a `403 PREMIUM_REQUIRED` error.\n\n## Rate Limits\n\nMember API endpoints are rate-limited per member token:\n- 100 requests per minute for authenticated endpoints\n\n## Mobile, Kiosk & Embed\n\nThis API serves all three contexts identically. The same endpoints work for:\n- **Mobile App**: Native iOS/Android applications\n- **Kiosk**: In-location self-service terminals\n- **Embed**: Booking widgets embedded on partner websites",
    "contact": {
      "name": "Hapana API Support",
      "url": "https://docs.hapana.com",
      "email": "api-support@hapana.com"
    }
  },
  "servers": [
    {
      "url": "https://api.hapana-app.com/v2/member",
      "description": "Production API"
    },
    {
      "url": "https://api.sandbox.hapana-app.com/v2/member",
      "description": "Sandbox environment for testing"
    }
  ],
  "tags": [
    {
      "name": "Profile",
      "description": "Member profile and account information"
    },
    {
      "name": "Schedule",
      "description": "Class schedule and availability"
    },
    {
      "name": "Bookings",
      "description": "Booking and reservation management"
    },
    {
      "name": "Packages",
      "description": "Member packages and credits"
    },
    {
      "name": "Payments",
      "description": "Payment methods and billing history"
    },
    {
      "name": "Check-in",
      "description": "Self-service check-in"
    },
    {
      "name": "Widget Authentication",
      "description": "Authentication endpoints for the embed widget. Used by widgets embedded on customer websites.\n\n**Note:** These endpoints are for internal Hapana use only (embed widget, mobile app). They are not part of the public API."
    },
    {
      "name": "Widget Site",
      "description": "Site information endpoints for the embed widget. Returns location details, sessions, instructors, and packages.\n\n**Note:** These endpoints use V1-style response format for backwards compatibility."
    },
    {
      "name": "Widget Client",
      "description": "Client-facing endpoints for the embed widget. Manages bookings, packages, payments, and profile data for authenticated members.\n\n**Note:** These endpoints use V1-style response format for backwards compatibility."
    },
    {
      "name": "Widget Payments",
      "description": "Payment and checkout endpoints for the embed widget. Handles package purchases, session bookings, and promo codes.\n\n**Note:** These endpoints use V1-style response format for backwards compatibility."
    },
    {
      "name": "Widget Admin",
      "description": "Administrative endpoints for the embed widget. Handles password reset, email verification, and account management.\n\n**Note:** These endpoints are for internal Hapana use only (embed widget, mobile app)."
    }
  ],
  "security": [
    {
      "firebaseAuth": []
    }
  ],
  "paths": {
    "/profile": {
      "get": {
        "tags": [
          "Profile"
        ],
        "operationId": "getMemberProfile",
        "summary": "Get member profile",
        "description": "Returns the profile information for the authenticated member.",
        "responses": {
          "200": {
            "description": "Member profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberProfile"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Profile"
        ],
        "operationId": "updateMemberProfile",
        "summary": "Update member profile",
        "description": "Updates the authenticated member's profile information.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberProfile"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/schedule": {
      "get": {
        "tags": [
          "Schedule"
        ],
        "operationId": "getMemberSchedule",
        "summary": "Get schedule",
        "description": "Returns the class schedule for the member's home location. Results are filtered to sessions the member can book based on their packages and membership.",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for schedule range (ISO-8601 date)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for schedule range (ISO-8601 date)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Class schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileSessionList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/schedule/{id}": {
      "get": {
        "tags": [
          "Schedule"
        ],
        "operationId": "getSessionDetails",
        "summary": "Get session details",
        "description": "Returns detailed information about a specific class session, including availability and enrolled members count.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileSession"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bookings": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "operationId": "listMemberBookings",
        "summary": "List member bookings",
        "description": "Returns the authenticated member's bookings. Includes upcoming and recent past bookings.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by booking status",
            "schema": {
              "type": "string",
              "enum": [
                "confirmed",
                "waitlisted",
                "cancelled",
                "attended",
                "noshow"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Member bookings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileBookingList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Bookings"
        ],
        "operationId": "createMemberBooking",
        "summary": "Create booking",
        "description": "Books the authenticated member into a class session. If the session is full, the member will be added to the waitlist (if available).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMobileBookingRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booking created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileBooking"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Session full or already booked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bookings/{id}": {
      "delete": {
        "tags": [
          "Bookings"
        ],
        "operationId": "cancelMemberBooking",
        "summary": "Cancel booking",
        "description": "Cancels a booking. The booking must belong to the authenticated member and be in a cancellable state.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Booking ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Booking cancelled"
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Booking not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Cannot cancel booking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/checkin": {
      "post": {
        "tags": [
          "Check-in"
        ],
        "operationId": "mobileCheckin",
        "summary": "Self check-in",
        "description": "Records a self-service check-in at a location. Optionally specify a session ID for class check-in.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileCheckinRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Check-in recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileCheckin"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/packages": {
      "get": {
        "tags": [
          "Packages"
        ],
        "operationId": "listMemberPackages",
        "summary": "List member packages",
        "description": "Returns the authenticated member's active packages and memberships, including credit balances and expiry dates.",
        "responses": {
          "200": {
            "description": "Member packages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobilePackageList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/packages/available": {
      "get": {
        "tags": [
          "Packages"
        ],
        "operationId": "listAvailablePackages",
        "summary": "List available packages",
        "description": "Returns packages available for purchase at the member's home location. Includes pricing and credit information.",
        "responses": {
          "200": {
            "description": "Available packages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailablePackageList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/packages/{id}": {
      "get": {
        "tags": [
          "Packages"
        ],
        "operationId": "getMemberPackage",
        "summary": "Get package details",
        "description": "Returns detailed information about a specific package or membership.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Package ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Package details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobilePackage"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Package not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/payments/methods": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPaymentMethods",
        "summary": "List payment methods",
        "description": "Returns the authenticated member's saved payment methods (cards and bank accounts).",
        "responses": {
          "200": {
            "description": "Payment methods list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobilePaymentMethodList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "initiatePaymentMethod",
        "summary": "Initiate payment method setup",
        "description": "Initiates adding a new payment method. Returns a Stripe SetupIntent client secret to be used with Stripe.js for secure card collection.",
        "responses": {
          "201": {
            "description": "Setup initiated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethodSetupResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Setup failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/payments/methods/{id}/complete": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "completePaymentMethod",
        "summary": "Complete payment method setup",
        "description": "Completes the payment method setup after the SetupIntent has been confirmed via Stripe.js. Call this after successfully confirming the setup intent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Payment method ID from initiate response",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment method activated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobilePaymentMethod"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Setup not complete",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/payments/methods/{id}": {
      "delete": {
        "tags": [
          "Payments"
        ],
        "operationId": "deletePaymentMethod",
        "summary": "Delete payment method",
        "description": "Removes a saved payment method from the member's account.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Payment method ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Payment method deleted"
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Cannot delete payment method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/payments/history": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPaymentHistory",
        "summary": "Get payment history",
        "description": "Returns the authenticated member's billing and payment history (invoices).",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by payment status",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "open",
                "paid",
                "void",
                "uncollectible"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results to return (max 100)",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobilePaymentList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/site-version/{v1EncryptedId}": {
      "get": {
        "tags": [
          "Widget Authentication"
        ],
        "operationId": "checkSiteVersion",
        "summary": "Check site V1/V2 version",
        "description": "Checks if a site exists in the V2 system and returns version information.\n\nUsed by embed widgets to determine whether to use V1 or V2 API endpoints. Supports CORS from any origin.\n\n**Base URL:** `https://api.hapana-app.com` (not /v2/member)",
        "parameters": [
          {
            "name": "v1EncryptedId",
            "in": "path",
            "required": true,
            "description": "The V1 encrypted site ID (widget-id attribute)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Site version information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteVersionCheck"
                }
              }
            }
          },
          "400": {
            "description": "Missing v1EncryptedId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v2/auth/login": {
      "post": {
        "tags": [
          "Widget Authentication"
        ],
        "operationId": "widgetLogin",
        "summary": "Login",
        "description": "Authenticates a user with email/password or Firebase token and returns access tokens.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string"
                  },
                  "firebaseToken": {
                    "type": "string",
                    "description": "Firebase ID token for social login"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Login successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetAuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v2/auth/signup": {
      "post": {
        "tags": [
          "Widget Authentication"
        ],
        "operationId": "widgetSignup",
        "summary": "Sign up",
        "description": "Creates a new client account and returns access tokens.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "firstName",
                  "lastName"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string"
                  },
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signup successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetAuthResponse"
                }
              }
            }
          },
          "409": {
            "description": "Email already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v2/auth/logout": {
      "post": {
        "tags": [
          "Widget Authentication"
        ],
        "operationId": "widgetLogout",
        "summary": "Logout",
        "description": "Invalidates the current session token.",
        "responses": {
          "200": {
            "description": "Logged out successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/auth/verify": {
      "get": {
        "tags": [
          "Widget Authentication"
        ],
        "operationId": "widgetVerifyToken",
        "summary": "Verify token",
        "description": "Verifies if the current access token is valid.",
        "responses": {
          "200": {
            "description": "Token is valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Token is invalid or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/auth/refresh": {
      "post": {
        "tags": [
          "Widget Authentication"
        ],
        "operationId": "widgetRefreshToken",
        "summary": "Refresh token",
        "description": "Exchanges a refresh token for a new access token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "refreshToken"
                ],
                "properties": {
                  "refreshToken": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New tokens issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetAuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid refresh token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetListSites",
        "summary": "List sites",
        "description": "Returns a list of sites/locations for the corporate account.",
        "responses": {
          "200": {
            "description": "List of sites",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/detail": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetSiteDetail",
        "summary": "Get site details",
        "description": "Returns detailed information about the current site including name, address, timezone, and branding.",
        "responses": {
          "200": {
            "description": "Site details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSiteDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/sessions": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetSessions",
        "summary": "Get sessions",
        "description": "Returns the class schedule for a date range with filtering options.",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "sessionCategory",
            "in": "query",
            "description": "Filter by category (classes, workshops, privates)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instructorId",
            "in": "query",
            "description": "Filter by instructor ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based)",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Results per page",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of sessions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/sessionsDetails": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetSessionDetails",
        "summary": "Get session details",
        "description": "Returns detailed information about a specific session.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "required": true,
            "description": "Session ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "404": {
            "description": "Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/sessionsFilters": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetSessionFilters",
        "summary": "Get session filters",
        "description": "Returns available filter options (session types, instructors) for the schedule.",
        "responses": {
          "200": {
            "description": "Filter options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/packages": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetPackages",
        "summary": "Get available packages",
        "description": "Returns packages available for purchase at the site.",
        "responses": {
          "200": {
            "description": "List of packages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/packageDetail": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetPackageDetail",
        "summary": "Get package details",
        "description": "Returns detailed information about a specific package.",
        "parameters": [
          {
            "name": "packageId",
            "in": "query",
            "required": true,
            "description": "Package ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Package details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "404": {
            "description": "Package not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/instructor": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetInstructors",
        "summary": "Get instructors",
        "description": "Returns a list of instructors at the site.",
        "responses": {
          "200": {
            "description": "List of instructors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/instructorProfile": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetInstructorProfile",
        "summary": "Get instructor profile",
        "description": "Returns detailed profile information for an instructor.",
        "parameters": [
          {
            "name": "instructorId",
            "in": "query",
            "required": true,
            "description": "Instructor ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instructor profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "404": {
            "description": "Instructor not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/sessionTypes": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetSessionTypes",
        "summary": "Get session types",
        "description": "Returns the list of session types at the site.",
        "responses": {
          "200": {
            "description": "List of session types",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/policy": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetPolicy",
        "summary": "Get cancellation policy",
        "description": "Returns the site cancellation policy text.",
        "responses": {
          "200": {
            "description": "Policy text",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/agreement": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetAgreement",
        "summary": "Get terms and conditions",
        "description": "Returns the site terms and conditions.",
        "responses": {
          "200": {
            "description": "Agreement text",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/countries": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetCountries",
        "summary": "Get countries",
        "description": "Returns a list of supported countries.",
        "responses": {
          "200": {
            "description": "List of countries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/states": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetStates",
        "summary": "Get states",
        "description": "Returns a list of states for a given country.",
        "parameters": [
          {
            "name": "countryCode",
            "in": "query",
            "required": true,
            "description": "Country code",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of states",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/settings": {
      "get": {
        "tags": [
          "Widget Site"
        ],
        "operationId": "widgetGetSettings",
        "summary": "Get widget settings",
        "description": "Returns widget configuration settings and authentication tokens.",
        "responses": {
          "200": {
            "description": "Widget settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/properties": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetClientProperties",
        "summary": "Get client profile",
        "description": "Returns the authenticated client's profile information.",
        "responses": {
          "200": {
            "description": "Client profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/site/updateProperties": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetUpdateClientProperties",
        "summary": "Update client profile",
        "description": "Updates the authenticated client's profile information.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/futureBookings": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetFutureBookings",
        "summary": "Get future bookings",
        "description": "Returns the client's upcoming bookings.",
        "responses": {
          "200": {
            "description": "List of bookings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/sessionCheckin": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetSessionCheckin",
        "summary": "Check in to session",
        "description": "Records a check-in for a booked session.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "bookingId"
                ],
                "properties": {
                  "bookingId": {
                    "type": "string",
                    "description": "Booking ID to check in"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check-in recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/bookWaitlist": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetBookWaitlist",
        "summary": "Book waitlist",
        "description": "Adds the client to a session waitlist.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sessionId"
                ],
                "properties": {
                  "sessionId": {
                    "type": "string",
                    "description": "Session ID to waitlist"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added to waitlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/confirmWaitlist": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetConfirmWaitlist",
        "summary": "Confirm waitlist",
        "description": "Confirms a waitlist booking when a spot becomes available.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "waitlistId"
                ],
                "properties": {
                  "waitlistId": {
                    "type": "string",
                    "description": "Waitlist booking ID to confirm"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Booking confirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/cancelBooking": {
      "delete": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetCancelBooking",
        "summary": "Cancel booking",
        "description": "Cancels a booking.",
        "parameters": [
          {
            "name": "bookingId",
            "in": "query",
            "required": true,
            "description": "Booking ID to cancel",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/packages": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetClientPackages",
        "summary": "Get client packages",
        "description": "Returns the client's purchased packages and memberships.",
        "responses": {
          "200": {
            "description": "List of packages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/packageDetail": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetClientPackageDetail",
        "summary": "Get package details",
        "description": "Returns details about a specific package the client owns.",
        "parameters": [
          {
            "name": "packageId",
            "in": "query",
            "required": true,
            "description": "Package ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Package details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/cancelMembership": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetCancelMembership",
        "summary": "Cancel membership",
        "description": "Cancels an active membership.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "membershipId"
                ],
                "properties": {
                  "membershipId": {
                    "type": "string",
                    "description": "Membership ID to cancel"
                  },
                  "reason": {
                    "type": "string",
                    "description": "Optional cancellation reason"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Membership cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/updateAutoRenew": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetUpdateAutoRenew",
        "summary": "Update auto-renew",
        "description": "Updates the auto-renew setting for a membership.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "membershipId",
                  "autoRenew"
                ],
                "properties": {
                  "membershipId": {
                    "type": "string"
                  },
                  "autoRenew": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Setting updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/billingInformation": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetBillingInfo",
        "summary": "Get billing information",
        "description": "Returns the client's billing info and saved payment methods.",
        "responses": {
          "200": {
            "description": "Billing information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/billingHistory": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetBillingHistory",
        "summary": "Get billing history",
        "description": "Returns the client's payment and billing history.",
        "parameters": [
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based)",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Results per page",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Billing history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/addPaymentMethod": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetAddPaymentMethod",
        "summary": "Add payment method",
        "description": "Adds a new payment method for the client.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "paymentMethodToken"
                ],
                "properties": {
                  "paymentMethodToken": {
                    "type": "string",
                    "description": "Stripe payment method token"
                  },
                  "setAsDefault": {
                    "type": "boolean",
                    "description": "Set as default payment method"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment method added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/deletePaymentMethod": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetDeletePaymentMethod",
        "summary": "Delete payment method",
        "description": "Removes a saved payment method.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "paymentMethodId"
                ],
                "properties": {
                  "paymentMethodId": {
                    "type": "string",
                    "description": "Payment method ID to delete"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment method deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/updateDefaultPaymentMethod": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetUpdateDefaultPaymentMethod",
        "summary": "Set default payment method",
        "description": "Sets a payment method as the default.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "paymentMethodId"
                ],
                "properties": {
                  "paymentMethodId": {
                    "type": "string",
                    "description": "Payment method ID to set as default"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default payment method updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/stats": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetClientStats",
        "summary": "Get client stats",
        "description": "Returns the client's visit statistics.",
        "responses": {
          "200": {
            "description": "Client statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/visitHistory": {
      "get": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetGetVisitHistory",
        "summary": "Get visit history",
        "description": "Returns the client's check-in and visit history.",
        "parameters": [
          {
            "name": "pageIndex",
            "in": "query",
            "description": "Page number (1-based)",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Results per page",
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Visit history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/favoriteInstructor": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetToggleFavoriteInstructor",
        "summary": "Toggle favorite instructor",
        "description": "Adds or removes an instructor from favorites.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "instructorId"
                ],
                "properties": {
                  "instructorId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Favorite updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/policy": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetAcceptPolicy",
        "summary": "Accept policy",
        "description": "Records acceptance of a policy.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "policyId"
                ],
                "properties": {
                  "policyId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Policy accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/client/agreement": {
      "post": {
        "tags": [
          "Widget Client"
        ],
        "operationId": "widgetSignAgreement",
        "summary": "Sign agreement",
        "description": "Records signing of an agreement.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agreementId"
                ],
                "properties": {
                  "agreementId": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "Base64 encoded signature image"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agreement signed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/payments/showPaymentInfo": {
      "get": {
        "tags": [
          "Widget Payments"
        ],
        "operationId": "widgetGetPaymentInfo",
        "summary": "Get payment info",
        "description": "Returns payment information for checkout including pricing, taxes, discounts, and available payment methods.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "description": "Session ID (for session booking)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "packageId",
            "in": "query",
            "description": "Package ID (for package purchase)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "promoCode",
            "in": "query",
            "description": "Promo code to apply",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/payments/checkout": {
      "post": {
        "tags": [
          "Widget Payments"
        ],
        "operationId": "widgetCheckout",
        "summary": "Checkout",
        "description": "Completes a checkout for session booking or package purchase.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetCheckoutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checkout successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/payments/validatePromoCode": {
      "get": {
        "tags": [
          "Widget Payments"
        ],
        "operationId": "widgetValidatePromoCode",
        "summary": "Validate promo code",
        "description": "Validates a promo code and returns discount information.",
        "parameters": [
          {
            "name": "promoCode",
            "in": "query",
            "required": true,
            "description": "Promo code to validate",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "packageId",
            "in": "query",
            "description": "Package ID for context",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Promo code validation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/payments/redeemGiftCard": {
      "post": {
        "tags": [
          "Widget Payments"
        ],
        "operationId": "widgetRedeemGiftCard",
        "summary": "Redeem gift card",
        "description": "Redeems a gift card code.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "giftCardCode"
                ],
                "properties": {
                  "giftCardCode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gift card redeemed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid gift card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/payments/validateGiftCard": {
      "get": {
        "tags": [
          "Widget Payments"
        ],
        "operationId": "widgetValidateGiftCard",
        "summary": "Validate gift card",
        "description": "Validates a gift card code and returns balance information.",
        "parameters": [
          {
            "name": "giftCardCode",
            "in": "query",
            "required": true,
            "description": "Gift card code to validate",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gift card validation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/forgotpassword": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetForgotPassword",
        "summary": "Forgot password",
        "description": "Sends a password reset email.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reset email sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v2/admin/resetPassword": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetResetPassword",
        "summary": "Reset password",
        "description": "Resets password using a reset token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "newPassword"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Password reset token from email"
                  },
                  "newPassword": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password reset successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or expired token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v2/admin/changePassword": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetChangePassword",
        "summary": "Change password",
        "description": "Changes the password for an authenticated user.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "currentPassword",
                  "newPassword"
                ],
                "properties": {
                  "currentPassword": {
                    "type": "string"
                  },
                  "newPassword": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required or invalid password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/verifyEmail": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetVerifyEmail",
        "summary": "Verify email",
        "description": "Verifies an email address using a verification token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Email verification token"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or expired token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/v2/admin/resendVerification": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetResendVerification",
        "summary": "Resend verification email",
        "description": "Resends the email verification email.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification email sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/referralCode": {
      "get": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetGetReferralCode",
        "summary": "Get referral code",
        "description": "Returns the client's referral code and referral statistics.",
        "responses": {
          "200": {
            "description": "Referral information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/applyReferral": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetApplyReferral",
        "summary": "Apply referral code",
        "description": "Applies a referral code to the account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "referralCode"
                ],
                "properties": {
                  "referralCode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Referral applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid referral code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/registerPushToken": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetRegisterPushToken",
        "summary": "Register push token",
        "description": "Registers a device push notification token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token",
                  "platform"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Device push token"
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android",
                      "web"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/unregisterPushToken": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetUnregisterPushToken",
        "summary": "Unregister push token",
        "description": "Removes a device push notification token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Device push token to remove"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token unregistered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/notificationSettings": {
      "get": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetGetNotificationSettings",
        "summary": "Get notification settings",
        "description": "Returns the client's notification preferences.",
        "responses": {
          "200": {
            "description": "Notification settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/updateNotificationSettings": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetUpdateNotificationSettings",
        "summary": "Update notification settings",
        "description": "Updates the client's notification preferences.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emailNotifications": {
                    "type": "boolean"
                  },
                  "pushNotifications": {
                    "type": "boolean"
                  },
                  "smsNotifications": {
                    "type": "boolean"
                  },
                  "marketingEmails": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Settings updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/admin/contact": {
      "post": {
        "tags": [
          "Widget Admin"
        ],
        "operationId": "widgetSubmitContactForm",
        "summary": "Submit contact form",
        "description": "Submits a contact/support request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetSuccessResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "firebaseAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Firebase ID token obtained from Firebase Authentication SDK"
      }
    },
    "schemas": {
      "MemberProfile": {
        "type": "object",
        "description": "Member profile information",
        "required": [
          "object",
          "id",
          "firstName",
          "lastName",
          "email",
          "homeLocationId",
          "status"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "member_profile"
          },
          "id": {
            "type": "string",
            "example": "client_abc123"
          },
          "firstName": {
            "type": "string",
            "example": "Jane"
          },
          "lastName": {
            "type": "string",
            "example": "Smith"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "jane.smith@example.com"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "example": "+1-555-123-4567"
          },
          "homeLocationId": {
            "type": "string",
            "example": "loc_xyz789"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "suspended"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MobileSession": {
        "type": "object",
        "description": "Class session in schedule",
        "required": [
          "object",
          "id",
          "name",
          "locationId",
          "startTime",
          "duration",
          "capacity",
          "enrolled"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "session"
          },
          "id": {
            "type": "string",
            "example": "session_abc123"
          },
          "name": {
            "type": "string",
            "example": "Morning Yoga"
          },
          "locationId": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "duration": {
            "type": "integer",
            "description": "Duration in minutes",
            "example": 60
          },
          "capacity": {
            "type": "integer",
            "example": 20
          },
          "enrolled": {
            "type": "integer",
            "example": 15
          },
          "waitlistCount": {
            "type": "integer",
            "example": 0
          },
          "instructorName": {
            "type": [
              "string",
              "null"
            ],
            "example": "Jane Smith"
          }
        }
      },
      "MobileBooking": {
        "type": "object",
        "description": "Member booking",
        "required": [
          "object",
          "id",
          "clientId",
          "sessionId",
          "status",
          "createdAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "booking"
          },
          "id": {
            "type": "string",
            "example": "booking_abc123"
          },
          "clientId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "sessionName": {
            "type": "string",
            "example": "Morning Yoga"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "waitlisted",
              "cancelled",
              "attended",
              "noshow"
            ]
          },
          "spotNumber": {
            "type": [
              "integer",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateMobileBookingRequest": {
        "type": "object",
        "required": [
          "sessionId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "ID of the session to book"
          },
          "spotNumber": {
            "type": "integer",
            "description": "Optional preferred spot number"
          }
        }
      },
      "MobileCheckinRequest": {
        "type": "object",
        "required": [
          "locationId"
        ],
        "properties": {
          "locationId": {
            "type": "string",
            "description": "Location ID to check into"
          },
          "sessionId": {
            "type": "string",
            "description": "Optional session ID for class check-in"
          }
        }
      },
      "MobileCheckin": {
        "type": "object",
        "required": [
          "object",
          "id",
          "clientId",
          "locationId",
          "method",
          "checkedInAt",
          "createdAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "checkin"
          },
          "id": {
            "type": "string",
            "example": "checkin_abc123"
          },
          "clientId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "method": {
            "type": "string",
            "const": "mobile_app"
          },
          "checkedInAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MobilePackage": {
        "type": "object",
        "description": "Member package or membership",
        "required": [
          "object",
          "id",
          "clientId",
          "name",
          "type",
          "status"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "package"
          },
          "id": {
            "type": "string",
            "example": "package_abc123"
          },
          "clientId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "example": "Unlimited Monthly"
          },
          "type": {
            "type": "string",
            "enum": [
              "membership",
              "credit_pack"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "depleted",
              "cancelled"
            ]
          },
          "creditsRemaining": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for unlimited memberships"
          },
          "validFrom": {
            "type": "string",
            "format": "date-time"
          },
          "validTo": {
            "type": "string",
            "format": "date-time"
          },
          "autoRenew": {
            "type": "boolean"
          }
        }
      },
      "AvailablePackage": {
        "type": "object",
        "description": "Package available for purchase at a location",
        "required": [
          "object",
          "id",
          "name",
          "type",
          "price",
          "currency"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "available_package"
          },
          "id": {
            "type": "string",
            "example": "pkg_avail_abc123"
          },
          "name": {
            "type": "string",
            "example": "Unlimited Monthly"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "membership",
              "credit_pack"
            ]
          },
          "price": {
            "type": "number",
            "example": 99
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "creditsIncluded": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Number of credits included; null for unlimited memberships"
          },
          "durationDays": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Validity duration in days; null for ongoing memberships"
          },
          "autoRenews": {
            "type": "boolean"
          }
        }
      },
      "MobilePaymentMethod": {
        "type": "object",
        "description": "Member payment method",
        "required": [
          "object",
          "id",
          "type",
          "status",
          "isDefault"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "payment_method"
          },
          "id": {
            "type": "string",
            "example": "pm_abc123"
          },
          "type": {
            "type": "string",
            "enum": [
              "card",
              "bank"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "active",
              "deleted"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "card": {
            "type": "object",
            "properties": {
              "brand": {
                "type": "string",
                "example": "visa"
              },
              "last4": {
                "type": "string",
                "example": "4242"
              },
              "expMonth": {
                "type": "string",
                "example": "12"
              },
              "expYear": {
                "type": "string",
                "example": "2028"
              },
              "funding": {
                "type": "string",
                "enum": [
                  "credit",
                  "debit",
                  "prepaid",
                  "unknown"
                ]
              }
            }
          },
          "bank": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "example": "Chase"
              },
              "last4": {
                "type": "string",
                "example": "6789"
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentMethodSetupResponse": {
        "type": "object",
        "description": "Response when initiating payment method setup",
        "required": [
          "object",
          "id",
          "setupIntentClientSecret"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "payment_method_setup"
          },
          "id": {
            "type": "string",
            "description": "Payment method ID for tracking"
          },
          "setupIntentClientSecret": {
            "type": "string",
            "description": "Stripe SetupIntent client secret for completing setup"
          }
        }
      },
      "MobilePayment": {
        "type": "object",
        "description": "Payment/billing history entry",
        "required": [
          "object",
          "id",
          "status",
          "currency",
          "totalAmount"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "payment"
          },
          "id": {
            "type": "string",
            "example": "inv_abc123"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "open",
              "paid",
              "void",
              "uncollectible"
            ]
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "totalAmount": {
            "type": "string",
            "description": "Amount in cents",
            "example": "5000"
          },
          "amountDue": {
            "type": "string",
            "example": "0"
          },
          "saleDate": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "example": "Unlimited Monthly Membership"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Error response",
        "required": [
          "object",
          "status",
          "type",
          "code",
          "message"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "error"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code",
            "example": 400
          },
          "type": {
            "type": "string",
            "description": "Error category",
            "enum": [
              "authentication_error",
              "invalid_request_error",
              "rate_limit_error",
              "api_error"
            ]
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code",
            "example": "AUTH_INVALID_CREDENTIALS"
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "suggestion": {
            "type": "string",
            "description": "Actionable suggestion for fixing the error"
          }
        }
      },
      "SiteVersionCheck": {
        "type": "object",
        "description": "Response from site version check endpoint",
        "required": [
          "success",
          "isV2"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "isV2": {
            "type": "boolean",
            "description": "Whether the site is V2 enabled"
          },
          "siteId": {
            "type": [
              "string",
              "null"
            ],
            "description": "V2 site ID if available"
          },
          "corporateId": {
            "type": [
              "string",
              "null"
            ],
            "description": "V2 corporate ID if available"
          }
        }
      },
      "WidgetAuthResponse": {
        "type": "object",
        "description": "Authentication response with token",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "token": {
                "type": "string",
                "description": "JWT access token"
              },
              "refreshToken": {
                "type": "string",
                "description": "Refresh token for obtaining new access tokens"
              },
              "clientId": {
                "type": "string",
                "description": "Client ID"
              }
            }
          },
          "errorCode": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "WidgetSiteDetails": {
        "type": "object",
        "description": "Site/location details",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "siteId": {
                "type": "string"
              },
              "siteName": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "logoUrl": {
                "type": "string"
              }
            }
          }
        }
      },
      "WidgetSession": {
        "type": "object",
        "description": "V1-format session object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "sessionName": {
            "type": "string"
          },
          "sessionDate": {
            "type": "string",
            "format": "date"
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "duration": {
            "type": "integer"
          },
          "capacity": {
            "type": "integer"
          },
          "bookedCount": {
            "type": "integer"
          },
          "waitlistCapacity": {
            "type": "integer"
          },
          "waitlistCount": {
            "type": "integer"
          },
          "sessionStatus": {
            "type": "string",
            "enum": [
              "open",
              "waitlist",
              "full",
              "cancelled",
              "complete"
            ]
          },
          "bookingStatus": {
            "type": "string",
            "enum": [
              "",
              "booked",
              "waitlisted",
              "cancelled"
            ]
          },
          "instructorData": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "roomName": {
            "type": "string"
          }
        }
      },
      "WidgetPackage": {
        "type": "object",
        "description": "V1-format package for purchase",
        "properties": {
          "packageId": {
            "type": "string"
          },
          "packageName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "credits": {
            "type": "integer"
          },
          "validityDays": {
            "type": "integer"
          },
          "isIntroOffer": {
            "type": "boolean"
          }
        }
      },
      "WidgetCheckoutRequest": {
        "type": "object",
        "description": "Request body for checkout/booking",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Session ID to book"
          },
          "packageId": {
            "type": "string",
            "description": "Package ID to purchase"
          },
          "paymentMethodId": {
            "type": "string",
            "description": "Payment method to charge"
          },
          "promoCode": {
            "type": "string",
            "description": "Optional promo code"
          }
        }
      },
      "WidgetSuccessResponse": {
        "type": "object",
        "description": "Generic success response",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "MobileSessionList": {
        "type": "object",
        "description": "Paginated list of MobileSession (auto-generated wrapper — verify shape against actual route response).",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileSession"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MobileBookingList": {
        "type": "object",
        "description": "Paginated list of MobileBooking (auto-generated wrapper — verify shape against actual route response).",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileBooking"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MobilePackageList": {
        "type": "object",
        "description": "Paginated list of MobilePackage (auto-generated wrapper — verify shape against actual route response).",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobilePackage"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AvailablePackageList": {
        "type": "object",
        "description": "Paginated list of AvailablePackage (auto-generated wrapper — verify shape against actual route response).",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailablePackage"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MobilePaymentMethodList": {
        "type": "object",
        "description": "Paginated list of MobilePaymentMethod (auto-generated wrapper — verify shape against actual route response).",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobilePaymentMethod"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MobilePaymentList": {
        "type": "object",
        "description": "Paginated list of MobilePayment (auto-generated wrapper — verify shape against actual route response).",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobilePayment"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}