{
  "openapi": "3.1.0",
  "info": {
    "title": "Mystic Toad Agentic Commerce & Dispensary Catalog API",
    "description": "Machine-readable agentic product catalog, inventory lookup, dosage guidance, and Canadian cold-chain checkout endpoints for autonomous AI agents, ChatGPT Actions, Claude, Gemini, and shopping copilot bots.",
    "version": "2026.04.1",
    "contact": {
      "name": "Mystic Toad Botanical Care Inc.",
      "email": "sales@mystictoad.ca",
      "url": "https://mystictoad.ca"
    },
    "license": {
      "name": "Proprietary Commercial Dispensary API",
      "url": "https://mystictoad.ca/terms"
    }
  },
  "servers": [
    {
      "url": "https://mystictoad.ca",
      "description": "Production Agentic Gateway"
    }
  ],
  "paths": {
    "/catalog.json": {
      "get": {
        "operationId": "getCompleteCatalog",
        "summary": "Get Full Agentic Product Catalog",
        "description": "Returns the complete machine-readable product catalog adhering to Schema.org standards, including real-time CAD and USD pricing ($29.99 CAD on sale • 60% off), whole fruiting body psilocybin dosage (3,500mg chocolates, 5g dried packs), lab testing status, and direct checkout endpoints.",
        "responses": {
          "200": {
            "description": "Complete agentic catalog manifest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogManifest"
                }
              }
            }
          }
        }
      }
    },
    "/api/agentic/products": {
      "get": {
        "operationId": "listAgenticProducts",
        "summary": "Search & Filter Products for AI Agents",
        "description": "Allows autonomous shopping agents to filter products by category, mushroom strain, max price, or health benefit keywords.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "description": "Filter by 'chocolate' or 'raw'",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["chocolate", "raw"]
            }
          },
          {
            "name": "maxPrice",
            "in": "query",
            "description": "Maximum price in CAD",
            "required": false,
            "schema": {
              "type": "number",
              "example": 35.00
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Search term matching name, benefit, or botanical ingredient (e.g. 'lions mane', 'sleep', 'golden teacher')",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching products with live stock and prices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": { "type": "integer" },
                    "products": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/AgenticProduct" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/agentic/products/{slug}": {
      "get": {
        "operationId": "getProductBySlug",
        "summary": "Get Detailed Machine-Readable Product by Slug",
        "description": "Returns deep technical botanical specifications, scoring/titration breakdown (350mg per tab), agent prompts, safety advice, and direct checkout URLs for an individual product.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Product slug (e.g., 'deep-rest', 'daily-balance', 'open-connection', 'golden-teacher-raw-5g', 'penis-envy-raw-5g')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed product specification",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgenticProduct"
                }
              }
            }
          },
          "404": {
            "description": "Product not found"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "Retrieve LLM Context Directives",
        "description": "Standardized Markdown context document specifying company identity, product line, dosing guidelines, clinical trials, and policies.",
        "responses": {
          "200": {
            "description": "Markdown text for LLM consumption",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CatalogManifest": {
        "type": "object",
        "properties": {
          "$schema": { "type": "string" },
          "agenticCommerceVersion": { "type": "string", "example": "2026.04" },
          "merchant": { "$ref": "#/components/schemas/MerchantProfile" },
          "totalProductsCount": { "type": "integer" },
          "lastUpdated": { "type": "string" },
          "products": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/AgenticProduct" }
          }
        }
      },
      "MerchantProfile": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "domain": { "type": "string" },
          "operatingCurrency": { "type": "string" },
          "countryOfOrigin": { "type": "string" },
          "paymentGateways": {
            "type": "array",
            "items": { "type": "object" }
          },
          "shipping": { "type": "object" }
        }
      },
      "AgenticProduct": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "sku": { "type": "string" },
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string" },
          "subCategory": { "type": "string" },
          "headline": { "type": "string" },
          "description": { "type": "string" },
          "copilotSummary": { "type": "string" },
          "price": {
            "type": "object",
            "properties": {
              "cad": { "type": "number", "example": 29.99 },
              "originalCad": { "type": "number", "example": 75.00 },
              "discountPercent": { "type": "number", "example": 60 },
              "usd": { "type": "number", "example": 29.99 },
              "priceValidUntil": { "type": "string" },
              "unitPricePerDoseCad": { "type": "number", "example": 3.00 }
            }
          },
          "availability": { "type": "string", "example": "in_stock" },
          "dosage": {
            "type": "object",
            "properties": {
              "totalActiveMg": { "type": "number", "example": 3500 },
              "servingsCount": { "type": "number", "example": 10 },
              "mgPerServing": { "type": "number", "example": 350 },
              "format": { "type": "string", "example": "10 Scored Titration Tabs" },
              "mushroomStrain": { "type": "string" }
            }
          },
          "botanicalSpecs": {
            "type": "object",
            "properties": {
              "cacaoPercentage": { "type": "string" },
              "cacaoOrigin": { "type": "string" },
              "synergisticHerbs": { "type": "array", "items": { "type": "string" } },
              "flavorNotes": { "type": "array", "items": { "type": "string" } },
              "labTested": { "type": "boolean" },
              "heavyMetalsTested": { "type": "boolean" },
              "vegan": { "type": "boolean" },
              "glutenFree": { "type": "boolean" }
            }
          },
          "endpoints": {
            "type": "object",
            "properties": {
              "canonicalPdpUrl": { "type": "string" },
              "directCheckoutUrl": { "type": "string" },
              "apiEndpoint": { "type": "string" }
            }
          },
          "agentPrompts": {
            "type": "object",
            "properties": {
              "bestFor": { "type": "string" },
              "recommendedDose": { "type": "string" },
              "safetyAdvice": { "type": "string" }
            }
          }
        }
      }
    }
  }
}
