Error Codes
Last updated 2026-10-13
All WMS error codes, their HTTP status, and the OMS error format.
WMS error format#
HTTP 409
{ "code": "WMS_STOCK_001", "message": "库存可用量不足", "details": { "item_id": "…" } }
// body: { code, message, details? } — the HTTP status comes from the code table below.Code table#
- WMS_AUTH_001 · 401 — Not logged in or session expired.
- WMS_PERM_001 · 403 — No WMS app access (not an active org member or app not granted).
- WMS_PERM_002 · 403 — Missing feature permission point.
- WMS_PERM_003 · 403 — Data scope restricted (outside warehouse/merchant scope; merchant users read-only).
- WMS_VALID_001 · 400 — Invalid request parameters (also used for missing required fields and bad JSON body).
- WMS_STATE_001 · 409 — Illegal state transition.
- WMS_STOCK_001 · 409 — Insufficient available inventory.
- WMS_NOT_FOUND_001 · 404 — Resource not found.
- WMS_DUP_001 · 409 — Resource already exists (unique conflict).
- WMS_SERVER_001 · 500 — Internal server error (unhandled exceptions map here; stack details are not exposed).
- BOL_TRUCKLOAD_ONLY · 409 — BOL only supports LTL/FTL shipments (ship_mode=ltl/ftl).
- LOCATION_LOCKED · 409 — Location locked by a count task; operations temporarily unavailable.
- SERIAL_COUNT_MISMATCH · 400 — Serial number count does not match product quantity.
- UOM_IN_USE · 400 — The UOM is referenced by a pallet configuration and cannot be deleted.
- RECEIPT_CLOSED · 400 — The inbound receipt is closed; terminal state cannot be changed.
OMS error format#
HTTP 400
{ "ok": false, "error": "NOT_EDITABLE", "detail": { "status": "confirmed" } }
// OMS uses { ok: false, error, detail? } — different from the WMS envelope above.
// common codes: UNAUTHORIZED | FORBIDDEN_ORGANIZATION | FORBIDDEN_PERMISSION | NOT_WMS_SYNC | NOT_EDITABLEIntegrations should branch on code / error and treat 401/403 first: 401 means re-login or refresh the JWT; 403 usually means the wrong x-organization-id or a missing permission point.