WMS 与劳务商系统之间的人员、叉车证、考勤数据通道。本文为提议版接口契约,字段与规则可按你们实际调整。
The data channel between WMS and supplier systems for workers, forklift certification, and attendance. This is a proposed contract — fields and rules are adjustable to your operation.
基础地址 https://api.flexdock.example/v1 · 全程 HTTPS · 请求/响应均为 JSON · 版本通过路径前缀(/v1)管理。
Base URL https://api.flexdock.example/v1 · HTTPS only · JSON request/response · versioned by path prefix (/v1).
每个供应商分配一把 API Key,绑定唯一 vendor_id。请求头携带:
Each vendor gets an API key bound to a unique vendor_id. Send it in the header:
Authorization: Bearer vk_live_3a9f...e21
Content-Type: application/json
Idempotency-Key: 8f14e45f # POST 去重,可选
vendor_id,并在每一次查询中强制注入该过滤条件。任何访问到非本供应商资源的请求一律返回 403。供应商看不到别家的人员、rate 或考勤。
The server resolves vendor_id from the key and injects it as a filter into every query. Any attempt to touch another vendor's resource returns 403. Vendors never see other vendors' workers, rates, or attendance.
查询参数:status(open / filling / tryout / closed)、shift、date。仅返回本 vendor_id 的需求。
Query params: status (open / filling / tryout / closed), shift, date. Returns only your vendor_id's requests.
{
"data": [{
"request_id": "REQ-2402",
"role": "forklift",
"shift": "night",
"headcount_needed": 4,
"tryout_buffer": 6, # 多要人来试工:需 4 报 6
"forklift_required": true,
"report_time": "2026-06-22T19:00:00-04:00",
"location": "Ontario DC-3",
"urgent": false,
"status": "open"
}]
}
模式 B 下,等价于 WMS 调用供应商的 GET /candidates?request_id= 拉取同样结构。
In Mode B this maps to WMS calling the vendor's GET /candidates?request_id= returning the same shape.
{
"candidates": [{
"external_worker_id": "V-B-10293", # 供应商侧唯一ID,用于去重
"full_name": "Diego R.",
"role": "forklift",
"source": "indeed",
"report_time": "2026-06-22T19:00:00-04:00",
"location": "Ontario",
"bill_rate": 27.0, # 仅本供应商可见
"forklift_cert": {
"status": "valid", # valid | pending | none
"cert_no": "ON-FLT-88421",
"expires_on": "2027-03-01"
}
}]
}
valid,若 expires_on 已过期或缺 cert_no,WMS 自动将该人置为 pending,不进试工名单。
Cert is re-validated server-side. Even if the vendor sends valid, an expired expires_on or missing cert_no flips the worker to pending and keeps them out of the tryout roster.
{
"filled_count": 2,
"reason": "Local pool thin this week; contacted 3 channels, still short."
}
reason 服务端强制 ≥ 40 字符,过短返回 422。原因留档,供供应商内部反思与我方评估。
reason must be ≥ 40 chars (server-enforced); shorter returns 422. Stored for the vendor's review and our evaluation.
{
"results": [
{ "external_worker_id": "V-B-10293", "outcome": "retained" },
{ "external_worker_id": "V-B-10311", "outcome": "released" } # 试工不计费
]
}
考勤以现场签到为准,供应商只读。任何修改都带留痕,用于 HRBP 的考勤修改率监控。
Site check-in is the source of truth; vendors read only. Every change carries an audit trail feeding HRBP's attendance-modification-rate monitoring.
{
"records": [{
"external_worker_id": "V-C-77210",
"request_id": "REQ-2403",
"status": "no_show", # present | no_show | scheduled
"check_in": null,
"modification": { # 有改动时出现
"modified_by": "hrbp.ontario",
"modified_at": "2026-06-22T16:40:00-04:00",
"from": "present", "to": "no_show",
"reason": "Left after 1h, corrected by floor lead"
}
}]
}
| HTTP | 含义 | Meaning |
|---|---|---|
| 401 | API Key 无效或缺失 | Invalid or missing API key |
| 403 | 访问了非本供应商的资源(隔离拦截) | Accessing another vendor's resource (isolation block) |
| 404 | 需求 / 人员不存在 | Request or worker not found |
| 409 | 重复提交(同 external_worker_id / Idempotency-Key) | Duplicate submission (same external_worker_id / Idempotency-Key) |
| 422 | 校验失败(卡点原因过短、叉车证过期等) | Validation failed (reason too short, cert expired, etc.) |
| 429 | 超出频率限制 | Rate limit exceeded |
| 字段 | Field | 说明 | Description | |
|---|---|---|---|---|
| external_worker_id | 必填req | 供应商侧人员唯一ID,去重与跨班次追踪的主键Vendor-side unique worker ID; the key for dedup and cross-shift tracking | ||
| tryout_buffer | sys | 超额试工人数(需 N 报 M)Over-supply headcount for tryout (need N, send M) | ||
| forklift_cert.status | 必填req | valid / pending / none,服务端按有效期复核valid / pending / none; re-checked against expiry server-side | ||
| bill_rate | 仅自见own-only | 本供应商报价,跨供应商不可见Vendor's own rate; never visible cross-vendor | ||
| modification | audit | 考勤改动留痕,喂 HRBP 修改率Attendance change audit; feeds HRBP modification rate | ||