BeeSmart Wholesale logo BeeSmart Developer Portal
STANDARD INTEGRATION标准集成协议
Build with BeeSmart WMS接入 BeeSmart WMS

Default API and Webhook protocol for every new customer integration.面向所有新客户的默认 API 与 Webhook 接入协议。

v1.0English · 中文中英文版本•Offline-ready支持离线浏览

BeeSmart WMS Standard API & Webhook Integration Specification v1.0

中文名称:Chinese title: BeeSmart WMS 标准 API 与 Webhook 集成规范 v1.0

协议版本:Specification version: 1.0
适用对象:Audience: BeeSmart WMS 新客户及外部系统开发人员New BeeSmart WMS customers and external integration developers
文档性质:Status: 面向所有客户的默认标准接入协议Default standard integration specification for all customers

本文件是 BeeSmart WMS 面向新客户提供的默认标准 API 与 Webhook 接入协议,不是某个客户的定制对接说明。六个入站 API 与六个 Webhook 均按当前实现说明。This is BeeSmart WMS’s default API and Webhook specification for new customers, not a customer-specific interface guide. The six inbound APIs and six Webhooks describe current behavior.

本文的字段、类型、路由、状态和示例依据当前已提供的标准接口行为。未由协议定义的内容不会在本文中推断。文中没有客户凭据;示例 Token 已脱敏。Fields, types, routes, statuses, and examples follow the currently provided standard interface behavior. This specification does not infer behavior that is not defined by the protocol. No customer credentials are included; sample Tokens are redacted.

文中的客户编码、订单参考号、产品编码、托盘号及 Lot/Serial 号均为可替换的示例值。实际接入时使用由 BeeSmart 提供或双方确认的业务编码。Customer codes, order references, product codes, package codes, and Lot/Serial names are replaceable example values. Use business codes provided by BeeSmart or agreed by both parties for each deployment.

1. 接入模型Integration model

外部系统通过入站 API 向 BeeSmart 提交产品、订单或库存查询。BeeSmart 在后续仓储业务节点发生时,通过 Webhook 主动通知外部系统。订单创建本身不会创建 Webhook 订阅,也不会立即触发完成类通知。External systems submit products, orders, and inventory queries through inbound APIs. BeeSmart sends Webhooks when later warehouse business events occur. Creating an order does not create a Webhook subscription and does not immediately trigger a completion notification.

1.1 长期订阅Persistent subscriptions

Webhook Subscription 在业务开始前配置并保持启用,直到双方变更或停用。客户提供接收 URL、所需 Event Code、Project Scope 和接收端认证要求;BeeSmart 集成管理员配置订阅。订单 API 请求中没有订阅字段,本项目没有供客户逐单调用的订阅 API。A Webhook Subscription is configured before business activity and remains enabled until changed or disabled by agreement. The customer provides a receiver URL, required Event Codes, Project Scope, and receiver-authentication requirements; a BeeSmart integration administrator configures it. Order API requests have no subscription field, and there is no customer-facing per-order subscription API.

只有启用且业务范围匹配的订阅会收到新事件。没有匹配订阅时,业务仍可继续,但不会发送 Webhook;新建订阅不会补发历史事件。一个业务事件可对应零个或多个匹配接收目标。Only active subscriptions with matching business scope receive new events. Without a matching subscription, business processing may continue but no Webhook is sent. A new subscription does not backfill historical events. One business event may have zero or multiple matching receivers.

订阅模式为 Automatic 或 Manual。Automatic 在业务事件和待投递记录提交后自动发送;Manual 等待有权限的 BeeSmart 操作人员触发发送,不会重复执行原仓储业务。Subscriptions use Automatic or Manual mode. Automatic delivery is sent after the business event and delivery record are committed. Manual delivery waits for an authorized BeeSmart operator and does not repeat the underlying warehouse operation.

1.2 业务事实与库存Business facts and inventory

订单 API 创建、修改或取消业务指令,不自行执行入库、出库或移库库存移动。库存变化由实际仓储作业记账。验货确认、查验拣货确认、离仓确认及实盘确认是业务事件节点,本身不额外移动库存。Order APIs create, update, or cancel business instructions; they do not perform inbound, outbound, or transfer stock movements themselves. Inventory changes are posted by actual warehouse operations. Inspection, picking-check, departure, and physical-count confirmations are business-event nodes and do not create additional stock movements by themselves.

2. 认证与授权Authentication and authorization

2.1 获取 TokenObtain a Token

HTTP
POST {API_BASE_URL}/wd_api/v1/auth/token
Content-Type: application/json
JSON
{
  "api_key": "<assigned by BeeSmart>",
  "api_secret": "<provided through an agreed secure channel>"
}
字段Field类型Type必填Required说明Description
api_keystring是YesBeeSmart 分配的 API 身份标识API identity issued by BeeSmart
api_secretstring是Yes与 api_key 配对的 Secret,通过双方认可的安全渠道提供Secret paired with api_key, delivered through an agreed secure channel

成功响应包含 access_token、token_type 和 expires_at。expires_at 为 UTC 时间;客户端应以每次响应中的值为准。当前默认 Token TTL 为 3600 秒,但部署配置可以调整。The success response contains access_token, token_type, and expires_at. expires_at is UTC; clients must use the value returned with each Token. The current default Token TTL is 3600 seconds, but deployment configuration may change it.

JSON
{
  "access_token": "<redacted>",
  "token_type": "Bearer",
  "expires_at": "2026-12-04T12:10:47Z"
}
字段Field类型Type必有Required说明Description
access_tokenstring是Yes后续 API 调用使用的 TokenToken for subsequent API calls
token_typestring是Yes当前返回 BearerCurrently Bearer
expires_atstring datetime是YesUTC 时间,格式 YYYY-MM-DDTHH:MM:SSZUTC time in YYYY-MM-DDTHH:MM:SSZ format

Token 过期或撤销后必须重新获取。不要把 API Secret 或 Token 写入源代码、普通日志或工单。Obtain a new Token after expiration or revocation. Do not place API Secrets or Tokens in source code, ordinary logs, or tickets.

2.2 入站 API HeaderInbound API headers

所有业务 API 使用以下 Header。Bearer 前缀及空格必需:Use the following headers for all business APIs. The Bearer prefix and following space are required:

HTTP
Authorization: Bearer <access_token>
Content-Type: application/json

IN01–IN05 写入接口还必须提供 Idempotency-Key。IN06 为只读查询,不要求此 Header。Write APIs IN01–IN05 also require Idempotency-Key. Read-only IN06 does not.

