{
  "openapi": "3.1.0",
  "info": {
    "title": "Pomona Product Catalog API",
    "version": "1.0.0",
    "summary": "Public, read-only catalog of Pomona Organic Juices with live prices and availability.",
    "description": "Free and open. No API key, no authentication, CORS open to any origin. Purchases are completed by a human on pomonaorganic.com; this API does not expose cart or checkout operations. Please keep automated requests under 60 per minute.",
    "contact": {
      "name": "Pomona Organic Juices",
      "email": "info@pomonaorganic.com",
      "url": "https://www.pomonaorganic.com/contact"
    },
    "license": {
      "name": "Free to fetch and cite with attribution and a link to the product URL",
      "url": "https://www.pomonaorganic.com/.well-known/agent.json"
    }
  },
  "servers": [
    {
      "url": "https://snbtuvyzyiikedlmgmxr.supabase.co/functions/v1",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "AI/LLM usage guide",
    "url": "https://www.pomonaorganic.com/llms.txt"
  },
  "paths": {
    "/agent-catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Full product catalog",
        "description": "Returns every Pomona product with current price, availability, packaging, ingredients, nutrition, benefits and the URL where a human can buy it. Cached for 15 minutes.",
        "responses": {
          "200": {
            "description": "The catalog",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Catalog" }
              }
            }
          },
          "500": {
            "description": "Upstream catalog error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": { "error": { "type": "string" } }
                }
              }
            }
          }
        }
      }
    },
    "/agent-catalog/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Health check",
        "description": "Lightweight liveness check. Does not call upstream services.",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Health" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Health": {
        "type": "object",
        "required": ["status"],
        "properties": {
          "status": { "type": "string", "enum": ["ok"] },
          "service": { "type": "string" },
          "generated": { "type": "string", "format": "date-time" },
          "cached": { "type": "boolean" }
        }
      },
      "Catalog": {
        "type": "object",
        "required": ["merchant", "generated", "count", "products"],
        "properties": {
          "merchant": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "url": { "type": "string", "format": "uri" },
              "contact": { "type": "string" },
              "currency": { "type": "string" },
              "ships_to": { "type": "array", "items": { "type": "string" } }
            }
          },
          "generated": { "type": "string", "format": "date-time" },
          "count": { "type": "integer" },
          "checkout": {
            "type": "object",
            "properties": {
              "type": { "type": "string", "enum": ["redirect"] },
              "note": { "type": "string" }
            }
          },
          "products": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Product" }
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "flavor": { "type": "string" },
          "slug": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "description": { "type": ["string", "null"] },
          "packaging": { "type": "string", "examples": ["12 x 8.4 fl oz (250 mL) BPA-free glass bottles"] },
          "ingredients": { "type": ["array", "string", "null"] },
          "nutrition": { "type": ["object", "null"] },
          "benefits": { "type": ["array", "null"] },
          "certifications": { "type": ["array", "null"] },
          "price": { "type": "string", "examples": ["49.99"] },
          "currency": { "type": "string", "examples": ["USD"] },
          "availability": {
            "type": "string",
            "enum": ["in_stock", "out_of_stock", "coming_soon"]
          },
          "shipping": { "type": "string" },
          "purchase_url": { "type": "string", "format": "uri" }
        }
      }
    }
  }
}
