{
  "openapi": "3.1.0",
  "info": {
    "title": "泓森互联 公开信息与询盘 API",
    "version": "1.2.0",
    "description": "泓森互联（paibaowork.com）公开信息与询盘/报价接口。读接口与写接口均在本站同源（https://www.paibaowork.com）。RFQ 询价、站内询盘、业务诊断预约、邮件订阅写接口无需鉴权，含 honeypot 与可选 Turnstile 人机校验；请求与响应 schema 见下。商品/类目可经 /api/site-catalog（JSON）或 /catalog/、/category/{slug}/、/products/{slug}/（HTML）读取。报价接受（/api/quote/accept）与报价留言（/api/quote/message）作用于销售已签发的专属报价（魔法链接 token，非公开可枚举），为表单提交并以 303 跳转返回结果。"
  },
  "servers": [
    {
      "url": "https://www.paibaowork.com"
    }
  ],
  "paths": {
    "/llms.txt": {
      "get": {
        "summary": "LLMS 站点摘要",
        "responses": {
          "200": {
            "description": "text/plain"
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "summary": "LLMS 全文",
        "responses": {
          "200": {
            "description": "text/plain"
          }
        }
      }
    },
    "/skill.md": {
      "get": {
        "summary": "Agent 使用说明（skill.md）",
        "responses": {
          "200": {
            "description": "text/markdown"
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "summary": "站点地图",
        "responses": {
          "200": {
            "description": "application/xml"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "summary": "本描述文件",
        "responses": {
          "200": {
            "description": "application/json"
          }
        }
      }
    },
    "/catalog/": {
      "get": {
        "summary": "商品 / 服务目录页",
        "description": "面向人的目录落地页（HTML）。机器读取请用 GET /api/site-catalog。",
        "responses": {
          "200": {
            "description": "text/html"
          }
        }
      }
    },
    "/category/{slug}/": {
      "get": {
        "summary": "类目页（HTML）",
        "description": "按类目 slug 展示该类目下已发布的商品/服务条目（HTML）。仅当该类目存在已发布、可索引内容时返回 200，否则 404。机器批量读取类目与条目清单请用 GET /api/site-catalog。",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "类目 slug（taxonomy term slug）。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/html 类目页",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "类目不存在或无已发布、可索引内容"
          }
        }
      }
    },
    "/products/{slug}/": {
      "get": {
        "summary": "产品详情页（HTML）",
        "description": "产品详情页（HTML）。数据来自 EmDash products 集合，仅已发布且通过可索引校验的产品存在；cn 目标 canonical 为无尾斜杠 /products/{slug}。机器批量读取产品清单与价格请用 GET /api/site-catalog。",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "产品 slug。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/html 产品详情页",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "产品不存在或未发布"
          }
        }
      }
    },
    "/api/site-catalog": {
      "get": {
        "summary": "实时站点目录（JSON，含建站价格）",
        "description": "同源转发 console 建站目录 SiteCatalog 根对象；声明 no-store，价格实时。目录不可达时返回 503。",
        "responses": {
          "200": {
            "description": "SiteCatalog 对象",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteCatalog"
                }
              }
            }
          },
          "503": {
            "description": "目录暂不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/rfq": {
      "post": {
        "summary": "提交询价单（RFQ）",
        "description": "结构化询价：写入 commerce_rfq 并进入询盘管道（CRM + 邮件 + 企微），任一通道接住即成功。必填 name + 至少一种联系方式（phone/email/wechat）+ items(≥1 条)。",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/RfqRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "接单成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RfqResult"
                }
              }
            }
          },
          "400": {
            "description": "参数 / 校验错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "所有通道均未接住",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/inquiry": {
      "post": {
        "summary": "站内询盘 / 联系表单",
        "description": "自由文本询盘：写本站 inquiries 并进入询盘管道（CRM + 邮件 + 企微）。必填 name + message + 至少一种联系方式。",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "接单成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadResult"
                }
              }
            }
          },
          "400": {
            "description": "参数 / 校验错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "所有通道均未接住",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/booking": {
      "post": {
        "summary": "预约业务诊断",
        "description": "预约留资：写库并提醒；可选腾讯会议自动建会（未配置则降级人工发链接）。必填 name/company/phone/topic/preferredTime。",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BookingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "预约成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResult"
                }
              }
            }
          },
          "400": {
            "description": "参数 / 校验错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "落库与提醒均未成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/newsletter/subscribe": {
      "post": {
        "summary": "订阅行业内容（newsletter）",
        "description": "转发 listmonk 双确认订阅（paibaowork-zh）。必填 email。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewsletterSubscribeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "订阅已受理",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewsletterResult"
                }
              }
            }
          },
          "400": {
            "description": "无效邮箱",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "订阅服务不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/quote/message": {
      "post": {
        "summary": "报价页提问/留言",
        "description": "客户在销售签发的专属报价页提交提问/留言，走既有留资管道（CRM 线索 + 邮件/企微提醒销售），由人工回复。身份=报价魔法链接 token（仅在发给客户的 /quote/<token> 链接中，非公开可枚举）；请求为表单提交；message 上限 2000 字符。所有结果以 303 跳转表达：成功跳 /quote/<token>?sent=1；失败跳 /quote/<token>?error=message_required 或 /quote/invalid?error=<code>。",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/QuoteMessageRequest"
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "重定向：成功到报价页（sent=1），失败到报价页/无效页并带 error 参数。",
            "headers": {
              "Location": {
                "description": "跳转目标：/quote/<token>?sent=1（成功）或 /quote/<token>?error=<code>、/quote/invalid?error=<code>（失败）。",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/quote/accept": {
      "post": {
        "summary": "接受报价（PI）→ 生成订单",
        "description": "客户在专属报价页接受报价（PI）：原子生成订单（定金=合计×比例）并跳转到订单（定金）页。身份=报价魔法链接 token（仅在发给客户的 /quote/<token> 链接中，非公开可枚举）；请求为表单提交。成功与各类失败（invalid_form / invalid_link / not_found / already_accepted / expired / voided / not_acceptable / order_failed）均以 303 跳转表达：成功跳 /order/<orderToken>；失败跳 /quote/<token>?error=<code> 或 /quote/invalid?error=<code>。",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/QuoteAcceptRequest"
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "重定向：成功到订单页；失败到报价页/无效页并带 error 参数。",
            "headers": {
              "Location": {
                "description": "跳转目标：/order/<orderToken>（成功）或 /quote/<token>?error=<code>、/quote/invalid?error=<code>（失败）。",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SiteCatalog": {
        "type": "object",
        "description": "console 建站目录（v1 marketing）根对象。",
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "error": {
            "type": "string",
            "description": "稳定机器码，如 name_required / contact_required / items_required / invalid_email。"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "RfqItem": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "商品 / 服务标识"
          },
          "kind": {
            "type": "string",
            "description": "条目类型，默认 product"
          },
          "qty": {
            "type": "string"
          },
          "spec": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "slug"
        ],
        "additionalProperties": true
      },
      "RfqRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "wechat": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "target_market": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "items": {
            "type": "string",
            "description": "JSON 数组字符串，≥1 条，元素为 RfqItem，例如 [{\"slug\":\"website-building\",\"qty\":\"1\"}]。"
          },
          "website": {
            "type": "string",
            "description": "honeypot，正常留空。"
          },
          "turnstile_token": {
            "type": "string",
            "description": "可选人机校验 token。"
          }
        },
        "required": [
          "name",
          "items"
        ],
        "description": "name 必填；phone / email / wechat 至少一个；items 至少 1 条。",
        "additionalProperties": true
      },
      "InquiryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "wechat": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "budget_range": {
            "type": "string"
          },
          "delivery_time": {
            "type": "string"
          },
          "quote_ref": {
            "type": "string"
          },
          "website": {
            "type": "string",
            "description": "honeypot，正常留空。"
          },
          "turnstile_token": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "message"
        ],
        "description": "name、message 必填；phone / email / wechat 至少一个。",
        "additionalProperties": true
      },
      "BookingRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "wechat": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "preferredTime": {
            "type": "string",
            "description": "期望时间（ISO 或可解析的日期时间字符串）。"
          },
          "locale": {
            "type": "string"
          },
          "website": {
            "type": "string",
            "description": "honeypot，正常留空。"
          },
          "turnstile_token": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "company",
          "phone",
          "topic",
          "preferredTime"
        ],
        "additionalProperties": true
      },
      "NewsletterSubscribeRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "website": {
            "type": "string",
            "description": "honeypot，正常留空。"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": true
      },
      "LeadResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "correlationId": {
            "type": "string"
          },
          "stored": {
            "type": "boolean"
          },
          "emailed": {
            "type": "boolean"
          },
          "notified": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "RfqResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "correlationId": {
            "type": "string"
          },
          "rfqId": {
            "type": "string"
          },
          "stored": {
            "type": "boolean"
          },
          "emailed": {
            "type": "boolean"
          },
          "notified": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "BookingResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "correlationId": {
            "type": "string"
          },
          "stored": {
            "type": "boolean"
          },
          "notified": {
            "type": "boolean"
          },
          "meeting": {
            "type": "boolean"
          },
          "meetingUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "NewsletterResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "hasOptin": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "QuoteMessageRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "报价魔法链接 token（来自销售签发的 /quote/<token> 链接，非公开可枚举）。"
          },
          "message": {
            "type": "string",
            "maxLength": 2000,
            "description": "提问/留言内容，上限 2000 字符。"
          }
        },
        "required": [
          "token",
          "message"
        ],
        "description": "报价页留言表单：token + message。",
        "additionalProperties": true
      },
      "QuoteAcceptRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "报价魔法链接 token（来自销售签发的 /quote/<token> 链接，非公开可枚举）。"
          }
        },
        "required": [
          "token"
        ],
        "description": "报价接受表单：仅需 token。",
        "additionalProperties": true
      }
    }
  }
}