Idempotency-Key 是调用方为一次写入动作提供的非空标识。同一动作重试必须复用原 Key 和完全相同的请求内容;新的动作(包括同一订单的后续 Update 或 Cancel)使用新的 Key。相同 Key、相同 Payload 的已成功请求返回已保存的业务结果,不重复执行,并在本次响应中设置 replayed=true;本次请求仍有自己的 request_id。Idempotency-Key is a non-empty identifier supplied by the caller for one write action. Retry the same action with the same Key and identical request body. Use a new Key for a new action, including a later Update or Cancel for the same order. A successful request with the same Key and Payload returns the saved business result without executing again and sets replayed=true; this HTTP request still has its own request_id.

2.3 授权范围Authorization scope

API User 必须获准调用目标 Endpoint,并获准请求中的 project_code。Project Scope 不在 Token 请求中传递;它通过业务请求中的 project_code 与该 API User 已配置的范围匹配。请求中的 Owner、Warehouse、产品及订单还必须与 Project 的业务关系一致。The API User must be authorized for the Endpoint and the request’s project_code. Project Scope is not passed in the Token request; it is matched from the business request’s project_code against the API User’s configured scope. The Owner, Warehouse, products, and orders in the request must also match the Project’s business relationships.

3. 通用入站 API 规范Common inbound API rules

3.1 路由与传输Routes and transport

Endpoint中文NameMethodPath
IN01入库订单Inbound OrderPOST/wd_api/v1/inbound-orders
IN02出库订单Outbound OrderPOST/wd_api/v1/outbound-orders
IN03移库订单Transfer OrderPOST/wd_api/v1/transfer-orders
IN04盘点订单Stocktake OrderPOST/wd_api/v1/stocktake-orders
IN05产品新增或更新Product UpsertPOST/wd_api/v1/products/upsert
IN06实际物理库存查询Physical Inventory QueryPOST/wd_api/v1/inventory/query

所有请求和响应均为 UTF-8 JSON。完整 URL 为 {API_BASE_URL} 加上 Path。All requests and responses are UTF-8 JSON. The full URL is {API_BASE_URL} plus the listed Path.

3.2 成功与错误包络Success and error envelopes

成功响应的 HTTP 状态为 200,公共响应包络如下:Successful responses use HTTP 200 and the following common envelope:

JSON
{
  "request_id": "<request correlation identifier>",
  "data": {},
  "replayed": false
}

data 按 Endpoint 定义。重放已成功的幂等写入结果时 replayed 可为 true;新执行的请求为 false。错误包络见第 7 节。data is endpoint-specific. A replayed successful idempotent write may have replayed=true; a newly executed request has false. See Section 7 for the error envelope.

字段Field类型Type必有Required说明Description
request_idstring是Yes本次 HTTP 请求的关联标识Correlation identifier for this HTTP request
dataobject是YesEndpoint 专属结果Endpoint-specific result
replayedboolean是Yes是否返回相同幂等请求已保存的成功结果Whether a saved success result for the same idempotent request was returned

订单 API(IN01–IN04)的 data 字段:order_type 为 inbound、outbound、transfer 或 stocktake;action 为 create、update 或 cancel;reference 为客户业务单号;order_number 为 BeeSmart 单号;state 为 draft、confirmed、done 或 cancelled。For order APIs (IN01–IN04), data contains: order_type (inbound, outbound, transfer, or stocktake), action (create, update, or cancel), reference (customer business reference), order_number (BeeSmart order number), and state (draft, confirmed, done, or cancelled).

IN05 的 data 字段为 owner_code、product_code、product_name、tracking(none、lot、serial)和 operation(created、updated)。IN06 的 data 字段为 project_code、owner_code、warehouse_code 和 items 数组;items 的字段定义见 IN06。IN05 data contains owner_code, product_code, product_name, tracking (none, lot, serial), and operation (created, updated). IN06 data contains project_code, owner_code, warehouse_code, and an items array defined under IN06.

data 字段data field类型TypeEndpoint说明Description
order_typestring enumIN01–IN04inbound、outbound、transfer、stocktake 之一One of inbound, outbound, transfer, stocktake
actionstring enumIN01–IN04create、update、cancel 之一One of create, update, cancel
referencestring(100)IN01–IN04客户订单参考号Customer order reference
order_numberstring(100)IN01–IN04BeeSmart 订单号BeeSmart order number
statestring enumIN01–IN04draft、confirmed、done、cancelled 之一One of draft, confirmed, done, cancelled
owner_codestring(100)IN05货主编码Owner code
product_codestring(100)IN05货主产品编码Owner product code
product_namestring(255)IN05产品名称Product name
trackingstring enumIN05none、lot、serial 之一One of none, lot, serial
operationstring enumIN05created 或 updatedcreated or updated
project_codestring(100)IN06Project code
owner_codestring(100)IN06Owner code
warehouse_codestring(40)IN06Warehouse code
itemsarray<object>IN06实际库存明细;字段见 IN06Physical inventory rows; see IN06

3.3 订单动作Order actions

IN01–IN04 的 action 取 create、update 或 cancel。订单 reference 在适用 Company 范围内唯一。For IN01–IN04, action is create, update, or cancel. An order reference is unique within the applicable Company.

  • Create:新建 Draft 业务单。Create 和 Update 必须提交非空 details;IN01 和 IN02 的 Create 还要求对应收发类别。
  • Update:只允许更新 Draft 订单;必须提交完整的新明细集合。已确认或已发生仓储作业的订单不可通过接口覆盖。
  • Cancel:只允许取消未完成且没有仓储作业记录的订单。details 可省略;订单身份和授权范围字段仍必填。
  • Create: creates a Draft business order. Create and Update require a non-empty details array; IN01 and IN02 Create also require their corresponding category.
  • Update: only Draft orders may be updated; submit the complete replacement detail set. Confirmed orders or orders with warehouse operations cannot be overwritten through the API.
  • Cancel: only an unfinished order with no warehouse operation record may be cancelled. details may be omitted; order identity and authorization-scope fields remain required.

订单 API 不会因为请求成功而创建 Picking 或改变库存。库存和实际作业由仓储操作完成。Order API success does not create a Picking or change inventory. Actual warehouse work and inventory changes are performed by warehouse operations.

3.4 字段类型约定Field type conventions

