{
  "openapi": "3.0.3",
  "info": {
    "title": "Marlboro Tweaks Public API",
    "description": "Read-only public endpoints backing marlborotweaks.com. All endpoints listed here are unauthenticated and safe to call from a browser or agent. Endpoints that require a signed-in session (cart, orders, tickets, admin) are intentionally not documented here.",
    "version": "1.0.0",
    "contact": { "email": "BuisnessCo@outlook.de" }
  },
  "servers": [{ "url": "https://marlborotweaks.com/api" }],
  "paths": {
    "/products": {
      "get": {
        "summary": "List active products",
        "description": "Every currently active tweak/product in the shop, sorted by display order then price.",
        "responses": { "200": { "description": "Array of product objects (id, slug, name, desc, features, price, currency, icon, bestseller, videoEmbed)" } }
      }
    },
    "/products/{slug}": {
      "get": {
        "summary": "Get one product by slug",
        "parameters": [{ "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Single product object" }, "404": { "description": "Not found" } }
      }
    },
    "/products/{slug}/reviews": {
      "get": {
        "summary": "Approved reviews for one product",
        "parameters": [{ "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Array of approved review objects plus a computed average rating" } }
      }
    },
    "/reviews": {
      "get": {
        "summary": "Approved reviews across every product",
        "responses": { "200": { "description": "Array of approved review objects" } }
      }
    },
    "/team": {
      "get": {
        "summary": "Live team roster",
        "description": "Discord staff roles and members, grouped by role.",
        "responses": { "200": { "description": "{ ok, groups: [{ label, members: [{ discordId, username, avatar, ... }] }] }" } }
      }
    },
    "/users/{discordId}": {
      "get": {
        "summary": "Public profile",
        "description": "Discord username/avatar plus role, VIP status and public badges for one account. Never returns e-mail, orders, tickets, licenses, ban status or IP/HWID.",
        "parameters": [{ "name": "discordId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "{ ok, discordId, username, avatarHash, memberSince, isStaff, roleName, isVip, badges }" }, "404": { "description": "Not found" } }
      }
    },
    "/community-stats": {
      "get": {
        "summary": "Live Discord member count and tweaks-delivered counter",
        "responses": { "200": { "description": "{ discordMembers, tweaksDelivered }" } }
      }
    },
    "/download/info": {
      "get": {
        "summary": "Current installer metadata",
        "responses": { "200": { "description": "{ available, filename, version, size, uploadedAt }" } }
      }
    },
    "/announcements": {
      "get": {
        "summary": "Active site announcements",
        "responses": { "200": { "description": "Array of currently active announcement banners" } }
      }
    },
    "/maintenance": {
      "get": {
        "summary": "Maintenance-mode state",
        "responses": { "200": { "description": "{ enabled, message }" } }
      }
    },
    "/status-check": {
      "get": {
        "summary": "Current system status",
        "responses": { "200": { "description": "Live status of the shop's own subsystems, for status.html" } }
      }
    },
    "/uptime-history": {
      "get": {
        "summary": "Historical uptime data",
        "responses": { "200": { "description": "Uptime history backing status.html's timeline" } }
      }
    },
    "/bot-status": {
      "get": {
        "summary": "Discord bot online/offline state",
        "responses": { "200": { "description": "{ online }" } }
      }
    },
    "/health": {
      "get": {
        "summary": "Service health check",
        "description": "Confirms the database and KV bindings are reachable. Not authenticated, returns no sensitive data.",
        "responses": { "200": { "description": "{ ok, db, products_seeded, kv }" } }
      }
    }
  }
}
