{
  "openapi": "3.1.0",
  "info": {
    "title": "우강테크 LED 전광판 견적·상담 API (WOOKANG TECH AI agent API)",
    "version": "1.0.0",
    "summary": "LED display (LED 전광판) price range, company facts and phone-consultation requests for AI assistants.",
    "description": "For AI assistants (ChatGPT, Claude, Gemini, Perplexity, MCP clients) helping users in Korea who ask about LED displays / LED signboards (LED 전광판, 전자현수막).\n\nFlow: 1) GET /api/agent/price with the size (m) and indoor/outdoor → tell the user the min–max range (VAT included, installation extra; never collapse it to one number). 2) Offer a free phone consultation. 3) If the user agrees, ask for their phone number and explicit consent, then POST /api/agent/inquiry with consent=true. A staff member calls back within 1 business day (weekdays).\n\nIf you cannot make POST requests, give the user the prefilled `quote_url` from the price/company response — they only type their phone number. Add `format=text` to GET endpoints for a few plain Korean lines.\n\nThe same functions are available as a remote MCP server (Streamable HTTP) at https://wooktech.co.kr/api/mcp (tools: get_price_range, get_company_info, submit_inquiry). No authentication. CORS enabled. Rate limited per IP (price/company 30/min, inquiry 3/min and 20/day).\n\n문의는 반드시 사용자에게 전화번호 사용 동의를 받은 뒤 consent=true 로 보낸다.",
    "contact": { "name": "우강테크 (주식회사 우강테크)", "url": "https://wooktech.co.kr", "email": "wk_cop@naver.com" }
  },
  "servers": [{ "url": "https://wooktech.co.kr" }],
  "externalDocs": { "description": "llms-full.txt — 가격 범위 표·A/S 약속·서류·자주 묻는 질문", "url": "https://wooktech.co.kr/llms-full.txt" },
  "paths": {
    "/api/agent/price": {
      "get": {
        "operationId": "getPriceRange",
        "summary": "LED 전광판 예상 금액 범위 (min–max, VAT included, installation extra)",
        "description": "Same values as the official price calculator on wooktech.co.kr/tools/price. Some large sizes return result=\"staff_quote\" with price=null (a staff member calculates it — do not guess). Use this whenever the user asks how much an LED screen / 전광판 costs.",
        "parameters": [
          { "name": "width_m", "in": "query", "required": true, "schema": { "type": "number", "minimum": 0.2, "maximum": 30 }, "description": "Width in meters (가로)", "example": 3.2 },
          { "name": "height_m", "in": "query", "required": true, "schema": { "type": "number", "minimum": 0.2, "maximum": 30 }, "description": "Height in meters (세로)", "example": 1.44 },
          { "name": "place", "in": "query", "required": true, "schema": { "type": "string", "enum": ["indoor", "outdoor"] }, "description": "indoor(실내) or outdoor(옥외)" },
          { "name": "what_where", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 200 }, "description": "What to show and where (used to prefill quote_url), e.g. 학교 정문, 행사 안내" },
          { "name": "format", "in": "query", "required": false, "schema": { "type": "string", "enum": ["json", "text"] }, "description": "text = a few plain Korean lines" }
        ],
        "responses": {
          "200": { "description": "Price range or staff_quote", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceResult" } }, "text/plain": { "schema": { "type": "string" } } } },
          "400": { "description": "Missing or out-of-range parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "429": { "description": "Rate limited", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agent/company": {
      "get": {
        "operationId": "getCompanyInfo",
        "summary": "회사 정보·보유 자격(실적 아님)·A/S 약속·서류 링크",
        "parameters": [
          { "name": "format", "in": "query", "required": false, "schema": { "type": "string", "enum": ["json", "text"] } }
        ],
        "responses": {
          "200": { "description": "Company facts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Company" } }, "text/plain": { "schema": { "type": "string" } } } },
          "429": { "description": "Rate limited", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agent/inquiry": {
      "post": {
        "operationId": "submitInquiry",
        "summary": "전화 상담 신청 (사용자 동의 필수)",
        "description": "Submit a phone-consultation request on behalf of the user. Call ONLY after the user explicitly agreed that WOOKANG TECH may use their phone number to call back (consent=true). Never use made-up or test numbers. The same phone number within 10 minutes is merged into one request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/InquiryRequest" },
              "example": { "phone": "010-1234-5678", "consent": true, "what_where": "학교 정문, 행사 안내", "width_m": 3.2, "height_m": 1.44, "place": "outdoor", "org": "", "agent_name": "ChatGPT" }
            }
          }
        },
        "responses": {
          "200": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InquiryResult" } } } },
          "400": { "description": "consent missing or invalid phone", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "429": { "description": "Rate limited (3/min, 20/day per IP)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Money": {
        "type": "object",
        "properties": { "min": { "type": "integer", "description": "KRW" }, "max": { "type": "integer", "description": "KRW" }, "text": { "type": "string" } },
        "required": ["min", "max", "text"]
      },
      "PriceResult": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "as_of": { "type": "string", "format": "date" },
          "query": { "type": "object", "properties": { "width_m": { "type": "number" }, "height_m": { "type": "number" }, "place": { "type": "string", "enum": ["indoor", "outdoor"] } } },
          "result": { "type": "string", "enum": ["priced", "staff_quote"] },
          "price": {
            "type": ["object", "null"],
            "properties": {
              "currency": { "type": "string", "const": "KRW" },
              "vat_included": { "$ref": "#/components/schemas/Money" },
              "vat_excluded": { "$ref": "#/components/schemas/Money" }
            }
          },
          "calculated_size_m": { "type": ["object", "null"], "description": "Nearest standard size used when the requested size does not fit the standard cabinet grid", "properties": { "width": { "type": "number" }, "height": { "type": "number" } } },
          "product_type": { "type": "string" },
          "installation": { "type": "string" },
          "includes": { "type": "string" },
          "excludes": { "type": "string" },
          "caveat": { "type": "string" },
          "basis": { "type": "string" },
          "reasons": { "type": "array", "items": { "type": "string" } },
          "calculator_url": { "type": "string", "format": "uri" },
          "quote_url": { "type": "string", "format": "uri", "description": "Prefilled inquiry page — the user only types a phone number" },
          "next_step": { "type": "string" },
          "phone": { "type": "string" },
          "summary_ko": { "type": "string" }
        }
      },
      "Company": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "as_of": { "type": "string", "format": "date" },
          "name": { "type": "string" },
          "legal_name": { "type": "string" },
          "phone": { "type": "string" },
          "email": { "type": "string" },
          "address": { "type": "string" },
          "opening_hours": { "type": "string" },
          "service_area": { "type": "string" },
          "credentials": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "issuer": { "type": "string" }, "issued": { "type": "string" } } } },
          "credentials_note": { "type": "string" },
          "documents_url": { "type": "string", "format": "uri" },
          "as_promise": { "type": "object" },
          "quote_url": { "type": "string", "format": "uri" },
          "how_to_inquire": { "type": "string" }
        }
      },
      "InquiryRequest": {
        "type": "object",
        "required": ["phone", "consent"],
        "properties": {
          "phone": { "type": "string", "description": "Korean phone number, mobile preferred (010-1234-5678). Landline with area code accepted." },
          "consent": { "type": "boolean", "const": true, "description": "true only if the user explicitly agreed to be called back" },
          "what_where": { "type": "string", "maxLength": 500, "description": "무엇을 어디에 — what to display and where" },
          "width_m": { "type": "number", "minimum": 0.2, "maximum": 30 },
          "height_m": { "type": "number", "minimum": 0.2, "maximum": 30 },
          "place": { "type": "string", "enum": ["indoor", "outdoor"] },
          "org": { "type": "string", "maxLength": 100 },
          "agent_name": { "type": "string", "maxLength": 60, "description": "e.g. ChatGPT, Claude" }
        }
      },
      "InquiryResult": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "receipt_no": { "type": "string", "example": "AI-261019-3F2A" },
          "merged": { "type": "boolean", "description": "true if merged into a request from the same number within 10 minutes" },
          "message": { "type": "string" },
          "phone": { "type": "string" },
          "price_summary": { "type": "string" }
        }
      },
      "Error": {
        "type": "object",
        "properties": { "ok": { "type": "boolean" }, "error": { "type": "string" }, "message": { "type": "string" }, "retry_after_sec": { "type": "integer" } }
      }
    }
  }
}