string(N) 表示最大字符数 N;decimal(16,4) 表示最多 16 位有效数字、最多 4 位小数。decimal 必须使用 JSON 数值;字符串和布尔值不是合法 decimal。日期格式为 YYYY-MM-DD。必填字段缺失、null 或空白值会被拒绝。只有明确标为 Nullable 的可选字段允许 null;可选字段无值时建议省略。string(N) means a maximum length of N characters. decimal(16,4) means up to 16 digits of precision and 4 fractional digits. A decimal must be a JSON number; strings and booleans are invalid decimals. Dates use YYYY-MM-DD. Missing, null, or blank required values are rejected. Only optional fields explicitly marked Nullable accept null; omit optional fields without a value.

字段格式校验与业务校验分开执行。格式合法不代表业务值有效:产品、Owner、Project、Warehouse、收发类别、库位及 Lot/Package 编码仍须存在并符合请求范围。业务规则拒绝时返回 BUS01。Field-format validation is distinct from business validation. A well-formed value is not necessarily a valid business value: products, Owners, Projects, Warehouses, categories, locations, and Lot/Package codes must exist and match the request scope. A business-rule rejection returns BUS01.

4. 六个标准入站 APISix standard inbound APIs

入库订单4.1 IN01 — Inbound Order

字段Field类型Type必填Required含义Meaning
actionstring enum是:create/update/cancelYes操作Action
referencestring(100)是Yes客户外部订单号,同 Company 内唯一Customer reference, unique within Company
project_codestring(100)是Yes授权 Project CodeAuthorized Project Code
owner_codestring(100)是Yes项目货主代码Project Owner Code
warehouse_codestring(40)是Yes项目仓库代码Project Warehouse Code
order_datedate, nullable否NoYYYY-MM-DD;Create 时省略或为 null 使用当前业务日期,Update 时省略或为 null 保留原值On Create, omission or null uses the current business date; on Update, omission or null preserves the existing value
remarkstring(2000), nullable否No订单备注Order remark
receipt_category_codestring(100), nullableCreate 必填;Update 可省略Required for Create; optional for Update入库收货类别Inbound receipt category
detailsarray<object>Create/Update 必填且非空;Cancel 可省略Non-empty for Create/Update; optional for Cancel产品明细Product lines
details[].product_codestring(100)是Yes当前货主的有效产品编码Active product code for Owner
details[].quantitydecimal(16,4)是Yes正数入库数量Positive inbound quantity
details[].remarkstring(500), nullable否No明细备注Line remark

Create 示例成功后,系统返回入库订单号;实际验货完成时发布 inbound.received,实际收货并上架完成时发布 inbound.completed。After a successful Create, the system returns the inbound order number. inbound.received is published after inspection; inbound.completed after actual receipt and putaway.

JSON
{
  "action": "create",
  "reference": "EXT-IN-2026-0001",
  "project_code": "PROJECT-A",
  "owner_code": "OWNER-A",
  "warehouse_code": "WH-A",
  "order_date": "2026-12-04",
  "receipt_category_code": "RECEIPT-STD",
  "remark": "Inbound order with Serial, Lot and untracked products",
  "details": [
    {"product_code": "SKU-SERIAL-001", "quantity": 3, "remark": "Three serial units"},
    {"product_code": "SKU-LOT-001", "quantity": 4, "remark": "Four lot-tracked units"},
    {"product_code": "SKU-STANDARD-001", "quantity": 5, "remark": "Five untracked units"}
  ]
}
JSON
{
  "request_id": "470186b96faf4e16b758fd5bef958325",
  "data": {
    "order_type": "inbound",
    "action": "create",
    "reference": "EXT-IN-2026-0001",
    "order_number": "IN/2026/000078",
    "state": "draft"
  },
  "replayed": false
}

出库订单4.2 IN02 — Outbound Order

字段Field类型Type必填Required含义Meaning
actionstring enum是:create/update/cancelYes操作Action
referencestring(100)是Yes客户外部订单号,同 Company 内唯一Customer reference, unique within Company
project_codestring(100)是Yes授权 Project CodeAuthorized Project Code
owner_codestring(100)是Yes项目货主代码Project Owner Code
warehouse_codestring(40)是Yes项目仓库代码Project Warehouse Code
order_datedate, nullable否NoYYYY-MM-DD;Create 时省略或为 null 使用当前业务日期,Update 时省略或为 null 保留原值On Create, omission or null uses the current business date; on Update, omission or null preserves the existing value
remarkstring(2000), nullable否No订单备注Order remark
delivery_category_codestring(100), nullableCreate 必填;Update 可省略Required for Create; optional for Update出库发货类别Outbound delivery category
detailsarray<object>Create/Update 必填且非空;Cancel 可省略Non-empty for Create/Update; optional for Cancel产品明细Product lines
details[].product_codestring(100)是Yes当前货主的有效产品编码Active product code for Owner
details[].quantitydecimal(16,4)是Yes正数出库数量Positive outbound quantity
details[].remarkstring(500), nullable否No明细备注Line remark

Create 本身不预留或扣减库存。查验拣货确认时发布 outbound.prepared,实际离仓确认时发布 outbound.shipped。Create does not reserve or deduct stock. outbound.prepared is published after picking check; outbound.shipped after actual departure confirmation.

JSON
{
  "action": "create",
  "reference": "EXT-OUT-2026-0001",
  "project_code": "PROJECT-A",
  "owner_code": "OWNER-A",
  "warehouse_code": "WH-A",
  "order_date": "2026-12-04",
  "delivery_category_code": "DELIVERY-STD",
  "remark": "Outbound from received and transferred stock",
  "details": [
    {"product_code": "SKU-SERIAL-001", "quantity": 2, "remark": "Two serial units"},
    {"product_code": "SKU-LOT-001", "quantity": 2, "remark": "Two units from received lot"},
    {"product_code": "SKU-STANDARD-001", "quantity": 4, "remark": "Four untracked units"}
  ]
}
JSON
{
  "request_id": "bceba4a6b4f64621bc31952fb88c2e3a",
  "data": {
    "order_type": "outbound",
    "action": "create",
    "reference": "EXT-OUT-2026-0001",
    "order_number": "OUT/2026/000032",
    "state": "draft"
  },
  "replayed": false
}

移库订单4.3 IN03 — Transfer Order

