A WeChat Mini Program Replaces Industrial PDAs for Warehouse Scanning: Concurrency Control and Four Pitfalls
Any team building a thin mobile client on top of an existing ERP will hit the same hard constraints: only whitelisted, ICP-filed HTTPS domains, no direct database access, and no safe way to let a client compute inventory deltas. The six-API template gateway is a reusable pattern for keeping the client thin while preserving server-side authority.
Barcode-driven warehouse work usually means buying an industrial PDA at 2,000–5,000 RMB per unit, then installing, configuring, and upgrading each device. One implementation for small manufacturers and distributors skipped that entirely: warehouse staff scan with a WeChat Mini Program on phones they already carry. Hardware cost drops to zero, no APK is installed, upgrades happen server-side, and training disappears because the staff already live in WeChat.
The mini program only captures and displays. Inventory decrements are computed in server-side transactions with version checks, because two warehouse staff submitting 'read 100, deduct 30' and 'read 100, deduct 20' at the same time will otherwise silently overwrite one update and leave stock at 70 instead of 50. The mini program cannot reach an internal database, so a gateway exposes six generic APIs: login, menu, meta, query, save, and exec. Queries and saves are driven by server-side templates; adding a new query page takes a template row, not backend code.
The production traps are concrete: HTTPS domains must be ICP-filed and whitelisted before review submission; scan calls need camera-only mode and restricted symbologies; low-quality self-printed labels demand a manual-entry and fuzzy-search fallback; shared accounts destroy the audit trail. The same boundary applies in reverse: a phone-based mini program is wrong for high-frequency sorting centers and signal-free cold storage, where industrial PDAs or local caching are necessary.
The biggest cost of industrial PDAs is not the 2,000–5,000 RMB price tag but the maintenance and training burden that follows; a tool already in employees' pockets wins because the interaction model is familiar.
The template-driven six-API gateway only pays off when SQL is already centralized; teams with scattered queries will find the gateway becomes the mess instead of the solution.
Treating scan failure as a normal workflow path rather than an error is what keeps a warehouse system alive; if the only way in is a perfect scan, employees will walk away.
The solution's boundary is as important as its functionality: it deliberately gives up high-frequency sorting and offline operation, which is why it can stay simple.