{
  "openapi": "3.0.0",
  "info": {
    "title": "BikeStylish Product Catalog API",
    "description": "Static JSON API for bikestylish.ro - Romanian bicycle parts, accessories, and equipment store. Updated daily from Sport X Team supplier feed. All data is served as static JSON files via GitHub Pages.",
    "version": "3.0.0",
    "contact": {
      "name": "BikeStylish",
      "url": "https://www.bikestylish.ro"
    }
  },
  "servers": [
    {
      "url": "https://endimion2k.github.io/bikestylish-catalog",
      "description": "GitHub Pages (Production)"
    }
  ],
  "paths": {
    "/api/index.json": {
      "get": {
        "summary": "Catalog Index",
        "description": "Returns catalog metadata, endpoint discovery information, and product schema. Start here to understand the API structure.",
        "responses": {
          "200": {
            "description": "Catalog index with endpoint information"
          }
        }
      }
    },
    "/api/stats.json": {
      "get": {
        "summary": "Catalog Statistics",
        "description": "Returns aggregate statistics: total products, categories, brands, price ranges, availability counts, and top brands.",
        "responses": {
          "200": {
            "description": "Catalog statistics"
          }
        }
      }
    },
    "/data/products_ai_enhanced_split/products_ai_enhanced_part_{part}.json": {
      "get": {
        "summary": "Product List (Paginated)",
        "description": "Returns a page of 250 products. Part numbers are zero-padded (01, 02, etc.). Check /api/index.json for total number of parts.",
        "parameters": [
          {
            "name": "part",
            "in": "path",
            "required": true,
            "description": "Part number, zero-padded (01, 02, 03, ...)",
            "schema": {
              "type": "string",
              "example": "01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product list with metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductPart"
                }
              }
            }
          }
        }
      }
    },
    "/data/categories_ai_enhanced_split/categories_ai_enhanced_part_01.json": {
      "get": {
        "summary": "All Categories",
        "description": "Returns all product categories with product counts.",
        "responses": {
          "200": {
            "description": "Category list"
          }
        }
      }
    },
    "/data/brands.json": {
      "get": {
        "summary": "All Brands",
        "description": "Returns all available brands/manufacturers.",
        "responses": {
          "200": {
            "description": "Brand list"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ProductPart": {
        "type": "object",
        "properties": {
          "last_updated": {
            "type": "string",
            "format": "date-time"
          },
          "total_products": {
            "type": "integer",
            "description": "Number of products in this part"
          },
          "part_info": {
            "type": "object",
            "properties": {
              "part_number": { "type": "integer" },
              "total_parts": { "type": "integer" },
              "product_range": { "type": "string" },
              "original_total": { "type": "integer" }
            }
          },
          "products": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Product" }
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "description": "SKU code (unique identifier)" },
          "sku": { "type": "string", "description": "Same as id" },
          "ean": { "type": "string", "description": "EAN barcode" },
          "name": { "type": "string", "description": "Product name (Romanian)" },
          "brand": { "type": "string", "description": "Manufacturer/brand name" },
          "category": { "type": "string", "description": "Main category name" },
          "category_path": { "type": "string", "description": "Full category hierarchy, e.g. 'COMPONENTE > Anvelope'" },
          "price": { "type": "number", "description": "Recommended retail price in RON" },
          "price_net": { "type": "number", "description": "Net price (without VAT) in RON" },
          "currency": { "type": "string", "enum": ["RON"] },
          "availability": { "type": "string", "enum": ["in_stock", "limited", "out_of_stock"] },
          "stock_quantity": { "type": "integer", "description": "Exact stock count" },
          "weight_kg": { "type": "number", "description": "Product weight in kilograms" },
          "url": { "type": "string", "format": "uri", "description": "Product page URL on bikestylish.ro" },
          "image": { "type": "string", "format": "uri", "description": "Main product image URL" },
          "images": { "type": "array", "items": { "type": "string", "format": "uri" }, "description": "All product image URLs" }
        },
        "required": ["id", "name", "brand", "category", "price", "availability"]
      }
    }
  }
}