字段Field类型Type必填Required含义Meaning
actionstring enum是:create/update/cancelYes操作Action
referencestring(100)是Yes外部移库单号External transfer reference
project_codestring(100)是Yes授权 Project CodeAuthorized Project Code
owner_codestring(100)是Yes货主代码Owner Code
warehouse_codestring(40)是Yes仓库代码Warehouse Code
order_datedate, nullable否NoYYYY-MM-DD;Create 时省略或为 null 使用当前业务日期,Update 时省略或为 null 保留原值On Create, omission or null uses the current business date; on Update, omission or null preserves the existing value
remarkstring(2000), nullable否No订单备注Order remark
detailsarray<object>Create/Update 必填且非空;Cancel 可省略Non-empty for Create/Update; optional for Cancel移库明细Transfer lines
details[].product_codestring(100)是Yes当前货主有效产品编码Active product code for Owner
details[].quantitydecimal(16,4)是Yes正数移库数量Positive transfer quantity
details[].source_locationstring(255)是Yes所选仓库内的内部源库位Internal source location within selected warehouse
details[].destination_locationstring(255)是Yes所选仓库内且不同于源库位的目标库位Internal destination location in selected warehouse, different from source
details[].remarkstring(500), nullable否No明细备注Line remark

只有实际内部移库完成后发布 transfer.completed。transfer.completed is published only after the actual internal transfer is completed.

JSON
{
  "action": "create",
  "reference": "EXT-TR-2026-0001",
  "project_code": "PROJECT-A",
  "owner_code": "OWNER-A",
  "warehouse_code": "WH-A",
  "order_date": "2026-12-04",
  "remark": "Internal transfer",
  "details": [
    {
      "product_code": "SKU-STANDARD-001",
      "quantity": 2,
      "source_location": "WH-A/Stock",
      "destination_location": "WH-A/Stock/Transfer-Bin"
    }
  ]
}
JSON
{
  "request_id": "eab00a16ceba4d92aa2672010b8f21b4",
  "data": {
    "order_type": "transfer",
    "action": "create",
    "reference": "EXT-TR-2026-0001",
    "order_number": "TR/2026/000020",
    "state": "draft"
  },
  "replayed": false
}

盘点订单4.4 IN04 — Stocktake Order

字段Field类型Type必填Required含义Meaning
actionstring enum是:create/update/cancelYes操作Action
referencestring(100)是Yes外部盘点单号External stocktake reference
project_codestring(100)是Yes授权 Project CodeAuthorized Project Code
owner_codestring(100)是Yes货主代码Owner Code
warehouse_codestring(40)是Yes仓库代码Warehouse Code
order_datedate, nullable否NoYYYY-MM-DD;Create 时省略或为 null 使用当前业务日期,Update 时省略或为 null 保留原值On Create, omission or null uses the current business date; on Update, omission or null preserves the existing value
remarkstring(2000), nullable否No订单备注Order remark
detailsarray<object>Create/Update 必填且非空;Cancel 可省略Non-empty for Create/Update; optional for Cancel盘点明细Stocktake lines
details[].product_codestring(100)是YesOwner 产品编码Owner product code
details[].locationstring(255)是Yes所选仓库内的内部库位完整名称Complete internal location name within selected warehouse
details[].counted_quantitydecimal(16,4)是Yes实盘数,可为零,不得为负数Counted quantity; zero allowed, negative rejected
details[].lot_namestring(100), nullable否No适用时的 Lot/Serial 名称Lot/Serial name when applicable
details[].package_codestring(100), nullable否No适用时的现有 Package 编码Existing Package code when applicable
details[].remarkstring(500), nullable否No明细备注Line remark

IN04 不自行调整库存。实盘确认后发布 stocktake.completed。IN04 does not adjust inventory itself. stocktake.completed is published after the physical count is confirmed.

JSON
{
  "action": "create",
  "reference": "EXT-ST-2026-0001",
  "project_code": "PROJECT-A",
  "owner_code": "OWNER-A",
  "warehouse_code": "WH-A",
  "order_date": "2026-12-04",
  "remark": "Physical stocktake",
  "details": [
    {
      "product_code": "SKU-LOT-001",
      "counted_quantity": 2,
      "location": "WH-A/Stock",
      "lot_name": "LOT-2026-001",
      "package_code": "PALLET-2026-001"
    },
    {
      "product_code": "SKU-SERIAL-001",
      "counted_quantity": 1,
      "location": "WH-A/Stock",
      "lot_name": "SN-2026-002",
      "package_code": "PALLET-2026-001"
    },
    {
      "product_code": "SKU-STANDARD-001",
      "counted_quantity": 1,
      "location": "WH-A/Stock/Transfer-Bin",
      "lot_name": null,
      "package_code": null
    }
  ]
}
JSON
{
  "request_id": "bc84ce098d374ff98b62b3a0e77fa611",
  "data": {
    "order_type": "stocktake",
    "action": "create",
    "reference": "EXT-ST-2026-0001",
    "order_number": "ST/2026/000020",
    "state": "draft"
  },
  "replayed": false
}

产品新增或更新4.5 IN05 — Product Upsert

IN05 不使用 action 字段。按 (owner_code, product_code) 匹配货主产品映射:映射不存在时创建,存在时更新;project_code 用于授权及校验货主与项目关系,不属于产品匹配键。产品 Upsert 不创建库存。IN05 has no action field. It matches the owner-product mapping by (owner_code, product_code): create if the mapping does not exist, update if it does. project_code is used for authorization and Owner-to-Project validation; it is not part of the product match key. Product Upsert does not create inventory.

字段Field类型Type必填Required含义Meaning
project_codestring(100)是Yes授权 Project,且对应货主Authorized Project linked to Owner
owner_codestring(100)是Yes货主代码Owner Code
product_codestring(100)是Yes货主范围产品编码Owner-scoped product code
product_namestring(255)是Yes产品名称Product name
uom_namestring(100)是Yes必须匹配唯一有效计量单位Must match one active Unit of Measure
trackingstring enum是Yesnone、lot 或 serial

data 返回 owner_code、product_code、product_name、tracking 和 operation;operation 为 created 或 updated。data returns owner_code, product_code, product_name, tracking, and operation; operation is created or updated.

JSON
{
  "project_code": "PROJECT-A",
  "owner_code": "OWNER-A",
  "product_code": "SKU-SERIAL-001",
  "product_name": "Serial Tracked Product",
  "uom_name": "Units",
  "tracking": "serial"
}
JSON
{
  "request_id": "c59af2060a374f128489c7767b743263",
  "data": {
    "owner_code": "OWNER-A",
    "product_code": "SKU-SERIAL-001",
    "product_name": "Serial Tracked Product",
    "tracking": "serial",
    "operation": "updated"
  },
  "replayed": false
}

示例中的 tracking 还包括 lot 和 none。operation 表示本次调用创建或更新了货主产品映射。The examples also use the tracking values lot and none. operation indicates whether the owner-product mapping was created or updated.

实际物理库存查询4.6 IN06 — Physical Inventory Query

