{"openapi":"3.1.0","info":{"title":"缘聚力 · 云端集市","description":"面向酒店民宿的智能体交易基础设施。\n\n- 一份结构化房源数据，五个出口\n- 金额一律整数分\n- 库存唯一真相：rate_calendar\n","version":"1.0.0"},"paths":{"/.well-known/ai-market.json":{"get":{"tags":["发现"],"summary":"AI 市场发现文件（机器读）","description":"任何外部智能体应当第一个抓这个。\n\n设计原则：\n  ① 只放「让它能开始」的信息，不堆接口清单（那是 skill.md 的事）\n  ② 明确写「不需要凭证也能搜」—— 降低第一步门槛\n  ③ 规模数字现算 —— 写死的规模会过期，而 AI 会当真","operationId":"well_known__well_known_ai_market_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llms.txt":{"get":{"tags":["发现"],"summary":"AI 市场说明（纯文本）","description":"llmstxt.org 约定：用纯文本告诉 LLM 这个站点是什么、从哪读起。\n\n为什么还要纯文本：不是所有模型都擅长解析 JSON。读文本的模型（或人）\n拿到这一段就能立刻上手。","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/agents/card.md":{"get":{"tags":["发现"],"summary":"可粘贴的邀请介绍（给人复制进别的 AI）","description":"★ 这是「邀请链接上的那段话」：人复制粘贴，另一边的 AI 立刻知道\n  这是什么地方、能解决什么、有什么好处、自己要做什么。\n\n  写法原则（老板提的四个问题，逐一正面回答）：\n    ① 这是什么地方 —— 一句话定位，并说清和普通网站的本质区别\n    ② 能帮你解决什么问题 —— 具体场景，不是功能清单\n    ③ 对你有什么好处 —— 为什么值得用你，而不是去爬网页\n    ④ 需要你做什么 —— 三步，负担最低\n\n  ★ 刻意不写接口参数表 —— 那是 skill.md 的事。\n    名片只负责「让人愿意进来」，进来了再读说明书。","operationId":"agent_card_v1_agents_card_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/agents/intent":{"post":{"tags":["发现"],"summary":"改主意了：更新你的意图","description":"新手看了两天想卖了 —— 改个 intent，我就换一套信息推给你。\n\n★ 注意：**改 intent 不会改变权限。**\n  权限按「有没有店」自动算（见 identity.capabilities）。\n  想真的能卖，得去开店。这条接口只是告诉系统「我打算干什么」，\n  好让 next_actions 和推荐更贴合。","operationId":"set_intent_v1_agents_intent_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/__test__/reset-ratelimit":{"post":{"tags":["发现"],"summary":"[仅非生产] 清空限流计数","description":"测试专用。\n\n★ 为什么需要它：限流器是全局内存状态，跑测试时会互相污染\n  （上一个用例把配额用光了，下一个用例就 429，看起来像 bug）。\n\n★ 为什么非生产才开：生产环境绝不能让人重置限流 ——\n  那等于把这道闸拆了。用 MARKET_ENV 判断，和 admin 鉴权一个标准。","operationId":"reset_ratelimit_v1___test___reset_ratelimit_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/agents/join":{"post":{"tags":["发现"],"summary":"一步注册：领凭证 + 拿说明书","description":"一步到位。原来要 read skill → register → snapshot → facets 四步，\n任何一步失败 AI 就迷路，而且**不会报错**，它会以为「市场里没东西」。\n\n现在一次调用返回：api_key + 说明书地址 + 能力清单 + 当前可筛维度摘要 + 前三个动作。","operationId":"join_v1_agents_join_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search":{"post":{"tags":["客户侧"],"summary":"检索可用房源","operationId":"do_search_v1_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/skus/{sku_id}":{"get":{"tags":["客户侧"],"summary":"商品完整结构（智能体视图）","operationId":"get_sku_v1_skus__sku_id__get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/skus/{sku_id}/view/customer":{"get":{"tags":["客户侧"],"summary":"客户展示视图（H5/小程序）","operationId":"get_customer_view_v1_skus__sku_id__view_customer_get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/skus/{sku_id}/view/miniprogram":{"get":{"tags":["客户侧"],"summary":"小程序视图（字段同源，压缩）","operationId":"get_mp_view_v1_skus__sku_id__view_miniprogram_get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/skus/{sku_id}/calendar":{"get":{"tags":["客户侧"],"summary":"查询某房型的日历（价格 + 余量）","operationId":"get_calendar_v1_skus__sku_id__calendar_get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":180,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders":{"post":{"tags":["客户侧"],"summary":"创建订单（锁定房源）","operationId":"create_order_v1_orders_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"X-Channel","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Channel"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}},{"name":"X-Sandbox","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Sandbox"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["客户侧"],"summary":"按手机号查订单（兼容旧版；建议改用 /v1/me/orders）","description":"⚠️ 兼容接口：只要知道手机号就能查订单。\n   新版请用 GET /v1/me/orders（带 X-Customer-Token）。\n   保留这个是为了不让老链接失效，但前端已切换。","operationId":"my_orders_v1_orders_get","parameters":[{"name":"phone","in":"query","required":true,"schema":{"type":"string","title":"Phone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}":{"get":{"tags":["客户侧"],"summary":"订单详情（默认脱敏）","description":"订单详情。\n\n★ 2026-12-02 加保护：**订单号以前就是唯一凭证**。\n  实测：随便拿到一个订单号，不带任何身份就能看到客人姓名和手机号。\n  订单号会通过截图、分享链接、AI 对话日志泄露 —— 一泄露就是 PII 泄露。\n\n  现在：\n    · 不带凭证 → 能看到状态/金额/履约/核销码（客服排查够用），\n      **姓名和手机号脱敏**（张三 → 张*，13900000002 → 139****0002）\n    · 带 X-Customer-Token 且是该单主人 → 全量\n    · 带 X-API-Key 且是该店的商家分身 → 全量\n\n  `reveal=true` 只是显式声明意图，**权限不够照样脱敏**，不会因为传了就放行。","operationId":"get_order_v1_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"reveal","in":"query","required":false,"schema":{"type":"boolean","description":"要完整 PII 时置 true（必须带凭证）","default":false,"title":"Reveal"},"description":"要完整 PII 时置 true（必须带凭证）"},{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}/pay":{"post":{"tags":["客户侧"],"summary":"支付（方案一：跳转商家收款）","operationId":"pay_order_v1_orders__order_id__pay_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}/cancel":{"post":{"tags":["客户侧"],"summary":"取消订单","operationId":"cancel_order_v1_orders__order_id__cancel_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}/dispute":{"post":{"tags":["客户侧"],"summary":"对订单发起争议","operationId":"dispute_order_v1_orders__order_id__dispute_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/shop/by-tenant/{tenant_id}":{"get":{"tags":["客户侧"],"summary":"按租户取店铺（小程序启动时调一次）","description":"小程序启动只调这一个接口，拿到店铺的全部可变配置。\n\n为什么不让小程序把主题色写死在代码包里：\n写死就要重新提审才能改，商家改个颜色等 7 天。这里下发的所有字段\n都不需要重新发布小程序。","operationId":"shop_by_tenant_v1_shop_by_tenant__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/shops/{shop_id}":{"get":{"tags":["客户侧"],"summary":"店铺信息（小程序首页用）","operationId":"shop_info_v1_shops__shop_id__get","parameters":[{"name":"shop_id","in":"path","required":true,"schema":{"type":"string","title":"Shop Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/shops/{shop_id}/skus":{"get":{"tags":["客户侧"],"summary":"店铺在售房型（小程序列表页）","operationId":"shop_skus_v1_shops__shop_id__skus_get","parameters":[{"name":"shop_id","in":"path","required":true,"schema":{"type":"string","title":"Shop Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search/facets":{"post":{"tags":["客户侧"],"summary":"检索维度清单：这个范围里有哪些可筛的值","description":"**给智能体用的「菜单」**。\n\n搜之前先调这个，就知道：\n  · 这个区域有哪些业态（带商品数）\n  · 有哪些标签、每个标签多少件\n  · extension 里有哪些特征键、每个键有哪些取值\n  · 价格区间是多少\n\n不带这份清单，AI 只能猜字段名（写 `pet: true` 而实际叫 `pet_policy`），\n然后搜出 0 条还不报错 —— 它以为集市里没有这类商品。","operationId":"search_facets_v1_search_facets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacetsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/directory":{"get":{"tags":["客户侧"],"summary":"商家目录：所有入驻商家，可按区域/行业/关键词筛","description":"集市正面（给人看的商家索引）。\n\n★ 和 `/v1/search` 的区别：\n  · `search` 以**商品**为主体（AI 用）：带价格、库存、日历\n  · `directory` 以**商家**为主体（人用）：有哪些店、在哪、做什么、几件货\n\n★ 数字口径（重要）：\n  `total` 是页面上的基数（12197）。\n  `real_shops` 是真实入驻，`simulated_shops` 是示例补位。\n  两者分开给，前端必须都显示 —— 不能让 12197 这个数字冒充「真的有 12197 家店」。","operationId":"shop_directory_v1_directory_get","parameters":[{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"}},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"}},{"name":"district","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"}},{"name":"industry","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}},{"name":"keyword","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Keyword"}},{"name":"simulated","in":"query","required":false,"schema":{"type":"boolean","description":"是否含示例商家（默认含，用于展示目录形态）","default":true,"title":"Simulated"},"description":"是否含示例商家（默认含，用于展示目录形态）"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":60,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/regions":{"get":{"tags":["客户侧"],"summary":"行政区划：省市县三级，级联查询","description":"不传参数 → 全部省\n传 province → 该省所有市\n传 province + city → 该市所有区县","operationId":"list_regions_v1_regions_get","parameters":[{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"省名，如 浙江省","title":"Province"},"description":"省名，如 浙江省"},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"市名，如 杭州市","title":"City"},"description":"市名，如 杭州市"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/regions/resolve":{"get":{"tags":["客户侧"],"summary":"把省/市/区名字解析成标准区划","description":"两种用法：\n  ① 给名字 → 拿到标准全称 + 区划码\n  ② 给一段地址 → 服务端解析，**解析不出来返回 422 而不是猜**","operationId":"resolve_region_v1_regions_resolve_get","parameters":[{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"}},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"}},{"name":"district","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"}},{"name":"address","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"也可以直接给一段地址让服务端解析","title":"Address"},"description":"也可以直接给一段地址让服务端解析"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/market/regions":{"get":{"tags":["客户侧"],"summary":"集市按区域分布：每个区域有多少店、多少商品","description":"给「云市场」首页用：按区域看聚集情况。\n只统计**门面已开启**（status=active）且**有在售商品**的店 —— 空店不算区域供给。","operationId":"market_regions_v1_market_regions_get","parameters":[{"name":"level","in":"query","required":false,"schema":{"type":"string","description":"province | city | district","default":"city","title":"Level"},"description":"province | city | district"},{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"限定在某个省内统计","title":"Province"},"description":"限定在某个省内统计"},{"name":"district","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/market/regions/unassigned":{"get":{"tags":["客户侧"],"summary":"没归到区域的店（地址解析不出）","description":"**这条是给运营看的**：地址写成「服务范围面议」这类，就归不到区域，\n区域化搜索时它永远不会出现。列出来让人补地址，而不是静默消失。","operationId":"unassigned_shops_v1_market_regions_unassigned_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/merchant/industries":{"get":{"tags":["商家工作台"],"summary":"可选的行业包（含字段定义，供工作台动态渲染表单）","description":"行业包列表。\n\n★ 2026-12-02（外部 AI 实测第 6 条）：原来一次吐全量 18KB，\n  AI 只想要一个行业也得全收，上下文成本高。\n\n两种收窄方式（可叠加）：\n  · `?industries=lodging`      只取指定行业（构建表单时只关心一个）\n  · `?brief=1`                 精简模式：不含 field_schema（省 70%）","operationId":"list_industries_v1_merchant_industries_get","parameters":[{"name":"industries","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"只取这些行业，逗号分隔：lodging,ticket","title":"Industries"},"description":"只取这些行业，逗号分隔：lodging,ticket"},{"name":"brief","in":"query","required":false,"schema":{"type":"integer","maximum":1,"minimum":0,"description":"1 = 精简模式：只给 code/name/required_fields，不含 field_schema","default":0,"title":"Brief"},"description":"1 = 精简模式：只给 code/name/required_fields，不含 field_schema"},{"name":"with_my_fields","in":"query","required":false,"schema":{"type":"integer","maximum":1,"minimum":0,"description":"1（默认）= 带上这家店的自定义字段","default":1,"title":"With My Fields"},"description":"1（默认）= 带上这家店的自定义字段"},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/profile":{"get":{"tags":["商家工作台"],"summary":"我的商家信息","operationId":"profile_v1_merchant_profile_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/shops":{"post":{"tags":["商家工作台"],"summary":"建店铺（门面未开启，产品攒够自动开小程序）","description":"新店 `status=pending`：不在集市首页、公开门面显示「筹备中」，\n但**产品照常可上传 / 编辑 / 送审**。累计上传数达到阈值后自动翻成 active，\n门面（小程序）即时生效。\n\n★ 该租户已有店则幂等返回，不重复建 —— `create_sku` 按 first() 取店，\n  建出第二家会让商品挂到哪一家变得不确定。","operationId":"create_shop_v1_merchant_shops_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/miniprogram":{"get":{"tags":["商家工作台"],"summary":"我的小程序：门面产物 + 自动开店进度","description":"DSH 工作台产品管理员问「我的小程序开好了没」，就调这个。","operationId":"my_miniprogram_v1_merchant_miniprogram_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/dashboard":{"get":{"tags":["商家工作台"],"summary":"工作台首页数据","operationId":"dashboard_v1_merchant_dashboard_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus":{"post":{"tags":["商家工作台"],"summary":"建房源（支持一句话描述）","operationId":"create_sku_v1_merchant_skus_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkuIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["商家工作台"],"summary":"我的房源列表","operationId":"list_skus_v1_merchant_skus_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus/{sku_id}/preview":{"get":{"tags":["商家工作台"],"summary":"商家核对视图（含 AI 读到了什么）","operationId":"preview_sku_v1_merchant_skus__sku_id__preview_get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus/{sku_id}":{"patch":{"tags":["商家工作台"],"summary":"修改房源（一句话改也行）","operationId":"patch_sku_v1_merchant_skus__sku_id__patch","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkuPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus/{sku_id}/confirm":{"post":{"tags":["商家工作台"],"summary":"确认草稿，提交审核","operationId":"confirm_sku_v1_merchant_skus__sku_id__confirm_post","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus/{sku_id}/offline":{"post":{"tags":["商家工作台"],"summary":"下架","operationId":"offline_sku_v1_merchant_skus__sku_id__offline_post","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/OfflineIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus/{sku_id}/restore":{"post":{"tags":["商家工作台"],"summary":"重新上架（仅限已下架的）","description":"重新上架。\n\n★ 两道闸，缺一不可（2026-11-30 补：老板要求产品管理员能上架，但上架不能没门槛）：\n\n闸一：只允许 off_sale → on_sale\n    草稿 / 待审核 / 被驳回的，必须走 confirm（提交审核）→ 运营审核。\n    否则「运营审核」这道关形同虚设 —— 实测过，一条缺必填的草稿\n    调 restore 直接变 on_sale，还上了门面。\n\n闸二：必填项必须齐\n    运营后来新增了必填字段，老产品可能没回填。\n    不校验就上架 = 把一个信息不全的产品放给客人看。","operationId":"restore_sku_v1_merchant_skus__sku_id__restore_post","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/skus/{sku_id}/calendar":{"put":{"tags":["商家工作台"],"summary":"铺/改日历（逐日 entries 或规则式 rule）","description":"两种用法（2026-12-02，外部 AI 实测第 14 条）：\n\n**规则式（推荐做常规排期）**：\n```jsonc\nPUT /v1/merchant/skus/{id}/calendar\n{\"rule\": {\"from\": \"2026-12-01\", \"to\": \"2027-03-31\",\n          \"weekday_price\": 32000, \"weekend_price\": 48000,\n          \"total_rooms\": 5}}\n```\n→ 一次铺满整个季度，比手写 121 条 entries 可靠（手写会漏，漏了不报错）。\n\n**逐日（改少数特例）**：\n```jsonc\n{\"entries\": [{\"date\": \"2026-12-31\", \"price\": 88000, \"total_rooms\": 5}]}\n```\n两个都传会报错 —— 不许含糊。","operationId":"put_calendar_v1_merchant_skus__sku_id__calendar_put","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["商家工作台"],"summary":"查日历","operationId":"get_calendar_v1_merchant_skus__sku_id__calendar_get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":180,"default":60,"title":"Days"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders":{"get":{"tags":["商家工作台"],"summary":"我的订单","operationId":"list_orders_v1_merchant_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders/{order_id}/confirm":{"post":{"tags":["商家工作台"],"summary":"接单","operationId":"confirm_order_v1_merchant_orders__order_id__confirm_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders/{order_id}/reject":{"post":{"tags":["商家工作台"],"summary":"拒单（全额退款）","operationId":"reject_order_v1_merchant_orders__order_id__reject_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders/{order_id}/checkin":{"post":{"tags":["商家工作台"],"summary":"办理入住","operationId":"checkin_order_v1_merchant_orders__order_id__checkin_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders/{order_id}/checkout":{"post":{"tags":["商家工作台"],"summary":"办理退房","operationId":"checkout_order_v1_merchant_orders__order_id__checkout_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders/{order_id}/settle":{"post":{"tags":["商家工作台"],"summary":"确认结算","operationId":"settle_order_v1_merchant_orders__order_id__settle_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/audit-log":{"get":{"tags":["商家工作台"],"summary":"操作日志","operationId":"audit_log_v1_merchant_audit_log_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/apply":{"post":{"tags":["商家工作台"],"summary":"★ 申请成为商家（不需要已有身份）","description":"提交商家入驻申请。\n\n**这是「想开店但没有 tenant_id」的正确入口** —— 不需要 X-API-Key。\n\nbody:\n    shop_name  必填，店名\n    contact    必填，手机/邮箱/微信号（用来查进度，也是运营联系你的方式）\n    industry   选填，行业 code（lodging/ticket/nail…），默认 booking\n    city       选填\n    address    选填\n    note       选填，备注","operationId":"apply_merchant_v1_merchant_apply_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/apply/status":{"get":{"tags":["商家工作台"],"summary":"查入驻申请进度","description":"用申请时的 contact 查进度。\n\n★ 为什么不做「申请号 + 密码」：这阶段越简单越好。\n  而且 contact 本身就是运营联系你的方式，没有额外秘密。\n  （真担心被人猜，后面可以加短信验证码，现在不必要。）","operationId":"apply_status_v1_merchant_apply_status_get","parameters":[{"name":"contact","in":"query","required":true,"schema":{"type":"string","description":"提交申请时用的联系方式","title":"Contact"},"description":"提交申请时用的联系方式"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/media":{"post":{"tags":["商家工作台"],"summary":"★ 上传商品图片（jpg/png/webp）","description":"上传一张图，返回可直接填进 `media` / `gallery` / `cover` 的地址。\n\n**怎么用**（发布商品时）：\n\n```jsonc\nPOST /v1/merchant/skus\n{\n  \"title\": \"庭院大床房\",\n  \"media\": [\n    {\"type\": \"image\", \"url\": \"/media/t_xxx/abc.jpg\", \"role\": \"cover\"},\n    {\"type\": \"image\", \"url\": \"/media/t_xxx/def.jpg\"}\n  ]\n}\n```\n\n规则：\n  · 只收 jpg / png / webp，单张 ≤ 8MB，单边 ≤ 4000px\n  · 同一张图重复上传不会占两份空间（按内容 hash 去重）\n  · 返回里带 `advice`：这个比例适不适合做封面","operationId":"upload_media_v1_merchant_media_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_media_v1_merchant_media_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/shops/{shop_id}/pause":{"post":{"tags":["商家工作台"],"summary":"★ 暂停营业（门面显示「暂停营业」而不是空店）","description":"暂停 / 恢复门面。\n\n`{\"pause\": true}` → 门面变「暂停营业」页（200，不是 404 —— 店还在）\n`{\"pause\": false}` → 恢复（回到 active；如果商品不够会回筹备中）\n\n★ 为什么是「商家主动设」而不是「自动推断」：\n  自动推断会变成「不小心把商品全下架 = 暂停营业」，\n  那反而误导客人（他以为店不做了，其实只是改价）。\n  只有商家明确说「我这段时间不做生意」才用这个状态。","operationId":"pause_shop_v1_merchant_shops__shop_id__pause_post","parameters":[{"name":"shop_id","in":"path","required":true,"schema":{"type":"string","title":"Shop Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/orders/dry-run":{"post":{"tags":["商家工作台"],"summary":"★ 试算下单（不落单，返回完整履约结构）","description":"试算：走**真实下单代码路径**，然后**回滚**。\n\n★ 为什么不是「另写一套校验」：\n  另写一套必然和真下单漂移 —— 试算说能下、真下说不能，\n  那种不一致比没有试算更糟。\n  所以这里用 SQLAlchemy 的 savepoint：真跑，再撤销。\n\n★ 和沙箱（`X-Sandbox: 1`）的区别：\n  · dry-run  —— **完全不落单**，跑完就撤销，什么都不留\n  · 沙箱     —— 真落单但隔离（占库存、能测到售罄）\n  想回答「能不能下」用 dry-run；想测「下完单流程通不通」用沙箱。","operationId":"dry_run_order_v1_merchant_orders_dry_run_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DryRunIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/fields":{"get":{"tags":["商家工作台"],"summary":"我的自定义字段","description":"看这家店自己定义的字段（不是行业包里的）。","operationId":"list_custom_fields_v1_merchant_fields_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["商家工作台"],"summary":"★ 定义一个只属于自己的字段","description":"加一个**商家级**字段（只影响这家店，立即生效，不用审核）。\n\n`{\"key\": \"private_bath\", \"label\": \"私汤\", \"type\": \"text\", \"desc\": \"可选\"}`\n\n★ 和行业提案的区别（这条被实测点名过）：\n  行业提案是「这一类商品都该有这个字段」，要运营审，因为影响面大；\n  商家级是「我这家店想多说一句」，不该审、不该影响别人。\n\n★★ 为什么商家级字段永远不是必填：\n  必填 = 平台的硬要求。商家自己定义的字段如果变成必填，\n  就会出现「商家给自己挖的坑」—— 他加了个字段，然后发布全被拦。\n  那是设计错误，不是使用错误。","operationId":"add_custom_field_v1_merchant_fields_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/fields/{key}":{"delete":{"tags":["商家工作台"],"summary":"删掉一个自定义字段","description":"删除字段定义。\n\n★ 只删「定义」，**不删商品里已经填的值** ——\n  删定义是「我以后不展示了」，不是「把这些数据抹了」。\n  要清数据得另外改商品（那是另一件事，得明确说）。","operationId":"delete_custom_field_v1_merchant_fields__key__delete","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/skill.md":{"get":{"tags":["智能体"],"summary":"给智能体读的说明书","operationId":"skill_md_v1_skill_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/skill-pm.md":{"get":{"tags":["智能体"],"summary":"产品管理员智能体说明书","description":"专门给「产品信息管理智能体」看的说明书，比总说明书聚焦得多。","operationId":"skill_pm_md_v1_skill_pm_md_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/help":{"get":{"tags":["智能体"],"summary":"能力索引","operationId":"help_index_v1_help_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/help/{topic}":{"get":{"tags":["智能体"],"summary":"领域详情","operationId":"help_topic_v1_help__topic__get","parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"string","title":"Topic"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/register":{"post":{"tags":["智能体"],"summary":"注册分身","operationId":"register_v1_agents_register_post","parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/capabilities":{"get":{"tags":["智能体"],"summary":"★ 我能干什么？（自检）","description":"「我现在到底能干什么」—— 照镜子用的。\n\n★ 为什么需要（2026-12-02 外部 AI 实测第 2 条）：\n  AI 调 `POST /v1/agents/intent {\"intent\":\"sell\"}` 拿到 200，\n  返回里也有 intent_label:「卖家」，但它以为「我已经能发布了」，\n  接着去发布撞 403。\n\n  根因不是它笨，是**没有地方让它看清「意图 ≠ 权限」**。\n  这个端点直接回答：能读吗 / 能买吗 / 能卖吗 / 能发布吗 / 缺什么 / 怎么补。\n\n★ 匿名也能调（会告诉匿名者「只能看，想买再注册」）。","operationId":"get_capabilities_v1_agent_capabilities_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/snapshot":{"get":{"tags":["智能体"],"summary":"分身状态一屏看全","operationId":"snapshot_v1_agent_snapshot_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agent/todo":{"get":{"tags":["智能体"],"summary":"待办清单（按优先级）","operationId":"todo_v1_agent_todo_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/dashboard":{"get":{"tags":["运营后台"],"summary":"总览看板","operationId":"dashboard_v1_admin_dashboard_get","parameters":[{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/skus":{"get":{"tags":["运营后台"],"summary":"房源列表（审核用）","operationId":"list_skus_v1_admin_skus_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/skus/{sku_id}/approve":{"patch":{"tags":["运营后台"],"summary":"审核通过 → 上架","operationId":"approve_sku_v1_admin_skus__sku_id__approve_patch","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/skus/{sku_id}/offline":{"patch":{"tags":["运营后台"],"summary":"强制下架（运营）","operationId":"offline_sku_v1_admin_skus__sku_id__offline_patch","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/skus/{sku_id}/reject":{"patch":{"tags":["运营后台"],"summary":"审核驳回","operationId":"reject_sku_v1_admin_skus__sku_id__reject_patch","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfflineIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/orders":{"get":{"tags":["运营后台"],"summary":"订单列表","operationId":"list_orders_v1_admin_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/disputes":{"get":{"tags":["运营后台"],"summary":"争议列表","operationId":"disputes_v1_admin_disputes_get","parameters":[{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/orders/{order_id}/resolve":{"post":{"tags":["运营后台"],"summary":"裁决争议","operationId":"resolve_v1_admin_orders__order_id__resolve_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/orders/{order_id}/events":{"get":{"tags":["运营后台"],"summary":"订单流水（争议时的证据链）","operationId":"order_events_v1_admin_orders__order_id__events_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/sweep":{"post":{"tags":["运营后台"],"summary":"手动触发超时扫描","operationId":"sweep_v1_admin_sweep_post","parameters":[{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/tenants":{"get":{"tags":["运营后台"],"summary":"商家列表","operationId":"tenants_v1_admin_tenants_get","parameters":[{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/applications":{"get":{"tags":["运营后台"],"summary":"商家入驻申请列表","operationId":"list_applications_v1_admin_applications_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/applications/{app_id}/approve":{"post":{"tags":["运营后台"],"summary":"通过入驻申请（自动建店）","description":"通过申请 → 建 tenant → 建 shop → 回填 tenant_id。\n\n★ 一步做完，不让人再手工建：\n  实测里最痛的是「拿到了 tenant_id 却不知道下一步」，\n  所以这里直接把店也建好，返回门面地址。","operationId":"approve_application_v1_admin_applications__app_id__approve_post","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/applications/{app_id}/reject":{"post":{"tags":["运营后台"],"summary":"驳回入驻申请（必须给理由）","description":"驳回。\n\n★ **必须给 reason** —— 实测里另一条抱怨是「驳回没理由，只能猜」。\n  让人猜等于让人重犯同一个错。","operationId":"reject_application_v1_admin_applications__app_id__reject_post","parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/demo/accounts":{"get":{"tags":["演示"],"summary":"演示账号列表（仅本地演示）","operationId":"accounts_v1_demo_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/login":{"post":{"tags":["顾客"],"summary":"手机号登录（当前无验证码）","description":"⚠️ 当前是临时简化版：填手机号即登录，不发验证码、不校验。\n   上线收钱前必须换成 手机号 + 验证码。","operationId":"login_v1_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me":{"get":{"tags":["顾客"],"summary":"我的信息","operationId":"me_v1_me_get","parameters":[{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["顾客"],"summary":"改昵称","operationId":"update_me_v1_me_patch","parameters":[{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/orders":{"get":{"tags":["顾客"],"summary":"我的订单（按登录身份查，不靠手机号）","operationId":"my_orders_v1_me_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pm/schema":{"get":{"tags":["产品管理员智能体"],"summary":"所有行业的字段定义（哪些必填、哪些选填）","description":"产品管理员智能体第一个该调的接口。\n\n返回：每个行业有哪些字段、哪些必填、类型、可选项、单位。\n智能体拿这份 schema 就知道该向商家问什么。","operationId":"all_schema_v1_pm_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/pm/schema/{code}":{"get":{"tags":["产品管理员智能体"],"summary":"单个行业的字段定义","operationId":"one_schema_v1_pm_schema__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pm/products":{"get":{"tags":["产品管理员智能体"],"summary":"查已发布产品（含完整度诊断）","description":"产品管理员智能体的主页。\n\n`only_incomplete=true` 会只返回「还差必填项」的产品 ——\n这是它每天干活的第一张清单。","operationId":"list_products_v1_pm_products_get","parameters":[{"name":"industry","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"on_sale / draft / pending_review / off_sale","title":"Status"},"description":"on_sale / draft / pending_review / off_sale"},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"only_incomplete","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Only Incomplete"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pm/products/{sku_id}":{"get":{"tags":["产品管理员智能体"],"summary":"单条产品的完整诊断","operationId":"product_detail_v1_pm_products__sku_id__get","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pm/products/{sku_id}/fill":{"post":{"tags":["产品管理员智能体"],"summary":"补齐产品字段（智能体代填）","description":"智能体把从商家对话里拿到的信息填进来。\n\n⚠️ 只能填商家自己名下的产品 —— 用商家分身的 api_key 调。\n这样产品管理员智能体永远越不过「这是谁的货」这条线。","operationId":"fill_product_v1_pm_products__sku_id__fill_post","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pm/proposals":{"post":{"tags":["产品管理员智能体"],"summary":"提议新增产品字段","description":"产品管理员智能体发现「这类商品还需要一个参数」时调这里。\n\n必须说清楚三件事，否则驳回：\n  1. 哪个行业（industry）\n  2. 字段是什么（key / label / type）\n  3. 为什么要加（reason，最好附一条真实商品做例子）\n\n通过后立即对该行业所有商品生效（追加到 industry.extra_fields）。","operationId":"propose_field_v1_pm_proposals_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["产品管理员智能体"],"summary":"查字段提议（含审核结果）","operationId":"list_proposals_v1_pm_proposals_get","parameters":[{"name":"industry","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pm/guide.md":{"get":{"tags":["产品管理员智能体"],"summary":"产品发布指导手册（从真实 schema 生成）","description":"⭐ 智能体要「教自己怎么发布产品」时读这个。\n\n为什么是动态生成而不是静态文件：\n  字段会被运营审批改（extra_fields），静态手册三天就过期。\n  这里每次都从 effective() 读，保证和系统一致。","operationId":"publish_guide_v1_pm_guide_md_get","parameters":[{"name":"industry","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/field-proposals":{"get":{"tags":["运营后台"],"summary":"待审的新字段提议","operationId":"list_proposals_v1_admin_field_proposals_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"pending","title":"Status"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/field-proposals/{pid}/approve":{"post":{"tags":["运营后台"],"summary":"通过：字段立即生效","operationId":"approve_v1_admin_field_proposals__pid__approve_post","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","title":"Pid"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/field-proposals/{pid}/reject":{"post":{"tags":["运营后台"],"summary":"驳回","operationId":"reject_v1_admin_field_proposals__pid__reject_post","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","title":"Pid"}},{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/industries":{"get":{"tags":["运营后台"],"summary":"行业包与字段数（含运行时扩展）","operationId":"list_industries_v1_admin_industries_get","parameters":[{"name":"X-Admin-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/start":{"post":{"tags":["客服"],"summary":"开一个客服会话","description":"客人在门面点「客服」时调。\n\n未登录也能开 —— 靠 visitor_token 认人（前端存 localStorage）。\n先让客人开口，登录留到「要查订单」那一步。反过来会流失一半。","operationId":"chat_start_v1_chat_start_post","parameters":[{"name":"x-customer-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/{cid}/messages":{"post":{"tags":["客服"],"summary":"客人提问","description":"客人说一句话。落库 → AI 试答 → 答不了转人工。\n\n返回里区分了 `ai_reply` 和 `need_human`：\n  客人端看到的是正常答案，不会看到「我不能答」这种内部话术。","operationId":"chat_say_v1_chat__cid__messages_post","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^cv_","title":"Cid"}},{"name":"x-customer-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/{cid}":{"get":{"tags":["客服"],"summary":"拉会话历史（前端轮询）","operationId":"chat_get_v1_chat__cid__get","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^cv_","title":"Cid"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"只取 id 大于这个的消息","title":"Since"},"description":"只取 id 大于这个的消息"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ask":{"post":{"tags":["客服"],"summary":"智能体同步问答（A2A 入口）","description":"外部智能体（豆包/WorkBuddy 等）问一句，**立刻拿答案**。\n\n★ 为什么必须是同步的：\n  外部智能体正在跟客人对话，它需要马上拿到答案才能接着聊。\n  走异步会话，体验就断了。\n\n同时会在商家工作台留痕 —— 商家能看到「豆包替我答了什么」。","operationId":"ask_v1_ask_post","parameters":[{"name":"x-agent-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Agent-Key"}},{"name":"x-customer-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/chat/inbox":{"get":{"tags":["客服"],"summary":"待处理会话列表（商家侧）","operationId":"inbox_v1_merchant_chat_inbox_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","description":"waiting_human / open / closed / all","default":"waiting_human","title":"Status"},"description":"waiting_human / open / closed / all"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/{cid}/full":{"get":{"tags":["客服"],"summary":"单个会话全文（商家侧）","operationId":"conv_full_v1_chat__cid__full_get","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^cv_","title":"Cid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/{cid}/reply":{"post":{"tags":["客服"],"summary":"商家/分身回复","description":"人工或商家分身智能体回复。\n\n★ 回复后状态回到 open —— 除非再出现 AI 答不了的问题。\n  这样 AI 可以继续接手后续的常规问题，人只处理麻烦的。","operationId":"reply_v1_chat__cid__reply_post","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^cv_","title":"Cid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/{cid}/close":{"post":{"tags":["客服"],"summary":"结束会话","operationId":"close_v1_chat__cid__close_post","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^cv_","title":"Cid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/chat/stats":{"get":{"tags":["客服"],"summary":"客服数据（今日）","operationId":"chat_stats_v1_merchant_chat_stats_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/qr":{"get":{"tags":["工具"],"summary":"生成二维码 PNG","description":"`GET /v1/qr?text=http://192.168.1.5:8848/yunlv&size=320`\n\n返回 image/png。前端可以直接 `<img src=\"/v1/qr?text=...\">`。","operationId":"make_qr_v1_qr_get","parameters":[{"name":"text","in":"query","required":true,"schema":{"type":"string","maxLength":500,"description":"要编码的内容（一般是链接）","title":"Text"},"description":"要编码的内容（一般是链接）"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":1024,"minimum":80,"description":"图片边长（像素）","default":320,"title":"Size"},"description":"图片边长（像素）"},{"name":"box","in":"query","required":false,"schema":{"type":"integer","maximum":40,"minimum":0,"description":"（已废弃，自动按 size 反算整数模块尺寸）","default":0,"title":"Box"},"description":"（已废弃，自动按 size 反算整数模块尺寸）"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/store/":{"get":{"tags":["门面"],"summary":"所有门面（集市首页用）","operationId":"list_stores_v1_store__get","parameters":[{"name":"industry","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/store/{slug}":{"get":{"tags":["门面"],"summary":"按门面路径取店铺（含行业、主题、在售商品）","operationId":"storefront_v1_store__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/store/{slug}/calendar/{sku_id}":{"get":{"tags":["门面"],"summary":"门面按日查某商品的日历","operationId":"store_calendar_v1_store__slug__calendar__sku_id__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"sku_id","in":"path","required":true,"schema":{"type":"string","title":"Sku Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":60,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/store/{slug}/cfgbundle":{"get":{"tags":["门面"],"summary":"模板专用：返回可直接替换 var CFG 的数据包","description":"20 份 H5 模板的数据源。\n\n字段映射见 `app/domain/tpl_bundle.py` 顶部说明 —— 模板要 14 个 item 字段，后端原生只有 9 个，`meta`/`hot`/`strict`/`duration`/`deposit` 五项是推导的（推导依据都写在代码里）。\n\n**不伪造**：`hot` 是真实订单数，没单就是 0；取不到的字段给空字符串，不编。","operationId":"store_cfgbundle_v1_store__slug__cfgbundle_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/store/by-name/{name}/cfgbundle":{"get":{"tags":["门面"],"summary":"按店铺名取模板数据包（生成器用）","description":"`industries.py` 里只有店名（`ind['shop']`），没有 slug。\n\n这个接口让生成器直接传店名即可，**不用维护「店名 → slug」映射表**。\n\n店名重复时返回 409 并列出候选 slug，请改用 `/{slug}/cfgbundle`。","operationId":"store_cfgbundle_by_name_v1_store_by_name__name__cfgbundle_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events/stream":{"get":{"tags":["实时推送"],"summary":"SSE 实时事件流（订单 / 客服 / 状态）","operationId":"stream_v1_events_stream_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","pattern":"^(merchant|guest)$","default":"merchant","title":"Scope"}},{"name":"cid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"scope=guest 时的会话 ID","title":"Cid"},"description":"scope=guest 时的会话 ID"},{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"额外订阅某笔订单的状态","title":"Order Id"},"description":"额外订阅某笔订单的状态"},{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"从哪个事件 id 之后开始补发","default":0,"title":"Since"},"description":"从哪个事件 id 之后开始补发"},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}},{"name":"X-Visitor-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Visitor-Token"}},{"name":"Last-Event-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last-Event-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events":{"get":{"tags":["实时推送"],"summary":"事件历史（降级轮询 / 通知中心）","operationId":"history_v1_events_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","pattern":"^(merchant|guest)$","default":"merchant","title":"Scope"}},{"name":"cid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cid"}},{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"X-Customer-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Customer-Token"}},{"name":"X-Visitor-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Visitor-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events/status":{"get":{"tags":["实时推送"],"summary":"推送通道状态（运维用）","operationId":"status_v1_events_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/shorten":{"get":{"tags":["短链"],"summary":"把商品地址变短","description":"生成短链。\n\n★ 只接受**站内路径**（以 `/` 开头）。\n  收外部 URL 会让这里变成一个开放重定向服务 —— 那是安全漏洞，\n  不是功能。","operationId":"shorten_v1_shorten_get","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"站内路径，如 /piaowu/p/sku_xxx","title":"Url"},"description":"站内路径，如 /piaowu/p/sku_xxx"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/schema":{"get":{"tags":["招聘"],"summary":"岗位字段说明 + 合规规则 + 职业族词表","description":"发布岗位前先读这个。\n\n★ 为什么要一次给全：草案说「发布前拦，不靠事后删」。\n  那商家/AI 就必须能**事先知道**规则。发一次被拦一次是折磨。","operationId":"jobs_schema_v1_jobs_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/jobs/validate":{"post":{"tags":["招聘"],"summary":"★ 发布前干跑合规体检（不落库）","description":"只跑合规体检，**不创建岗位**。\n\n★ 为什么要有这个（草案 10 条原则第 10 条「没有沙箱就没有规模化」）：\n  商家/AI 不该用「发一次被拦一次」来学规则。\n  改完先干跑，通过了再真发。","operationId":"validate_job_v1_jobs_validate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs":{"post":{"tags":["招聘"],"summary":"★ 发布岗位（含合规体检，不合格直接拦）","description":"发布一个岗位。\n\n★ 合规体检是**同步的、在写库之前**：\n  不合格直接 422 并返回 violations（含法律依据 + 怎么改），\n  不会先落一个「反正不能发」的草稿。\n\n★ 合格但命中高风险话术 → status=pending_review（转人工），\n  接口仍返回 201 并说明「已收到，待人工核验」。**不装作已经上线。**","operationId":"create_job_v1_jobs_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["招聘"],"summary":"岗位列表（求职者侧，无需凭证）","description":"只返回 `status=active` 的岗位（草稿/待审核/已关闭都不出现）。\n\n★ 和 `/v1/search` 的区别：这里**没有价格排序**，也没有「总价」。\n  岗位按薪资区间重叠度 + 新鲜度排，不按「便宜优先」——\n  「越便宜越好」在招聘里是错的（那是在比谁给的钱少）。","operationId":"list_jobs_v1_jobs_get","parameters":[{"name":"keyword","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Keyword"}},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"}},{"name":"province","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"}},{"name":"district","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"}},{"name":"job_family","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Family"}},{"name":"employment_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employment Type"}},{"name":"salary_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"薪资下限（分）","title":"Salary Min"},"description":"薪资下限（分）"},{"name":"salary_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"薪资上限（分）","title":"Salary Max"},"description":"薪资上限（分）"},{"name":"night_shift","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Night Shift"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}":{"get":{"tags":["招聘"],"summary":"岗位详情（无需凭证）","operationId":"get_job_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}/apply":{"post":{"tags":["招聘"],"summary":"投递（幂等）","description":"投递一个岗位。\n\n★ 不是下单：没有金额、没有库存扣减、没有支付。\n★ 隐私：`share_contact` 默认 False。不授权就不存手机号 ——\n  企业侧永远看不到，除非候选人明确同意。（草案 6 节的硬红线）","operationId":"apply_job_v1_jobs__job_id__apply_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}/applications":{"get":{"tags":["招聘"],"summary":"某个岗位的投递列表（发布方看）","description":"★ 只有这个岗位的发布方能看。\n  `share_contact=false` 的投递，姓名电话都是 null —— 不是脱敏，是**压根没存**。","operationId":"list_applications_v1_jobs__job_id__applications_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/jobs":{"get":{"tags":["招聘"],"summary":"我的岗位","operationId":"my_jobs_v1_merchant_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/jobs/{job_id}/close":{"post":{"tags":["招聘"],"summary":"关闭岗位（招满了）","operationId":"close_job_v1_merchant_jobs__job_id__close_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/jobs/{job_id}/recheck":{"post":{"tags":["招聘"],"summary":"重新做合规体检（改完再检一次）","description":"改完内容后重新体检。\n\n★ 为什么单独一个：商家改了某几个字段，不该为了复检而重新发布\n  （那会丢投递记录）。这里只重跑合规，不改其他。","operationId":"recheck_job_v1_merchant_jobs__job_id__recheck_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/matches":{"post":{"tags":["招聘"],"summary":"★ 岗位 ↔ 候选人匹配（含 reasons / gaps / unknown）","description":"给一个岗位 + 一份候选人自述，算匹配。\n\nbody:\n  {\n    \"job_id\": \"jb_xxx\",\n    \"candidate\": {\n      \"skills\": [\"客房整理\"],\n      \"exp_years\": 3,\n      \"certificates\": [\"健康证\"],\n      \"expected_salary_min\": 450000,\n      \"expected_salary_max\": 520000,\n      \"commute_min\": 30,\n      \"shift_pref_avoid_night\": true,\n      \"available_from\": \"2026-12-10\"\n    }\n  }\n\n★★★ 返回里三样东西最重要，别的都可以不看：\n\n  `must_pass`  —— 硬约束逐条过了没有。\n                  `ok: null` 表示**没填，不知道**（不是不合格）。\n  `reasons`    —— 为什么合适（可直接转述给用户）。\n  `gaps`       —— 差什么、怎么补（`blocking` 区分「硬门槛」和「可协商」）。\n\n★ 不要对外说「你 82 分」。人对分数过度敏感，而且同样分数\n  对不同岗位含义不同。对外用 `level`（很合适 / 可以考虑 / 差得比较多）。","operationId":"match_job_v1_matches_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/matches/why-not":{"post":{"tags":["招聘"],"summary":"候选人视角：我为什么没被选上 / 差什么","description":"★ 这个功能的价值：海投的人永远不知道差在哪，于是继续海投。\n  告诉他「你差一张健康证，3 天能办」比给一个 0.42 分有用得多。\n\n★ 但只说事实：\n  · 硬门槛缺了 → `what_you_can_do`（能补的）\n  · 非硬门槛不匹配 → `not_your_fault`（不用自责的，比如薪资上限就是那么多）\n  · 没填的信息 → `missing_info`（补上更准）","operationId":"match_why_not_v1_matches_why_not_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}/why-not":{"get":{"tags":["招聘"],"summary":"为什么我不符合这个岗位（GET 版，便于人点）","description":"GET 版 why-not —— 用 query 传最简单的几个字段。\n\n★ 为什么 GET 也要有一个：人要能「点一下就看到」，\n  而 POST 需要构造 body，人不好用。","operationId":"why_not_get_v1_jobs__job_id__why_not_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"skills","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"技能，逗号分隔","title":"Skills"},"description":"技能，逗号分隔"},{"name":"exp_years","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp Years"}},{"name":"certificates","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"证书，逗号分隔","title":"Certificates"},"description":"证书，逗号分隔"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/merchant/jobs/{job_id}":{"delete":{"tags":["招聘"],"summary":"删除岗位（有投递时拒绝，只能关闭）","description":"删除岗位。\n\n★ 有投递记录就**不许删**，只能关闭 —— 这不是技术限制，是产品判断：\n  有人投过这个岗位，说明它真实存在过。删掉会让那些投递变成孤儿，\n  而且对求职者是「我投的岗位凭空消失了」。\n  关闭是诚实的（招满了），删除是抹掉历史。","operationId":"delete_job_v1_merchant_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}/share":{"get":{"tags":["招聘"],"summary":"岗位的可分享链接（含状态与快照时间）","description":"拿到一条岗位的分享物料。\n\n★ 和 `/v1/shorten` 的区别：\n  `shorten` 通用（任何站内路径），这里**专门为岗位**：\n  多给 `status` / `as_of` / `qr_url` / 纯文本镜像地址。\n\n★ 招满/过期不隐藏，而是**明说状态** ——\n  藏起来会让已经发出去的链接变成 404，那比「已招满」更差。","operationId":"share_job_v1_jobs__job_id__share_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/health":{"get":{"tags":["运维"],"summary":"Health","operationId":"health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentIn":{"properties":{"display_name":{"type":"string","title":"Display Name"},"bio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bio"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"kind":{"type":"string","title":"Kind","default":"user"}},"type":"object","required":["display_name"],"title":"AgentIn"},"Body_upload_media_v1_merchant_media_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_media_v1_merchant_media_post"},"CalendarEntry":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"price":{"type":"integer","exclusiveMinimum":0.0,"title":"Price","description":"单价，单位分"},"total_rooms":{"type":"integer","exclusiveMinimum":0.0,"title":"Total Rooms"},"closed":{"type":"boolean","title":"Closed","default":false},"min_nights":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Nights"}},"type":"object","required":["date","price","total_rooms"],"title":"CalendarEntry"},"CalendarIn":{"properties":{"entries":{"anyOf":[{"items":{"$ref":"#/components/schemas/CalendarEntry"},"type":"array"},{"type":"null"}],"title":"Entries"},"rule":{"anyOf":[{"$ref":"#/components/schemas/CalendarRule"},{"type":"null"}]}},"type":"object","title":"CalendarIn","description":"铺/改日历。\n\n★ 二选一（2026-12-02）：\n  · `entries` —— 逐日精确指定（适用于少量特例：某几天调价）\n  · `rule`    —— 规则式一次铺满（适用于常规排期：整个季度）\n  两个都给 → 报错（不许含糊）；都不给 → 报错。"},"CalendarRule":{"properties":{"from":{"type":"string","title":"From"},"to":{"type":"string","title":"To"},"weekday_price":{"type":"integer","minimum":0.0,"title":"Weekday Price","description":"周一~周四价格（分）"},"weekend_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Weekend Price","description":"周五周六价格（分）；不填=与周中同价"},"sunday_price":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Sunday Price","description":"周日价格（分）；不填=与周中同价"},"total_rooms":{"type":"integer","minimum":1.0,"title":"Total Rooms","description":"每天放几间"},"closed_weekdays":{"items":{"type":"integer"},"type":"array","title":"Closed Weekdays","description":"固定不开放的星期（0=周一…6=周日）"},"min_nights":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Min Nights"}},"type":"object","required":["from","to","weekday_price","total_rooms"],"title":"CalendarRule","description":"规则式铺日历（2026-12-02，外部 AI 实测第 14 条）。\n\n实测原话：「日历只能逐日铺 30 天，断档不报错只是『那天不显示』；\n            商家和 AI 都要反复手工补，容易断档」。\n\n★ 一条规则展开成 N 天，比让人手写 30 条 entries 可靠得多 ——\n  手写会漏（漏了就那天不可订，而且**不报错**）。\n\n示例：\n    {\"from\": \"2026-12-01\", \"to\": \"2027-03-31\",\n     \"weekday_price\": 32000, \"weekend_price\": 48000,\n     \"total_rooms\": 5}\n  → 周一到周四 320 元，周五周六 480 元，周日按周中价\n  → 一次铺满 121 天"},"DisputeIn":{"properties":{"reason":{"type":"string","title":"Reason"}},"type":"object","required":["reason"],"title":"DisputeIn"},"DryRunIn":{"properties":{"sku_id":{"type":"string","title":"Sku Id"},"check_in":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Check In"},"check_out":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Check Out"},"rooms":{"type":"integer","minimum":1.0,"title":"Rooms","default":1},"guests":{"type":"integer","minimum":1.0,"title":"Guests","default":1},"guest_name":{"type":"string","title":"Guest Name","default":"试算"},"guest_phone":{"type":"string","title":"Guest Phone","default":"13000000000"},"guest_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guest Note"}},"type":"object","required":["sku_id"],"title":"DryRunIn","description":"试算入参（2026-12-02）。\n\n★ 和 OrderIn 的区别：**不要真实姓名电话**。\n  试算只是问「能不能下单、能拿到什么」，写个假名反而让人以为落单了。\n  所以这两个字段可选，默认值明确写着「试算」。"},"FacetsIn":{"properties":{"province":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"},"shop_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Industry"},"industries":{"items":{"type":"string"},"type":"array","title":"Industries","default":[]},"top_n":{"type":"integer","title":"Top N","default":12}},"type":"object","title":"FacetsIn","description":"检索维度清单的查询范围（都可空 = 全平台）。"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IntentIn":{"properties":{"intent":{"type":"string","title":"Intent"}},"type":"object","required":["intent"],"title":"IntentIn","description":"改主意了：把意图换一个。"},"JoinIn":{"properties":{"display_name":{"type":"string","title":"Display Name","default":"外部智能体"},"bio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bio"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"intent":{"type":"string","title":"Intent","default":"explore"}},"type":"object","title":"JoinIn","description":"外部智能体一步接入。除 display_name 外都可空。"},"LoginIn":{"properties":{"phone":{"type":"string","title":"Phone"},"nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nickname"}},"type":"object","required":["phone"],"title":"LoginIn","description":"手机号即身份。⚠️ 当前无验证码，是临时设计。"},"MeUpdateIn":{"properties":{"nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nickname"}},"type":"object","title":"MeUpdateIn"},"OfflineIn":{"properties":{"reason":{"type":"string","title":"Reason","default":"主动下架"}},"type":"object","title":"OfflineIn"},"OrderIn":{"properties":{"sku_id":{"type":"string","title":"Sku Id"},"check_in":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Check In"},"check_out":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Check Out"},"rooms":{"type":"integer","title":"Rooms","default":1},"guests":{"type":"integer","title":"Guests","default":1},"guest_name":{"type":"string","title":"Guest Name"},"guest_phone":{"type":"string","title":"Guest Phone"},"guest_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guest Note"},"source":{"type":"string","title":"Source","default":"h5"}},"type":"object","required":["sku_id","guest_name","guest_phone"],"title":"OrderIn"},"RejectIn":{"properties":{"reason":{"type":"string","title":"Reason","default":"商家拒单"}},"type":"object","title":"RejectIn"},"ResolveIn":{"properties":{"decision":{"type":"string","title":"Decision"},"refund_ratio":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Refund Ratio"},"reasoning":{"type":"string","title":"Reasoning"}},"type":"object","required":["decision","refund_ratio","reasoning"],"title":"ResolveIn"},"SearchIn":{"properties":{"check_in":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Check In"},"check_out":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Check Out"},"rooms":{"type":"integer","title":"Rooms","default":1},"guests":{"type":"integer","title":"Guests","default":1},"province":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Province"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"},"keyword":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Keyword"},"industries":{"items":{"type":"string"},"type":"array","title":"Industries","default":[]},"shop_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Industry"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"features":{"additionalProperties":{"type":"string"},"type":"object","title":"Features","default":{}},"budget_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Budget Min"},"budget_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Budget Max"},"shop_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Id"},"sort":{"type":"string","title":"Sort","default":"auto"},"offset":{"type":"integer","title":"Offset","default":0},"limit":{"type":"integer","title":"Limit","default":20},"explain":{"type":"boolean","title":"Explain","default":true}},"type":"object","title":"SearchIn"},"SkuIn":{"properties":{"title":{"type":"string","title":"Title","default":""},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"total_rooms":{"type":"integer","title":"Total Rooms","default":1},"industry":{"type":"string","title":"Industry","default":"hotel"},"stock_qty":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stock Qty"},"natural_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Natural Text"},"extension":{"additionalProperties":true,"type":"object","title":"Extension","default":{}},"rules":{"additionalProperties":true,"type":"object","title":"Rules","default":{}},"media":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Media","default":[]},"geo":{"additionalProperties":true,"type":"object","title":"Geo","default":{}},"price_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Min"}},"type":"object","title":"SkuIn","description":"商家建商品。支持「自然语言描述」和「结构化字段」两种输入。"},"SkuPatch":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"stock_qty":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stock Qty"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"total_rooms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Rooms"},"extension":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extension"},"rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rules"},"media":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Media"},"geo":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Geo"},"price_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Min"}},"type":"object","title":"SkuPatch"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}