When a delivery arrives, someone has to check what is inside. In a B2B auto parts e-shop that means picking up a box, reading the part number, finding it in the system, writing down the quantity — and repeating until the pallet is empty. On a phone, in a warehouse with no desk and no keyboard.
I recently added camera-based goods receiving to a white-label auto parts e-shop. Here is how it works and why it is not just “scan a barcode.”
Three ways to identify a box
A box does not always have a barcode — and when it does, the code may not contain a part number the system knows. The scanner tries three approaches in sequence.
1. Native barcode reader (when available)
Chrome on Android has a built-in barcode detector. Open the camera, point it at a box, click — the part number lands in the receipt. The detector runs in the browser, sends no data anywhere, works offline.
The catch: Safari on iOS has no built-in detector. And you do not want a warehouse phone depending on an external CDN that could disappear any day.
2. WebAssembly fallback (when it is not)
For Safari and older browsers, the scanner falls back to ZXing — a barcode reader compiled to WebAssembly. Pulling it from a CDN would mean every goods receipt sends a request to a third-party server. And if that CDN goes down, receiving stops.
The ZXing binary is self-hosted. A build script copies it to public/, and the CSP allows it from the shop’s own domain. No external dependency, no outage.
3. OCR (when there is no barcode)
Some boxes carry the part number printed — letters and digits on cardboard. This is where Tesseract comes in, running on the server. A photo from the camera hits an API endpoint, OCR reads the text, and the system tries to find a matching part in the supplier’s catalogue.
Important: OCR is not perfect. It reads “S” as “5”, “O” as “0”. That is why a scanned code is never accepted automatically — the admin must confirm it. Two seconds of review beats parts on the wrong shelf.
What the system learns
The supplier CoraHB (one of the largest in the industry) cannot be searched by EAN code. When a box carries an EAN the catalogue does not know, the scanner does not discard it — it stores it. The admin pairs the code with the part once, and every later scan of that box names itself.
This “learning” database is the only practical way to handle these codes. The supplier does not provide them, and manual pairing would be madness.
Details that make the difference
- Same box scanned twice → one line with quantity 2, not two lines.
- Unknown code → a line is still created, just with an empty name. One unknown box does not stop the whole delivery.
- Alternative parts → when the catalogue returns alternatives alongside the matched part, the scanned part always comes first in the list — no matter how the supplier sorts.
The result
Goods receiving that used to mean “open a laptop, transcribe numbers from boxes” is now a one-person job with a phone at the pallet. Point, click, next box. No external services, no CDN, no transcription errors.
And when the camera is not an option, the old way still works — the manual number input was never removed.