IN06 返回授权范围内已记账的物理库存,不扣除预留数量。可选 product_code 用于单品筛选;省略、null 或空字符串表示查询范围内所有产品;没有库存时 items 为空数组。IN06 returns posted physical inventory within the authorized scope without subtracting reserved quantities. Optional product_code filters a single product; omission, null, or an empty string means all products in scope. If no stock is found, items is an empty array.

字段Field类型Type必填Required含义Meaning
project_codestring(100)是YesProject Code
owner_codestring(100)是YesOwner Code
warehouse_codestring(40)是YesWarehouse Code
product_codestring(100), nullable否No可选产品筛选Optional product filter

data.items[] 字段如下:Fields in data.items[]:

字段Field类型Type必填Required含义Meaning
product_codestring(100)是YesOwner 产品编码Owner product code
product_namestring(255)是Yes产品名称Product name
uom_namestring(100)是Yes计量单位Unit of Measure
location_namestring(255)是Yes内部库位完整名称Complete internal location name
package_codestring(100) or null否NoPackage;无则 nullPackage, null if none
lot_namestring(100) or null否NoLot/Serial;无则 nullLot/Serial, null if none
quantitydecimal(16,4)是Yes按产品、库位、Package、Lot 汇总的物理量Physical quantity by product, location, package, and lot
JSON
{
  "project_code": "PROJECT-A",
  "owner_code": "OWNER-A",
  "warehouse_code": "WH-A"
}
JSON
{
  "request_id": "ab94a8478c4944138602a5cd24a4b9fe",
  "data": {
    "project_code": "PROJECT-A",
    "owner_code": "OWNER-A",
    "warehouse_code": "WH-A",
    "items": [
      {"product_code": "SKU-LOT-001", "product_name": "[SKU-LOT-001] Lot Tracked Product", "uom_name": "Units", "location_name": "WH-A/Stock", "package_code": "PALLET-2026-001", "lot_name": "LOT-2026-001", "quantity": 4.0},
      {"product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "uom_name": "Units", "location_name": "WH-A/Stock", "package_code": "PALLET-2026-001", "lot_name": "SN-2026-001", "quantity": 1.0},
      {"product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "uom_name": "Units", "location_name": "WH-A/Stock", "package_code": "PALLET-2026-001", "lot_name": "SN-2026-002", "quantity": 1.0},
      {"product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "uom_name": "Units", "location_name": "WH-A/Stock", "package_code": "PALLET-2026-002", "lot_name": "SN-2026-003", "quantity": 1.0},
      {"product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "uom_name": "Units", "location_name": "WH-A/Stock", "package_code": "PALLET-2026-002", "lot_name": null, "quantity": 5.0}
    ]
  },
  "replayed": false
}

5. 六个标准 WebhookSix standard Webhooks

5.1 Header 与响应Headers and receiver response

发送端通过 HTTP POST 发送 JSON,基础 Header 为 Content-Type: application/json 和 Accept: application/json。接收认证 Header 可在客户接入配置中另行约定;当前没有强制通用签名 Header。没有配置认证 Header 时,不发送 Authorization。The sender issues an HTTP POST with JSON and base headers Content-Type: application/json and Accept: application/json. Receiver-authentication headers may be agreed during onboarding; there is no mandatory universal signature header. Authorization is not sent unless configured.

客户接收端应在可靠接收并保存消息后返回 2xx。当前发送端根据 HTTP 状态判断结果,不解析响应 JSON。以下给出一个接收端响应示例;响应体内容不参与发送结果判定:The following is an example receiver response. The response body does not determine the delivery result:

若双方配置接收端认证,发送方会按约定的 Header 名和值前缀添加凭据;未配置时不会发送认证 Header。以下仅为一种约定示例,不是固定必需 Header:If receiver authentication is configured by both parties, the sender adds the credential using the agreed header name and value prefix. No authentication header is sent when none is configured. The following is one possible agreement, not a mandatory fixed header:

HTTP
Authorization: Bearer <configured receiver credential>
HTTP
HTTP/1.1 200 OK
Content-Type: application/json

{"accepted":true}

5.2 通用 Payload 字段Common Payload fields

当前 Webhook 协议未规定字段最大长度;下表列出发送报文中的字段。occurred_at 是 UTC 时间值,格式为 YYYY-MM-DD HH:MM:SS 且不带偏移后缀。The current Webhook protocol does not specify maximum field lengths; the table lists fields in the outgoing payload. occurred_at is a UTC value formatted as YYYY-MM-DD HH:MM:SS without an offset suffix.

FieldTypePresence中文说明Description
event_codestringalways标准事件代码Standard event code
schema_versionstringalways当前值为 "1"Current value is "1"
occurred_atstring datetimealways业务事件 UTC 时间UTC business-event time
company_namestringalwaysCompany 名称Company name
project_codestringalways项目代码Project code
owner_codestringalways货主代码Owner code
warehouse_codestringalways仓库代码Warehouse code
order_typestringalwaysinbound、outbound、transfer 或 stocktakeinbound, outbound, transfer, or stocktake
order_numberstringalwaysBeeSmart 业务单号BeeSmart order number
referencestringalways客户原始业务单号Customer’s original reference
order_statestringalways事件发布时业务单状态Order state when the event is published
detailsarray<object>always事件明细Event details
picking_namestringwhen actual Picking applies实际 Picking 名称Actual Picking name
operation_codestringyes in all six current events业务节点代码Business operation code

六类事件使用的 operation_code 为:inbound.received=inspection、inbound.completed=putaway、outbound.prepared=pick_check、outbound.shipped=departure、transfer.completed=transfer_complete、stocktake.completed=stocktake_complete。The six events use these operation_code values: inbound.received=inspection, inbound.completed=putaway, outbound.prepared=pick_check, outbound.shipped=departure, transfer.completed=transfer_complete, and stocktake.completed=stocktake_complete.

5.3 Event 及明细字段Events and detail fields

Event Code业务触发点Business triggerdetails 字段details fields
inbound.received入库验货确认完成Inbound inspection confirmedproduct_code:string, product_name:string, quantity:number, uom_name:string
inbound.completed实际入库及上架完成Actual receipt and putaway completedproduct_code, product_name, quantity, uom_name, lot_name:string or null, package_code:string or null, source_location:string, destination_location:string
outbound.prepared查验拣货确认完成Picking check confirmed与 actual Picking 字段相同Same actual Picking fields
outbound.shipped实际离仓确认Actual departure confirmed与 actual Picking 字段相同Same actual Picking fields
transfer.completed实际内部移库完成Internal transfer completed与 actual Picking 字段相同Same actual Picking fields
stocktake.completed实盘结果确认完成Physical count confirmedproduct_code, product_name, uom_name, location, book_quantity:number, counted_quantity:number, variance:number, lot_name:string or null, package_code:string or null

Webhook 明细字段定义Webhook detail field definitions

入库验货明细(inbound.received):product_code string、product_name string、quantity number、uom_name string,均必有。Inbound inspection detail (inbound.received): product_code string, product_name string, quantity number, and uom_name string; all are present.

实际库存作业明细(inbound.completed、outbound.prepared、outbound.shipped、transfer.completed):product_code string、product_name string、quantity number、uom_name string、lot_name string|null、package_code string|null、source_location string、destination_location string,均为当前 Webhook 报文输出字段。Lot/Package 可为空。Physical operation detail (inbound.completed, outbound.prepared, outbound.shipped, transfer.completed): product_code string, product_name string, quantity number, uom_name string, lot_name string|null, package_code string|null, source_location string, and destination_location string. These are the fields emitted by the current outgoing event format; Lot/Package may be null.

实盘明细(stocktake.completed):product_code string、product_name string、uom_name string、book_quantity number、counted_quantity number、variance number、location string、lot_name string|null、package_code string|null,均为当前 Webhook 报文输出字段。variance 等于 counted_quantity 减去 book_quantity。本协议未定义这些字段的最大长度或 decimal 精度。Physical count detail (stocktake.completed): product_code string, product_name string, uom_name string, book_quantity number, counted_quantity number, variance number, location string, lot_name string|null, and package_code string|null. variance equals counted_quantity minus book_quantity. This specification does not define maximum lengths or decimal precision for these fields.

inbound.received 是验货业务事实,不包含实际 Picking/Lot/Package;inbound.completed 使用已完成入库作业的实际行。outbound.shipped 不进行第二次库存移动。inbound.received represents inspection and does not contain actual Picking/Lot/Package data. inbound.completed uses actual completed receipt lines. outbound.shipped does not create a second stock movement.

5.4 inbound.received 报文示例inbound.received Payload Example

JSON
{
  "company_name": "My Company",
  "details": [
    {"product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 3, "uom_name": "Units"},
    {"product_code": "SKU-LOT-001", "product_name": "[SKU-LOT-001] Lot Tracked Product", "quantity": 4, "uom_name": "Units"},
    {"product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 5, "uom_name": "Units"}
  ],
  "event_code": "inbound.received",
  "occurred_at": "2026-12-04 10:15:06",
  "operation_code": "inspection",
  "order_number": "IN/2026/000078",
  "order_state": "confirmed",
  "order_type": "inbound",
  "owner_code": "OWNER-A",
  "project_code": "PROJECT-A",
  "reference": "EXT-IN-2026-0001",
  "schema_version": "1",
  "warehouse_code": "WH-A"
}

5.5 inbound.completed 报文示例inbound.completed Payload Example

JSON
{
  "company_name": "My Company",
  "details": [
    {"destination_location": "WH-A/Stock", "lot_name": "SN-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "Partners/Vendors", "uom_name": "Units"},
    {"destination_location": "WH-A/Stock", "lot_name": "SN-2026-002", "package_code": "PALLET-2026-001", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "Partners/Vendors", "uom_name": "Units"},
    {"destination_location": "WH-A/Stock", "lot_name": "SN-2026-003", "package_code": "PALLET-2026-002", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "Partners/Vendors", "uom_name": "Units"},
    {"destination_location": "WH-A/Stock", "lot_name": "LOT-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-LOT-001", "product_name": "[SKU-LOT-001] Lot Tracked Product", "quantity": 4, "source_location": "Partners/Vendors", "uom_name": "Units"},
    {"destination_location": "WH-A/Stock", "lot_name": null, "package_code": "PALLET-2026-002", "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 5, "source_location": "Partners/Vendors", "uom_name": "Units"}
  ],
  "event_code": "inbound.completed",
  "occurred_at": "2026-12-04 10:19:01",
  "operation_code": "putaway",
  "order_number": "IN/2026/000078",
  "order_state": "done",
  "order_type": "inbound",
  "owner_code": "OWNER-A",
  "picking_name": "WH-A/IN/00040",
  "project_code": "PROJECT-A",
  "reference": "EXT-IN-2026-0001",
  "schema_version": "1",
  "warehouse_code": "WH-A"
}

5.6 transfer.completed 报文示例transfer.completed Payload Example

JSON
{
  "company_name": "My Company",
  "details": [
    {"destination_location": "WH-A/Stock/Transfer-Bin", "lot_name": null, "package_code": "PALLET-2026-002", "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 2, "source_location": "WH-A/Stock", "uom_name": "Units"}
  ],
  "event_code": "transfer.completed",
  "occurred_at": "2026-12-04 10:27:13",
  "operation_code": "transfer_complete",
  "order_number": "TR/2026/000020",
  "order_state": "done",
  "order_type": "transfer",
  "owner_code": "OWNER-A",
  "picking_name": "WH-A/INT/00012",
  "project_code": "PROJECT-A",
  "reference": "EXT-TR-2026-0001",
  "schema_version": "1",
  "warehouse_code": "WH-A"
}

5.7 outbound.prepared 报文示例outbound.prepared Payload Example

JSON
{
  "company_name": "My Company",
  "details": [
    {"destination_location": "Partners/Customers", "lot_name": "SN-2026-003", "package_code": "PALLET-2026-002", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": "SN-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": "LOT-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-LOT-001", "product_name": "[SKU-LOT-001] Lot Tracked Product", "quantity": 2, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": null, "package_code": "PALLET-2026-002", "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 3, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": null, "package_code": null, "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 1, "source_location": "WH-A/Stock/Transfer-Bin", "uom_name": "Units"}
  ],
  "event_code": "outbound.prepared",
  "occurred_at": "2026-12-04 10:29:00",
  "operation_code": "pick_check",
  "order_number": "OUT/2026/000032",
  "order_state": "confirmed",
  "order_type": "outbound",
  "owner_code": "OWNER-A",
  "picking_name": "WH-A/OUT/00024",
  "project_code": "PROJECT-A",
  "reference": "EXT-OUT-2026-0001",
  "schema_version": "1",
  "warehouse_code": "WH-A"
}

5.8 outbound.shipped 报文示例outbound.shipped Payload Example

JSON
{
  "company_name": "My Company",
  "details": [
    {"destination_location": "Partners/Customers", "lot_name": "SN-2026-003", "package_code": "PALLET-2026-002", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": "SN-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "quantity": 1, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": "LOT-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-LOT-001", "product_name": "[SKU-LOT-001] Lot Tracked Product", "quantity": 2, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": null, "package_code": "PALLET-2026-002", "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 3, "source_location": "WH-A/Stock", "uom_name": "Units"},
    {"destination_location": "Partners/Customers", "lot_name": null, "package_code": null, "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "quantity": 1, "source_location": "WH-A/Stock/Transfer-Bin", "uom_name": "Units"}
  ],
  "event_code": "outbound.shipped",
  "occurred_at": "2026-12-04 10:29:30",
  "operation_code": "departure",
  "order_number": "OUT/2026/000032",
  "order_state": "done",
  "order_type": "outbound",
  "owner_code": "OWNER-A",
  "picking_name": "WH-A/OUT/00024",
  "project_code": "PROJECT-A",
  "reference": "EXT-OUT-2026-0001",
  "schema_version": "1",
  "warehouse_code": "WH-A"
}

5.9 stocktake.completed 报文示例stocktake.completed Payload Example

JSON
{
  "company_name": "My Company",
  "details": [
    {"book_quantity": 2, "counted_quantity": 2, "location": "WH-A/Stock", "lot_name": "LOT-2026-001", "package_code": "PALLET-2026-001", "product_code": "SKU-LOT-001", "product_name": "[SKU-LOT-001] Lot Tracked Product", "uom_name": "Units", "variance": 0},
    {"book_quantity": 1, "counted_quantity": 1, "location": "WH-A/Stock", "lot_name": "SN-2026-002", "package_code": "PALLET-2026-001", "product_code": "SKU-SERIAL-001", "product_name": "[SKU-SERIAL-001] Serial Tracked Product", "uom_name": "Units", "variance": 0},
    {"book_quantity": 1, "counted_quantity": 1, "location": "WH-A/Stock/Transfer-Bin", "lot_name": null, "package_code": null, "product_code": "SKU-STANDARD-001", "product_name": "[SKU-STANDARD-001] Standard Product", "uom_name": "Units", "variance": 0}
  ],
  "event_code": "stocktake.completed",
  "occurred_at": "2026-12-04 10:30:57",
  "operation_code": "stocktake_complete",
  "order_number": "ST/2026/000020",
  "order_state": "done",
  "order_type": "stocktake",
  "owner_code": "OWNER-A",
  "project_code": "PROJECT-A",
  "reference": "EXT-ST-2026-0001",
  "schema_version": "1",
  "warehouse_code": "WH-A"
}

接收端可在持久化接受通知后返回任意 2xx。以上响应体仅为示例,发送端不会解析响应 JSON。A receiver may return any 2xx after durably accepting the notification. The response body above is illustrative; the sender does not parse response JSON.

6. 幂等与重复通知Idempotency and duplicate notifications

6.1 入站写入接口Inbound write APIs

IN01–IN05 每项新的业务动作使用新的 Idempotency-Key。同一动作因网络问题重试时,使用原 Key 和完全相同的 Payload。相同 Key、相同 Payload 且已有成功结果时,返回已保存的业务结果并设置 replayed=true,不会再次执行业务处理。相同 Key 携带不同 Payload 会返回 IDM03;该 Key 正在处理时返回 IDM01;先前失败的入站操作按当前策略允许重试。Use a new Idempotency-Key for each new business action on IN01–IN05. Retry the same action with the original Key and identical Payload. If that Key and Payload already succeeded, the saved business result is returned with replayed=true and business processing is not repeated. A changed Payload with the same Key returns IDM03; a Key currently being processed returns IDM01; a previously failed inbound operation may be retried under the current policy.

幂等 Header 不替代业务唯一性:IN01–IN04 用已存在的 reference 再次 Create,即使换了 Idempotency-Key,也会被业务规则拒绝;可修改的 Draft 订单使用 Update。IN05 对相同 (owner_code, product_code) 执行 Upsert,会更新该货主产品。The idempotency header does not replace business uniqueness: Create using an existing IN01–IN04 reference is rejected by business rules even with a new Idempotency-Key; use Update for an eligible Draft order. IN05 Upsert with the same (owner_code, product_code) updates that owner product.

IN06 每次执行新的只读查询,不使用持久化业务幂等缓存。IN06 executes a fresh read-only query and does not use a persistent business idempotency cache.

6.2 Webhook 关联和去重Webhook correlation and deduplication

当前 Webhook Payload 没有独立 event_id 或 event_key。客户用 project_code、owner_code、order_type、reference 关联原始业务请求,order_number 关联 BeeSmart 单据,event_code 识别业务节点。按当前一张业务单对每个 Event Code 使用稳定事件身份的行为,接收端建议以 (project_code, order_type, reference, event_code) 作为去重键,并持久化首次处理结果。若业务需要同一订单出现多次相同 Event Code,应在集成前与 BeeSmart 确认协议版本,不依赖未提供的事件 ID。The current Webhook Payload has no separate event_id or event_key. Correlate the original request using project_code, owner_code, order_type, and reference; correlate the BeeSmart document using order_number; identify the business node with event_code. Given the current stable-identity behavior for each business order and Event Code, receivers should persist their first result and deduplicate on (project_code, order_type, reference, event_code). If multiple occurrences of the same Event Code per order are required, agree a protocol version with BeeSmart; do not rely on an event ID that is not provided.

Webhook Payload 是事件发生时的固定业务快照;重试不会重新计算后续业务数据。Webhook Payload is a fixed snapshot at event time; a retry does not recalculate later business data.

7. 错误码与投递状态Error codes and delivery states

7.1 入站 API Error CodeInbound API error codes

错误响应格式:Error response:

JSON
{
  "error": {
    "code": "AUTH01",
    "category": "authentication",
    "message": "Authentication failed."
  }
}
错误码Code类别CategoryHTTP公开 Message(原文)/ Public message (verbatim)中文说明及建议Chinese meaning and guidance
AUTH01认证authentication401Authentication failed.认证失败;检查 Token、有效期和状态Authentication failed; check Token, expiry, and status
AUTH02授权authorization403The API identity is not authorized for this endpoint or scope.此身份未获准调用接口或访问范围Identity lacks Endpoint or scope authorization
REQ01校验validation400Required fields are invalid: {fields}必填字段错误;按 fields 修正请求Required fields are invalid; correct the fields listed in the message
TYP01校验validation400Field types are invalid: {fields}字段类型或格式错误;修正字段、日期、decimal 精度或长度Invalid field type or format; correct field, date, decimal precision, or length
IDM01幂等idempotency409The request is already being processed or has already been applied.当前冲突请求正在处理,或该策略拒绝重复执行;相同成功入站请求按本协议幂等规则返回 replayed=trueThe request is processing, or the applicable policy rejects duplicate execution; a successful inbound replay follows this specification and returns replayed=true
IDM02幂等idempotency409The remote result is unknown; manual reconciliation is required.结果未知;先人工核对远端是否处理Result is unknown; manually reconcile whether it was processed remotely
IDM03幂等idempotency409The payload changed for an existing stable event.同一稳定 Key 对应不同报文;新动作使用新 KeyPayload differs for an existing Key; use a new Key for a new action
RATE01限流rate_limit429The request rate limit has been exceeded.超过请求频率限制;降低调用频率Rate limit exceeded; reduce request rate
RATE02内部服务internal500The rate limit service is unavailable.限流服务暂不可用;稍后重试,持续发生时联系支持Rate-limit service unavailable; retry later and contact support if persistent
RATE03配置configuration500The rate limit configuration is invalid.限流配置无效;联系 BeeSmart 支持Invalid rate-limit configuration; contact BeeSmart support
BUS01业务business400The business operation was rejected.业务规则拒绝请求;检查主数据、业务范围及订单状态Business rule rejected the request; check master data, scope, and order state
SYS01内部服务internal500The service could not complete the request.服务未能完成请求;保存 request_id 并联系支持Service could not complete the request; provide request_id to support
CFG01配置configuration500A required API configuration is invalid.必要接口配置无效;联系 BeeSmart 支持Required API configuration is invalid; contact BeeSmart support

上表中的英文 message 是 API 当前公开返回文本;相邻建议提供中文说明,不改变返回内容。错误响应只包含 error.code、error.category、error.message,不包含内部诊断细节。The English message in the table is the current public API text; the guidance is a Chinese explanation and does not alter the response. Error responses contain only error.code, error.category, and error.message; internal diagnostic details are not returned.

7.2 Webhook 投递结果Webhook delivery outcomes

状态State当前含义Current meaning接收端建议Receiver guidance
pending待投递PendingAutomatic 等调度;Manual 等待操作人员Wait for schedule or operator
processing正在发送Sending等待结果,不重复执行业务操作Wait; do not repeat business action
succeededHTTP 2xx / Any HTTP 2xx视为已接收,完成本地处理Treat as accepted and finish local processing
failedHTTP 4xx、最终返回的 3xx,或连接超时HTTP 4xx, a final 3xx response, or a connection timeout修复接收端后由授权人员手动重试Fix receiver; authorized operator may retry
unknownHTTP 5xx、读取超时或其他无法判断是否已接收的传输异常HTTP 5xx, read timeout, or another transport exception with uncertain acceptance先查接收记录;不自动重发Check receiver records; no automatic resend
blocked目标、授权或配置不可用且未发送Target, authorization, or configuration unavailable; not sent联系 BeeSmart 管理员Contact BeeSmart administrator

上述是 BeeSmart 侧的投递处理结果,不是 Webhook Payload 字段。These are BeeSmart-side delivery outcomes, not fields in the Webhook payload.

HTTP 5xx、读取超时及其他无法判断远端是否处理的情况是 unknown,不自动重发。接收端与 BeeSmart 应先按去重键核对是否已处理,再由授权人员处置。HTTP 5xx, read timeouts, and other uncertain outcomes are unknown and are not automatically resent. The receiver and BeeSmart should reconcile by the deduplication key before an authorized operator acts.

8. 完整业务交互实例End-to-end business interaction

以下为产品、库存、入库、移库、出库、盘点和六类通知之间的顺序关系。订单 API 响应中的 reference 是客户原始单号,order_number 是 BeeSmart 单号;客户应保存两者映射。The sequence below shows the relationship among products, inventory, inbound, transfer, outbound, stocktake, and notifications. The order API response reference is the customer’s original number; order_number is the BeeSmart number. Customers should persist their mapping.

顺序Step客户请求和仓库作业Customer request and warehouse workWebhook
1IN05 Upsert serial、lot、普通产品Upsert serial, lot, and untracked products—
2IN06 查询期初实际库存Query opening physical inventory—
3IN01 创建入库 reference EXT-IN-2026-0001;响应 order_number IN/2026/000078Create inbound order; response order_number IN/2026/000078建单不触发完成事件No completion event on order creation
4BeeSmart 完成验货BeeSmart confirms inspectioninbound.received
5BeeSmart 完成实际收货和上架BeeSmart completes actual receipt and putawayinbound.completed
6IN03 创建移库 reference EXT-TR-2026-0001;执行实际移库Create transfer order; complete actual transfertransfer.completed
7IN02 创建出库 reference EXT-OUT-2026-0001Create outbound order建单不触发完成事件No completion event on order creation
8BeeSmart 完成拣货查验BeeSmart confirms picking checkoutbound.prepared
9BeeSmart 确认实际离仓BeeSmart confirms actual departureoutbound.shipped
10IN06 查询出库后物理库存Query physical stock after outbound—
11IN04 创建盘点 reference EXT-ST-2026-0001 并确认实盘Create stocktake and confirm actual countstocktake.completed
12IN06 查询最终物理库存Query final physical stock—

客户端关联步骤:先保存 API 成功响应的 project_code、owner_code、reference 和 data.order_number;收到 Webhook 后使用 project_code、owner_code、order_type、reference 找回客户订单,用 order_number 关联 BeeSmart 单据,再用 event_code 识别业务节点。当前可用复合去重键见第 6.2 节。Client correlation: persist project_code, owner_code, reference, and data.order_number from a successful API response. On Webhook receipt, use project_code, owner_code, order_type, and reference to find the customer order, use order_number to link the BeeSmart document, and use event_code to identify the business node. The current composite deduplication key is specified in Section 6.2.

9. 协议边界Protocol boundaries

当前 Webhook Payload 未提供独立 event_id,也未规定字段最大长度或强制通用签名认证。需要这些能力或同一业务单多次发布相同 Event Code 的客户,须在上线前与 BeeSmart 确认后续协议版本;本版本不假设这些功能已提供。The current Webhook payload does not provide a separate event_id or define maximum field lengths or mandatory universal signature authentication. Customers requiring these capabilities or repeated identical Event Codes for one business order must agree a future protocol version with BeeSmart before go-live; this version does not imply these features are available.

类别代码、Project/Owner/Warehouse 编码及有效产品属于双方环境主数据,需由 BeeSmart 项目负责人提供。Category codes, Project/Owner/Warehouse codes, and valid products are environment master data and must be provided by the BeeSmart project owner.