{ "openapi": "3.0.0", "info": { "title": "Hxops Shipping Notice Tools", "version": "1.0.0", "description": "货代发货通知 Agent Tool API。仅包含 Chatflow 编排工具,不含 RPA 回调。" }, "servers": [ { "url": "http://192.168.100.192:8890/api/shipping-notice" } ], "components": { "securitySchemes": { "ShippingToolKey": { "type": "apiKey", "in": "header", "name": "X-Shipping-Tool-Key", "description": "与 hxops SHIPPING_NOTICE_TOOL_API_KEY 相同" } } }, "security": [ { "ShippingToolKey": [] } ], "paths": { "/tools/create_case": { "post": { "operationId": "create_case", "summary": "创建发货任务 case", "description": "创建发货任务 case", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "user_id": { "type": "integer", "description": "Hxops 用户 ID(可选)" }, "conversation_id": { "type": "string", "description": "Dify 会话 ID,便于工作台关联" }, "source_type": { "type": "string", "description": "来源:manual|email|wecom|pdf", "enum": [ "manual", "email", "wecom", "pdf" ] }, "raw_content": { "type": "string", "description": "原始发货通知文本(可选,后续 parse 也可传入)" } } } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/parse_notice": { "post": { "operationId": "parse_notice", "summary": "解析发货通知文本", "description": "解析发货通知文本", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" }, "raw_text": { "type": "string", "description": "待解析的发货通知全文" } }, "required": [ "case_id" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/ensure_inventory": { "post": { "operationId": "ensure_inventory", "summary": "确保库存快照可用(RPA 或手工 JSON)", "description": "确保库存快照可用(RPA 或手工 JSON)", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" }, "mode": { "type": "string", "description": "auto=自动/RPA;retry_rpa=重试 RPA", "enum": [ "auto", "retry_rpa" ] }, "inventory_lines_json": { "type": "string", "description": "手工库存 JSON 数组字符串,如 [{\"sku\":\"A001\",\"available_qty\":10}]" } }, "required": [ "case_id" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/match_inventory": { "post": { "operationId": "match_inventory", "summary": "匹配发货需求与库存", "description": "匹配发货需求与库存", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" }, "inventory_lines_json": { "type": "string", "description": "可选,覆盖库存 JSON 数组后再匹配" } }, "required": [ "case_id" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/submit_decision": { "post": { "operationId": "submit_decision", "summary": "人工复核决策", "description": "人工复核决策", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" }, "decision": { "type": "string", "description": "confirm=确认继续;reject=驳回;rematch=重新匹配;reparse=重新解析", "enum": [ "confirm", "reject", "rematch", "reparse" ] }, "comment": { "type": "string", "description": "备注(可选)" } }, "required": [ "case_id", "decision" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/generate_shipment_excel": { "post": { "operationId": "generate_shipment_excel", "summary": "生成固定模板发货 Excel", "description": "生成固定模板发货 Excel", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" } }, "required": [ "case_id" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/upload_to_freight": { "post": { "operationId": "upload_to_freight", "summary": "上传 Excel 到货代系统(RPA 或手工确认)", "description": "上传 Excel 到货代系统(RPA 或手工确认)", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" }, "mode": { "type": "string", "description": "auto=触发 RPA;retry_upload=重试;manual_confirm=手工上传完成", "enum": [ "auto", "retry_upload", "manual_confirm" ] }, "freight_ref_no": { "type": "string", "description": "货代系统单号(manual_confirm 时填写)" } }, "required": [ "case_id" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } }, "/tools/get_case_status": { "post": { "operationId": "get_case_status", "summary": "查询 case 当前状态与 human_options", "description": "查询 case 当前状态与 human_options", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "case_id": { "type": "string", "description": "发货任务编号,如 SN-20260529-ABCD1234" } }, "required": [ "case_id" ] } } } }, "responses": { "200": { "description": "Tool response (status: ok|running|needs_human|failed)", "content": { "application/json": { "schema": { "type": "object" } } } } }, "security": [ { "ShippingToolKey": [] } ] } } } }