灵活用工项目

第三方平台对接接口-mock.json 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. {
  2. "spec_version": "1.0.0",
  3. "title": "灵活用工 — 第三方人力资源/税筹平台对接接口契约(Mock)",
  4. "description": "政策法规、税务、合同、社保等知识类数据从第三方平台获取;实名、签约、临时工资源、结算、完税、开票等业务办理对接第三方人力资源平台。本文档供 fe-integration 模块 Mock 实现与二期正式联调共用同一契约。",
  5. "updated_at": "2026-07-07",
  6. "default_provider_code": "hr_platform_mock",
  7. "mock_config": {
  8. "enabled": true,
  9. "base_url": "http://127.0.0.1:19090/mock/hr-platform",
  10. "default_delay_ms": 150,
  11. "sign_algorithm": "HMAC-SHA256",
  12. "sign_header": "X-Platform-Signature",
  13. "timestamp_header": "X-Platform-Timestamp",
  14. "nonce_header": "X-Platform-Nonce",
  15. "callback_verify_sign": true
  16. },
  17. "providers": [
  18. {
  19. "provider_code": "hr_platform_mock",
  20. "provider_name": "合作人力资源平台(Mock)",
  21. "api_base_url": "http://127.0.0.1:19090/mock/hr-platform",
  22. "status": "active",
  23. "capabilities": [
  24. "knowledge_policy",
  25. "knowledge_tax",
  26. "knowledge_contract",
  27. "knowledge_social_security",
  28. "identity_verify",
  29. "contract_esign",
  30. "worker_resource",
  31. "requirement_submit",
  32. "settlement",
  33. "payment",
  34. "tax_withhold",
  35. "invoice",
  36. "insurance"
  37. ]
  38. }
  39. ],
  40. "biz_status_mapping": {
  41. "SUCCESS": "succeeded",
  42. "PROCESSING": "processing",
  43. "PENDING_AUDIT": "pending_audit",
  44. "PENDING_SIGN": "pending_sign",
  45. "REJECTED": "rejected",
  46. "FAILED": "failed",
  47. "NOT_FOUND": "not_found"
  48. },
  49. "categories": {
  50. "knowledge": {
  51. "name": "知识库(政策法规 / 税务 / 合同 / 社保)",
  52. "source": "第三方平台统一知识服务,本地 fe_policy_rule 可缓存热点条目;AI 检索优先调此类接口,不自行编造法规原文。",
  53. "endpoints": [
  54. "knowledge.policy.search",
  55. "knowledge.policy.get",
  56. "knowledge.tax.search",
  57. "knowledge.contract.search",
  58. "knowledge.social_security.search",
  59. "knowledge.sync.changelog"
  60. ]
  61. },
  62. "identity": {
  63. "name": "身份实名核验",
  64. "endpoints": ["identity.verify.two_factor", "identity.verify.face"]
  65. },
  66. "contract": {
  67. "name": "电子劳动合同",
  68. "endpoints": ["contract.create", "contract.sign_url", "contract.status", "contract.download"]
  69. },
  70. "worker_resource": {
  71. "name": "临时工资源与用工需求",
  72. "endpoints": [
  73. "worker.pool.search",
  74. "requirement.create",
  75. "requirement.status",
  76. "worker.registration.sync"
  77. ]
  78. },
  79. "settlement": {
  80. "name": "结算与支付",
  81. "endpoints": ["settlement.create", "settlement.status", "payment.batch", "payment.status"]
  82. },
  83. "tax_invoice": {
  84. "name": "个税代征与发票",
  85. "endpoints": ["tax.withhold.batch", "tax.withhold.status", "invoice.apply", "invoice.status"]
  86. },
  87. "insurance": {
  88. "name": "商业保险投保",
  89. "endpoints": ["insurance.enroll", "insurance.status"]
  90. },
  91. "callback": {
  92. "name": "平台异步回调(fe-server 接收)",
  93. "endpoints": [
  94. "callback.contract_signed",
  95. "callback.identity_verified",
  96. "callback.payment_result",
  97. "callback.tax_completed",
  98. "callback.invoice_issued"
  99. ]
  100. }
  101. },
  102. "endpoints": [
  103. {
  104. "id": "knowledge.policy.search",
  105. "category": "knowledge",
  106. "sub_category": "policy",
  107. "name": "政策法规检索",
  108. "method": "POST",
  109. "path": "/v1/knowledge/policy/search",
  110. "description": "按关键词、地区、用工场景检索灵活用工相关政策法规条文,供风险诊断与 AI 问答引用。",
  111. "fe_action": "knowledge_policy_search",
  112. "request": {
  113. "enterprise_id": "ent_001",
  114. "keyword": "灵活用工 劳务报酬",
  115. "region_code": "310000",
  116. "scene": "flexible_employment",
  117. "page": 1,
  118. "page_size": 10
  119. },
  120. "response_success": {
  121. "code": "SUCCESS",
  122. "message": "ok",
  123. "data": {
  124. "total": 2,
  125. "items": [
  126. {
  127. "doc_id": "POL-2024-001",
  128. "title": "关于规范灵活用工平台企业用工管理的指导意见",
  129. "issuer": "人力资源和社会保障部",
  130. "region_code": "CN",
  131. "effective_date": "2024-01-01",
  132. "category": "flexible_employment",
  133. "summary": "明确平台企业与灵活就业人员权利义务,强调实名、合同、报酬支付与社保缴纳合规要求。",
  134. "content_excerpt": "平台企业应当依法与灵活就业人员订立书面协议或劳动合同……",
  135. "source_url": "https://example.gov.cn/policy/2024/001",
  136. "risk_tags": ["contract_required", "real_name_required"]
  137. },
  138. {
  139. "doc_id": "POL-2023-088",
  140. "title": "上海市灵活用工合规指引(节选)",
  141. "issuer": "上海市人社局",
  142. "region_code": "310000",
  143. "effective_date": "2023-06-01",
  144. "category": "local_policy",
  145. "summary": "本地临时性、辅助性岗位用工备案与工资支付周期要求。",
  146. "content_excerpt": "临时性岗位用工期限一般不超过六个月……",
  147. "source_url": "https://example.sh.gov.cn/policy/088",
  148. "risk_tags": ["term_limit", "wage_cycle"]
  149. }
  150. ]
  151. }
  152. },
  153. "mock": { "http_status": 200, "delay_ms": 120, "biz_status": "succeeded" }
  154. },
  155. {
  156. "id": "knowledge.policy.get",
  157. "category": "knowledge",
  158. "sub_category": "policy",
  159. "name": "政策法规详情",
  160. "method": "GET",
  161. "path": "/v1/knowledge/policy/{doc_id}",
  162. "description": "获取单条政策全文与结构化要点。",
  163. "fe_action": "knowledge_policy_get",
  164. "path_params": { "doc_id": "POL-2024-001" },
  165. "response_success": {
  166. "code": "SUCCESS",
  167. "data": {
  168. "doc_id": "POL-2024-001",
  169. "title": "关于规范灵活用工平台企业用工管理的指导意见",
  170. "full_text": "(Mock 全文)平台企业应当依法与灵活就业人员订立书面协议……",
  171. "key_points": [
  172. "实名登记是办理前提",
  173. "应订立书面劳动合同或书面协议",
  174. "报酬支付应通过合规通道并代扣代缴个税"
  175. ],
  176. "version": "1.0",
  177. "updated_at": "2024-01-01T00:00:00+08:00"
  178. }
  179. },
  180. "mock": { "http_status": 200, "delay_ms": 80, "biz_status": "succeeded" }
  181. },
  182. {
  183. "id": "knowledge.tax.search",
  184. "category": "knowledge",
  185. "sub_category": "tax",
  186. "name": "税务政策检索",
  187. "method": "POST",
  188. "path": "/v1/knowledge/tax/search",
  189. "description": "检索劳务报酬个税、代征、发票开具相关税务政策与税率说明。",
  190. "fe_action": "knowledge_tax_search",
  191. "request": {
  192. "enterprise_id": "ent_001",
  193. "keyword": "劳务报酬 预扣预缴",
  194. "income_type": "labor_remuneration",
  195. "region_code": "310000"
  196. },
  197. "response_success": {
  198. "code": "SUCCESS",
  199. "data": {
  200. "items": [
  201. {
  202. "doc_id": "TAX-2024-LABOR-01",
  203. "title": "居民个人劳务报酬所得预扣预缴规则(摘要)",
  204. "tax_type": "individual_income_tax",
  205. "summary": "按次或按月累计预扣;平台可依法代办申报。",
  206. "rate_table_ref": "IIT_LABOR_2024",
  207. "withholding_required": true,
  208. "invoice_type_hint": "增值税普通发票 / 代开发票"
  209. }
  210. ]
  211. }
  212. },
  213. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  214. },
  215. {
  216. "id": "knowledge.contract.search",
  217. "category": "knowledge",
  218. "sub_category": "contract",
  219. "name": "劳动合同法规与范本知识检索",
  220. "method": "POST",
  221. "path": "/v1/knowledge/contract/search",
  222. "description": "检索劳动合同签订、试用期、解除终止等法规要点及平台推荐范本说明(非直接生成合同正文)。",
  223. "fe_action": "knowledge_contract_search",
  224. "request": {
  225. "keyword": "非全日制 劳动合同",
  226. "work_type": "temporary",
  227. "contract_type": "labor_contract"
  228. },
  229. "response_success": {
  230. "code": "SUCCESS",
  231. "data": {
  232. "items": [
  233. {
  234. "doc_id": "CTR-LAW-001",
  235. "title": "非全日制用工劳动合同签订要点",
  236. "summary": "可订立口头协议,但平台场景建议电子书面合同;工时与报酬结算周期不得超过十五日。",
  237. "mandatory_clauses": ["工作内容与地点", "报酬标准", "工时", "劳动保护"],
  238. "template_code": "TPL_LABOR_PART_TIME_V1",
  239. "esign_required": true
  240. }
  241. ]
  242. }
  243. },
  244. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  245. },
  246. {
  247. "id": "knowledge.social_security.search",
  248. "category": "knowledge",
  249. "sub_category": "social_security",
  250. "name": "社会保险政策检索",
  251. "method": "POST",
  252. "path": "/v1/knowledge/social-security/search",
  253. "description": "检索工伤保险、意外险、社保缴纳义务等地域性政策说明,辅助保险方案推荐。",
  254. "fe_action": "knowledge_social_security_search",
  255. "request": {
  256. "region_code": "310000",
  257. "keyword": "临时工 工伤保险",
  258. "industry": "logistics"
  259. },
  260. "response_success": {
  261. "code": "SUCCESS",
  262. "data": {
  263. "items": [
  264. {
  265. "doc_id": "SS-2024-INJ-01",
  266. "title": "用工单位工伤保险责任说明",
  267. "summary": "平台场景下应通过商业意外险或雇主责任险补充保障;特定岗位须核实当地参保要求。",
  268. "insurance_recommendations": ["employer_liability", "accident_insurance"],
  269. "mandatory_enrollment": false,
  270. "region_code": "310000"
  271. }
  272. ]
  273. }
  274. },
  275. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  276. },
  277. {
  278. "id": "knowledge.sync.changelog",
  279. "category": "knowledge",
  280. "sub_category": "policy",
  281. "name": "知识库变更同步",
  282. "method": "GET",
  283. "path": "/v1/knowledge/changelog",
  284. "description": "拉取第三方知识库增量更新列表,供定时任务同步至 fe_policy_rule。",
  285. "fe_action": "knowledge_sync_changelog",
  286. "query": { "since": "2026-07-01T00:00:00+08:00" },
  287. "response_success": {
  288. "code": "SUCCESS",
  289. "data": {
  290. "changes": [
  291. {
  292. "doc_id": "POL-2024-001",
  293. "change_type": "update",
  294. "changed_at": "2026-07-05T10:00:00+08:00"
  295. }
  296. ]
  297. }
  298. },
  299. "mock": { "http_status": 200, "delay_ms": 60, "biz_status": "succeeded" }
  300. },
  301. {
  302. "id": "identity.verify.two_factor",
  303. "category": "identity",
  304. "name": "实名二要素核验",
  305. "method": "POST",
  306. "path": "/v1/identity/verify/two-factor",
  307. "description": "姓名 + 身份证号核验,登记环节调用。",
  308. "fe_action": "identity_verify",
  309. "request": {
  310. "request_no": "IDV202607070001",
  311. "name": "张三",
  312. "id_card_no": "310101199001011234",
  313. "mobile": "13800138000"
  314. },
  315. "response_success": {
  316. "code": "SUCCESS",
  317. "data": {
  318. "verify_id": "VER_mock_001",
  319. "status": "PASSED",
  320. "match_result": true,
  321. "verified_at": "2026-07-07T10:00:00+08:00"
  322. }
  323. },
  324. "response_fail": {
  325. "code": "REJECTED",
  326. "message": "身份信息不匹配",
  327. "data": { "verify_id": "VER_mock_002", "status": "FAILED", "match_result": false }
  328. },
  329. "mock": { "http_status": 200, "delay_ms": 300, "biz_status": "succeeded" }
  330. },
  331. {
  332. "id": "identity.verify.face",
  333. "category": "identity",
  334. "name": "人脸活体核验(可选)",
  335. "method": "POST",
  336. "path": "/v1/identity/verify/face",
  337. "description": "高风险场景人脸比对,二期启用。",
  338. "fe_action": "identity_verify_face",
  339. "request": {
  340. "verify_id": "VER_mock_001",
  341. "face_image_base64": "..."
  342. },
  343. "response_success": {
  344. "code": "SUCCESS",
  345. "data": { "status": "PASSED", "similarity": 0.98 }
  346. },
  347. "mock": { "http_status": 200, "delay_ms": 500, "biz_status": "succeeded" }
  348. },
  349. {
  350. "id": "contract.create",
  351. "category": "contract",
  352. "name": "创建电子劳动合同",
  353. "method": "POST",
  354. "path": "/v1/contracts",
  355. "description": "根据登记信息与用工草稿在第三方平台创建待签合同。",
  356. "fe_action": "contract_create",
  357. "request": {
  358. "request_no": "CTR202607070001",
  359. "order_no": "ORD202607070001",
  360. "enterprise": {
  361. "name": "上海某某物流有限公司",
  362. "credit_code": "91310000MA1K3XXXXX"
  363. },
  364. "worker": {
  365. "name": "张三",
  366. "id_card_mask": "310101********1234",
  367. "mobile_mask": "138****8000"
  368. },
  369. "contract_type": "labor_contract",
  370. "template_code": "TPL_LABOR_PART_TIME_V1",
  371. "work_content": "仓库分拣",
  372. "work_location": "上海市浦东新区",
  373. "wage_desc": "日薪280元",
  374. "start_date": "2026-07-10",
  375. "end_date": "2026-08-10"
  376. },
  377. "response_success": {
  378. "code": "SUCCESS",
  379. "data": {
  380. "external_contract_id": "EXT_CTR_mock_001",
  381. "status": "PENDING_SIGN",
  382. "sign_deadline": "2026-07-09T23:59:59+08:00"
  383. }
  384. },
  385. "mock": { "http_status": 200, "delay_ms": 200, "biz_status": "pending_sign" }
  386. },
  387. {
  388. "id": "contract.sign_url",
  389. "category": "contract",
  390. "name": "获取签署链接",
  391. "method": "POST",
  392. "path": "/v1/contracts/{external_contract_id}/sign-url",
  393. "description": "为临时工生成 H5/小程序签署链接。",
  394. "fe_action": "contract_sign_url",
  395. "path_params": { "external_contract_id": "EXT_CTR_mock_001" },
  396. "request": {
  397. "signer_role": "worker",
  398. "redirect_url": "https://mp.example.com/pages/contract/result"
  399. },
  400. "response_success": {
  401. "code": "SUCCESS",
  402. "data": {
  403. "sign_url": "https://esign.mock.example.com/sign/abc123",
  404. "expires_at": "2026-07-08T12:00:00+08:00"
  405. }
  406. },
  407. "mock": { "http_status": 200, "delay_ms": 150, "biz_status": "pending_sign" }
  408. },
  409. {
  410. "id": "contract.status",
  411. "category": "contract",
  412. "name": "合同状态查询",
  413. "method": "GET",
  414. "path": "/v1/contracts/{external_contract_id}",
  415. "description": "主动查询或补偿轮询合同签署状态。",
  416. "fe_action": "contract_status",
  417. "response_success": {
  418. "code": "SUCCESS",
  419. "data": {
  420. "external_contract_id": "EXT_CTR_mock_001",
  421. "status": "SIGNED",
  422. "signed_at": "2026-07-07T14:30:00+08:00",
  423. "pdf_url": "https://oss.mock.example.com/contracts/EXT_CTR_mock_001.pdf"
  424. }
  425. },
  426. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  427. },
  428. {
  429. "id": "contract.download",
  430. "category": "contract",
  431. "name": "下载合同 PDF",
  432. "method": "GET",
  433. "path": "/v1/contracts/{external_contract_id}/download",
  434. "description": "已签署合同 PDF 下载地址。",
  435. "fe_action": "contract_download",
  436. "response_success": {
  437. "code": "SUCCESS",
  438. "data": {
  439. "pdf_url": "https://oss.mock.example.com/contracts/EXT_CTR_mock_001.pdf",
  440. "expire_seconds": 3600
  441. }
  442. },
  443. "mock": { "http_status": 200, "delay_ms": 80, "biz_status": "succeeded" }
  444. },
  445. {
  446. "id": "worker.pool.search",
  447. "category": "worker_resource",
  448. "name": "临时工资源池检索",
  449. "method": "POST",
  450. "path": "/v1/worker-pool/search",
  451. "description": "从第三方人力平台检索可匹配临时工资源(二期可选;一期 Mock 返回空或示例)。",
  452. "fe_action": "worker_pool_search",
  453. "request": {
  454. "region_code": "310000",
  455. "work_type": "warehouse_picker",
  456. "headcount": 20,
  457. "available_date": "2026-07-10"
  458. },
  459. "response_success": {
  460. "code": "SUCCESS",
  461. "data": {
  462. "total": 1,
  463. "items": [
  464. {
  465. "pool_worker_id": "PW_mock_1001",
  466. "name_mask": "李*",
  467. "skills": ["分拣", "叉车证"],
  468. "available_from": "2026-07-10",
  469. "expected_daily_wage": 260,
  470. "verified": true
  471. }
  472. ]
  473. }
  474. },
  475. "mock": { "http_status": 200, "delay_ms": 200, "biz_status": "succeeded" }
  476. },
  477. {
  478. "id": "requirement.create",
  479. "category": "worker_resource",
  480. "name": "创建用工需求(正式提交平台)",
  481. "method": "POST",
  482. "path": "/v1/requirements",
  483. "description": "企业主确认方案后,将用工订单正式提交第三方人力资源平台办理。",
  484. "fe_action": "create_requirement",
  485. "request": {
  486. "request_no": "REQ202607070001",
  487. "order_no": "ORD202607070001",
  488. "batch_no": "BATCH202607070001",
  489. "enterprise_id": "ent_001",
  490. "plan_code": "plan_01",
  491. "work_summary": {
  492. "work_type": "warehouse_picker",
  493. "headcount": 15,
  494. "work_days": 30,
  495. "daily_wage": 280,
  496. "work_location": "上海市浦东新区"
  497. },
  498. "cost_snapshot_id": "COST_SNAP_001",
  499. "registration_url": "https://mp.example.com/register/batch_001"
  500. },
  501. "response_success": {
  502. "code": "SUCCESS",
  503. "data": {
  504. "external_requirement_id": "EXT_REQ_mock_001",
  505. "status": "SUBMITTED",
  506. "platform_order_no": "PLT202607070001",
  507. "estimated_process_days": 3
  508. }
  509. },
  510. "mock": { "http_status": 200, "delay_ms": 250, "biz_status": "processing" }
  511. },
  512. {
  513. "id": "requirement.status",
  514. "category": "worker_resource",
  515. "name": "查询用工需求办理状态",
  516. "method": "GET",
  517. "path": "/v1/requirements/{external_requirement_id}",
  518. "description": "补偿轮询平台办理进度,映射至 fe_employment_order 状态机。",
  519. "fe_action": "query_status",
  520. "response_success": {
  521. "code": "SUCCESS",
  522. "data": {
  523. "external_requirement_id": "EXT_REQ_mock_001",
  524. "status": "IN_PROGRESS",
  525. "current_step": "registration",
  526. "steps": [
  527. { "code": "submitted", "name": "已提交", "done": true },
  528. { "code": "registration", "name": "人员登记中", "done": false },
  529. { "code": "contract", "name": "合同签署", "done": false },
  530. { "code": "settlement", "name": "待结算", "done": false }
  531. ],
  532. "registered_count": 5,
  533. "total_count": 15
  534. }
  535. },
  536. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "processing" }
  537. },
  538. {
  539. "id": "worker.registration.sync",
  540. "category": "worker_resource",
  541. "name": "同步登记人员至平台",
  542. "method": "POST",
  543. "path": "/v1/requirements/{external_requirement_id}/workers",
  544. "description": "临时工在本系统完成登记后,将脱敏摘要同步至第三方平台。",
  545. "fe_action": "worker_registration_sync",
  546. "request": {
  547. "registration_id": "REG202607070001",
  548. "worker_ref": "WRK_mock_001",
  549. "name": "张三",
  550. "id_card_no_enc": "ENC_xxx",
  551. "mobile_enc": "ENC_yyy",
  552. "bank_card_enc": "ENC_zzz",
  553. "reg_status": "submitted"
  554. },
  555. "response_success": {
  556. "code": "SUCCESS",
  557. "data": {
  558. "external_worker_id": "EXT_WRK_mock_001",
  559. "sync_status": "ACCEPTED"
  560. }
  561. },
  562. "mock": { "http_status": 200, "delay_ms": 180, "biz_status": "succeeded" }
  563. },
  564. {
  565. "id": "settlement.create",
  566. "category": "settlement",
  567. "name": "创建结算单",
  568. "method": "POST",
  569. "path": "/v1/settlements",
  570. "description": "向平台提交结算批次与明细。",
  571. "fe_action": "settlement_create",
  572. "request": {
  573. "request_no": "STL202607070001",
  574. "order_no": "ORD202607070001",
  575. "settlement_period": "2026-07",
  576. "items": [
  577. {
  578. "worker_ref": "WRK_mock_001",
  579. "gross_amount": 8400.0,
  580. "tax_amount": 252.0,
  581. "net_amount": 8148.0,
  582. "work_days": 30
  583. }
  584. ],
  585. "total_enterprise_cost": 9200.0
  586. },
  587. "response_success": {
  588. "code": "SUCCESS",
  589. "data": {
  590. "external_settlement_id": "EXT_STL_mock_001",
  591. "status": "PENDING_CONFIRM"
  592. }
  593. },
  594. "mock": { "http_status": 200, "delay_ms": 200, "biz_status": "pending_audit" }
  595. },
  596. {
  597. "id": "settlement.status",
  598. "category": "settlement",
  599. "name": "结算单状态查询",
  600. "method": "GET",
  601. "path": "/v1/settlements/{external_settlement_id}",
  602. "fe_action": "settlement_status",
  603. "response_success": {
  604. "code": "SUCCESS",
  605. "data": {
  606. "external_settlement_id": "EXT_STL_mock_001",
  607. "status": "CONFIRMED"
  608. }
  609. },
  610. "mock": { "http_status": 200, "delay_ms": 80, "biz_status": "succeeded" }
  611. },
  612. {
  613. "id": "payment.batch",
  614. "category": "settlement",
  615. "name": "批量打款",
  616. "method": "POST",
  617. "path": "/v1/payments/batch",
  618. "description": "企业确认结算后发起批量代发。",
  619. "fe_action": "payment_batch",
  620. "request": {
  621. "request_no": "PAY202607070001",
  622. "external_settlement_id": "EXT_STL_mock_001",
  623. "payment_channel": "bank",
  624. "total_amount": 8148.0,
  625. "payee_count": 1
  626. },
  627. "response_success": {
  628. "code": "SUCCESS",
  629. "data": {
  630. "external_payment_id": "EXT_PAY_mock_001",
  631. "status": "PROCESSING"
  632. }
  633. },
  634. "mock": { "http_status": 200, "delay_ms": 300, "biz_status": "processing" }
  635. },
  636. {
  637. "id": "payment.status",
  638. "category": "settlement",
  639. "name": "打款结果查询",
  640. "method": "GET",
  641. "path": "/v1/payments/{external_payment_id}",
  642. "fe_action": "payment_status",
  643. "response_success": {
  644. "code": "SUCCESS",
  645. "data": {
  646. "external_payment_id": "EXT_PAY_mock_001",
  647. "status": "SUCCESS",
  648. "paid_at": "2026-07-07T16:00:00+08:00",
  649. "external_trade_no": "BANK20260707160001"
  650. }
  651. },
  652. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  653. },
  654. {
  655. "id": "tax.withhold.batch",
  656. "category": "tax_invoice",
  657. "name": "个税代征批量申报",
  658. "method": "POST",
  659. "path": "/v1/tax/withhold/batch",
  660. "description": "打款成功后触发个税代扣代缴。",
  661. "fe_action": "tax_withhold",
  662. "request": {
  663. "request_no": "TAX202607070001",
  664. "external_payment_id": "EXT_PAY_mock_001",
  665. "tax_period": "2026-07",
  666. "items": [{ "worker_ref": "WRK_mock_001", "taxable_income": 8400.0, "tax_amount": 252.0 }]
  667. },
  668. "response_success": {
  669. "code": "SUCCESS",
  670. "data": {
  671. "external_tax_id": "EXT_TAX_mock_001",
  672. "status": "PROCESSING"
  673. }
  674. },
  675. "mock": { "http_status": 200, "delay_ms": 250, "biz_status": "processing" }
  676. },
  677. {
  678. "id": "tax.withhold.status",
  679. "category": "tax_invoice",
  680. "name": "个税完税状态查询",
  681. "method": "GET",
  682. "path": "/v1/tax/withhold/{external_tax_id}",
  683. "fe_action": "tax_withhold_status",
  684. "response_success": {
  685. "code": "SUCCESS",
  686. "data": {
  687. "external_tax_id": "EXT_TAX_mock_001",
  688. "status": "COMPLETED",
  689. "certificate_url": "https://oss.mock.example.com/tax/EXT_TAX_mock_001.pdf"
  690. }
  691. },
  692. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  693. },
  694. {
  695. "id": "invoice.apply",
  696. "category": "tax_invoice",
  697. "name": "发票开具申请",
  698. "method": "POST",
  699. "path": "/v1/invoices",
  700. "description": "完税后为企业开具服务费发票。",
  701. "fe_action": "invoice_apply",
  702. "request": {
  703. "request_no": "INV202607070001",
  704. "external_settlement_id": "EXT_STL_mock_001",
  705. "invoice_type": "vat_ordinary",
  706. "amount": 800.0,
  707. "title": "上海某某物流有限公司",
  708. "tax_no": "91310000MA1K3XXXXX"
  709. },
  710. "response_success": {
  711. "code": "SUCCESS",
  712. "data": {
  713. "external_invoice_id": "EXT_INV_mock_001",
  714. "status": "PROCESSING"
  715. }
  716. },
  717. "mock": { "http_status": 200, "delay_ms": 200, "biz_status": "processing" }
  718. },
  719. {
  720. "id": "invoice.status",
  721. "category": "tax_invoice",
  722. "name": "发票状态查询",
  723. "method": "GET",
  724. "path": "/v1/invoices/{external_invoice_id}",
  725. "fe_action": "invoice_status",
  726. "response_success": {
  727. "code": "SUCCESS",
  728. "data": {
  729. "external_invoice_id": "EXT_INV_mock_001",
  730. "status": "ISSUED",
  731. "invoice_code": "031001900111",
  732. "invoice_no": "12345678",
  733. "pdf_url": "https://oss.mock.example.com/invoice/EXT_INV_mock_001.pdf"
  734. }
  735. },
  736. "mock": { "http_status": 200, "delay_ms": 100, "biz_status": "succeeded" }
  737. },
  738. {
  739. "id": "insurance.enroll",
  740. "category": "insurance",
  741. "name": "商业保险投保",
  742. "method": "POST",
  743. "path": "/v1/insurance/enroll",
  744. "description": "为登记人员批量投保意外险/雇主责任险。",
  745. "fe_action": "insurance_enroll",
  746. "request": {
  747. "request_no": "INS202607070001",
  748. "order_no": "ORD202607070001",
  749. "plan_code": "ACCIDENT_STD",
  750. "workers": [{ "worker_ref": "WRK_mock_001", "coverage_start": "2026-07-10" }]
  751. },
  752. "response_success": {
  753. "code": "SUCCESS",
  754. "data": {
  755. "external_policy_id": "EXT_INS_mock_001",
  756. "status": "ACTIVE",
  757. "policy_no": "POLmock20260707001"
  758. }
  759. },
  760. "mock": { "http_status": 200, "delay_ms": 200, "biz_status": "succeeded" }
  761. },
  762. {
  763. "id": "insurance.status",
  764. "category": "insurance",
  765. "name": "保单状态查询",
  766. "method": "GET",
  767. "path": "/v1/insurance/{external_policy_id}",
  768. "fe_action": "insurance_status",
  769. "response_success": {
  770. "code": "SUCCESS",
  771. "data": {
  772. "external_policy_id": "EXT_INS_mock_001",
  773. "status": "ACTIVE",
  774. "certificate_url": "https://oss.mock.example.com/ins/EXT_INS_mock_001.pdf"
  775. }
  776. },
  777. "mock": { "http_status": 200, "delay_ms": 80, "biz_status": "succeeded" }
  778. }
  779. ],
  780. "callbacks": [
  781. {
  782. "id": "callback.identity_verified",
  783. "name": "实名核验结果回调",
  784. "direction": "platform_to_fe_server",
  785. "method": "POST",
  786. "path": "/api/v1/internal/callback/provider/identity-verified",
  787. "description": "第三方异步通知实名结果,fe-server 验签后更新 fe_worker_registration。",
  788. "payload_example": {
  789. "event_id": "EVT_IDV_001",
  790. "event_type": "identity.verified",
  791. "occurred_at": "2026-07-07T10:05:00+08:00",
  792. "data": {
  793. "verify_id": "VER_mock_001",
  794. "registration_id": "REG202607070001",
  795. "status": "PASSED"
  796. }
  797. },
  798. "mock": { "http_status": 200, "response": { "code": 200, "msg": "received" } }
  799. },
  800. {
  801. "id": "callback.contract_signed",
  802. "name": "合同签署完成回调",
  803. "direction": "platform_to_fe_server",
  804. "method": "POST",
  805. "path": "/api/v1/internal/callback/provider/contract-signed",
  806. "payload_example": {
  807. "event_id": "EVT_CTR_001",
  808. "event_type": "contract.signed",
  809. "data": {
  810. "external_contract_id": "EXT_CTR_mock_001",
  811. "signed_at": "2026-07-07T14:30:00+08:00",
  812. "pdf_url": "https://oss.mock.example.com/contracts/EXT_CTR_mock_001.pdf"
  813. }
  814. },
  815. "mock": { "http_status": 200, "response": { "code": 200, "msg": "received" } }
  816. },
  817. {
  818. "id": "callback.payment_result",
  819. "name": "打款结果回调",
  820. "direction": "platform_to_fe_server",
  821. "method": "POST",
  822. "path": "/api/v1/internal/callback/provider/payment-result",
  823. "payload_example": {
  824. "event_id": "EVT_PAY_001",
  825. "event_type": "payment.completed",
  826. "data": {
  827. "external_payment_id": "EXT_PAY_mock_001",
  828. "status": "SUCCESS",
  829. "external_trade_no": "BANK20260707160001"
  830. }
  831. },
  832. "mock": { "http_status": 200, "response": { "code": 200, "msg": "received" } }
  833. },
  834. {
  835. "id": "callback.tax_completed",
  836. "name": "完税证明回调",
  837. "direction": "platform_to_fe_server",
  838. "method": "POST",
  839. "path": "/api/v1/internal/callback/provider/tax-completed",
  840. "payload_example": {
  841. "event_id": "EVT_TAX_001",
  842. "event_type": "tax.withhold.completed",
  843. "data": {
  844. "external_tax_id": "EXT_TAX_mock_001",
  845. "certificate_url": "https://oss.mock.example.com/tax/EXT_TAX_mock_001.pdf"
  846. }
  847. },
  848. "mock": { "http_status": 200, "response": { "code": 200, "msg": "received" } }
  849. },
  850. {
  851. "id": "callback.invoice_issued",
  852. "name": "发票开具回调",
  853. "direction": "platform_to_fe_server",
  854. "method": "POST",
  855. "path": "/api/v1/internal/callback/provider/invoice-issued",
  856. "payload_example": {
  857. "event_id": "EVT_INV_001",
  858. "event_type": "invoice.issued",
  859. "data": {
  860. "external_invoice_id": "EXT_INV_mock_001",
  861. "invoice_no": "12345678",
  862. "pdf_url": "https://oss.mock.example.com/invoice/EXT_INV_mock_001.pdf"
  863. }
  864. },
  865. "mock": { "http_status": 200, "response": { "code": 200, "msg": "received" } }
  866. }
  867. ],
  868. "flow_bindings": [
  869. {
  870. "flow_step": "registration",
  871. "description": "临时工登记后实名核验",
  872. "endpoints": ["identity.verify.two_factor"],
  873. "callback": "callback.identity_verified"
  874. },
  875. {
  876. "flow_step": "contract_signing",
  877. "description": "创建并签署电子劳动合同",
  878. "endpoints": ["contract.create", "contract.sign_url", "contract.status"],
  879. "callback": "callback.contract_signed"
  880. },
  881. {
  882. "flow_step": "plan_confirmed",
  883. "description": "确认方案后提交用工需求至人力平台",
  884. "endpoints": ["requirement.create", "requirement.status"]
  885. },
  886. {
  887. "flow_step": "registration",
  888. "description": "登记人员同步至平台",
  889. "endpoints": ["worker.registration.sync"]
  890. },
  891. {
  892. "flow_step": "settlement_paid",
  893. "description": "结算打款与完税开票",
  894. "endpoints": [
  895. "settlement.create",
  896. "payment.batch",
  897. "tax.withhold.batch",
  898. "invoice.apply"
  899. ],
  900. "callbacks": [
  901. "callback.payment_result",
  902. "callback.tax_completed",
  903. "callback.invoice_issued"
  904. ]
  905. },
  906. {
  907. "flow_step": "ai_risk_diagnose",
  908. "description": "AI 风险诊断与政策问答(只读)",
  909. "endpoints": [
  910. "knowledge.policy.search",
  911. "knowledge.tax.search",
  912. "knowledge.contract.search",
  913. "knowledge.social_security.search"
  914. ]
  915. }
  916. ],
  917. "error_codes": [
  918. { "code": "SUCCESS", "http_status": 200, "biz_status": "succeeded", "message": "成功" },
  919. { "code": "PROCESSING", "http_status": 200, "biz_status": "processing", "message": "处理中" },
  920. { "code": "PENDING_AUDIT", "http_status": 200, "biz_status": "pending_audit", "message": "待审核" },
  921. { "code": "PENDING_SIGN", "http_status": 200, "biz_status": "pending_sign", "message": "待签署" },
  922. { "code": "REJECTED", "http_status": 200, "biz_status": "rejected", "message": "业务拒绝" },
  923. { "code": "INVALID_PARAM", "http_status": 400, "biz_status": "failed", "message": "参数错误" },
  924. { "code": "UNAUTHORIZED", "http_status": 401, "biz_status": "failed", "message": "鉴权失败" },
  925. { "code": "RATE_LIMITED", "http_status": 429, "biz_status": "failed", "message": "请求过于频繁" },
  926. { "code": "INTERNAL_ERROR", "http_status": 500, "biz_status": "failed", "message": "平台内部错误" }
  927. ],
  928. "fe_integration_notes": {
  929. "adapter_interface": "com.fe.integration.HrPlatformClient",
  930. "mock_impl": "MockHrPlatformClient(读取本 JSON 的 endpoints[].mock / response_success)",
  931. "log_table": "fe_provider_api_log",
  932. "log_fields_mapping": {
  933. "action": "endpoints[].fe_action",
  934. "request_payload": "实际请求 JSON",
  935. "response_payload": "response_success 或 response_fail",
  936. "biz_status": "mock.biz_status",
  937. "http_status": "mock.http_status"
  938. },
  939. "ai_knowledge_rule": "政策法规、税务、合同、社保知识禁止由大模型编造;必须通过 knowledge.* 接口获取或读取 fe_policy_rule 缓存。",
  940. "sensitive_data_rule": "调用第三方时传 enc 字段或平台侧 token;日志脱敏;小程序不展示 provider 技术细节。"
  941. }
  942. }