Ship Logger
Ship Logger is a warehouse scan station for OTC Shoppe Express's outbound shipments across three carriers — ePost Global, UPS, and DHL. Packers scan tracking numbers off a shared PIN login; the app detects the carrier, groups ePost Global parcels into consolidated boxes, blocks a number already shipped in a prior submitted shipment, and resolves any tracking number straight back to its Shopify order. A carrier invoice audit catches billing overcharges an undocumented ePost Global feed and ShipStation's own quotes can be reconciled against, and a daily exceptions sweep surfaces stuck or stale shipments before a customer has to ask. Since launch it has also learned to buy and print the master UPS label itself, take late parcels after a day is submitted, and work comfortably on a phone.

Introduction
Ship Logger is a warehouse scan station built for OTC Shoppe Express's outbound shipping desk, covering three carriers: ePost Global (EPG), UPS, and DHL. A packer signs in with a shared 4-digit PIN, scans tracking numbers as parcels go out the door, and the app auto-detects which carrier each number belongs to, groups ePost Global parcels into the numbered boxes they physically ship in, and blocks a number that's already recorded as shipped in an earlier submitted shipment. It's a standalone Next.js app on Vercel, with a Shopify custom app wired in purely as a server-side API credential — packers never need a Shopify login.

Background
Before Ship Logger, the warehouse's entire shipping record was whatever Shopify and the carriers themselves happened to retain. There was no record of what went out on a given day, in which physical box, under which master airbill — so when a customer or a carrier disputed a shipment weeks later, the only way to research it was to dig through Shopify one order at a time, with no way to go the other direction and turn a tracking number back into an order. ePost Global's consolidation workflow made this worse: many parcels get packed into shared 20×20×20 master boxes that ship under one airbill, and nothing recorded which parcel went into which box. Three carriers also meant three different workflows — EPG consolidated and boxed, UPS and DHL each one parcel, one label, shipped direct — that a packer had previously had to track in their head.
The brief was to build a scan station that takes zero setup for the packer (land on the page, start scanning), make every day's shipment a searchable record afterward, and connect a scanned tracking number back to the Shopify order behind it without ever putting warehouse staff into the Shopify admin.
What it does
A packer's day starts at a numeric PIN pad — no username, no password, just a 4-digit code that identifies them and opens (or resumes) that day's shipping session. From there:
- Scanning: a single input field listens for a hardware barcode scanner acting as a keyboard wedge. Each scan is checked against UPS/DHL check-digit validation, classified by carrier from its prefix and shape, and either added to the manifest or flagged as a misread. ePost Global scans land in whichever box is currently active; UPS and DHL scans bypass boxes entirely and go straight onto the session list — same field, no mode switching.
- Submit: closing out the day requires the shipment-level AWB and master UPS tracking number for any EPG boxes, which Ship Logger buys directly through ShipStation and prints, rather than making the packer go generate it elsewhere.
- History and search: every submitted day is a searchable record at
/shipments— paste in a tracking number, an order number, or a recipient name and land on the exact shipment, box, and packer, no matter how long ago it shipped. - Carrier status: nightly crons refresh EPG, UPS, and DHL tracking status for every scan not yet in a terminal state, so a shipment's detail page shows live carrier status next to each tracking number without anyone leaving the app.

The problems it was built to solve
Each of these came from a real gap in how the warehouse ran before Ship Logger, starting with the smaller day-to-day friction and ending with the one that costs real money every month.
A misread scan quietly becoming a bad record
A warehouse barcode scanner is just a very fast keyboard, and a bad read — a dropped character, a double-fire — looks identical to a real one unless something checks it. Left unchecked, that produces a phantom tracking number sitting in the day's manifest with nothing to show it's wrong until someone goes looking for it later.
The fix: every UPS and DHL scan runs through check-digit validation before it's accepted, with a distinct amber warning ("Looks like a misread — rescan?") rather than a silent accept. Duplicate handling is split deliberately: re-scanning a parcel already in today's session is disregarded with a quiet toast naming the box it's already in, while re-scanning a number from a previously submitted shipment blocks loudly, naming the date, box, and packer who shipped it — that one takes an explicit admin override, because it means a parcel is recorded as going out on a day it didn't.
No way to trace a tracking number back to its shipment, weeks later
Before Ship Logger, "what day did this ship, and in which box" had no answer except memory or digging through loose paperwork. A carrier dispute or a customer question arriving a month after the fact meant starting from nothing.
The fix: every submitted day becomes a permanent, searchable record. Global search on /shipments takes a tracking number, order number, or recipient name and resolves straight to the shipment, the specific box, the ship date, and who packed it — the feature that directly replaces "digging through Shopify."
Carrier status scattered across three different places
Each carrier reports shipment status its own way, through its own site, in its own format — UPS's Track API returns HTTP 200 even for a tracking number it has no record of (a quirk the app has to detect by reading a warning code rather than a status code), and ePost Global has no official self-serve API at all. Checking on an in-transit parcel meant bouncing between three different sites by hand.
The fix: a nightly cron refreshes status for every scan not yet in a terminal state, across all three carriers, and surfaces it directly on the shipment detail page next to each tracking number. ePost Global's status comes from an undocumented, unofficial endpoint that returns structured JSON with no authentication — verified working but with zero SLA, so the integration treats a failure there as an expected, non-fatal event: log it, show a small "status unavailable" banner, keep the carrier link-out working, and keep the rest of the app running regardless. That resilience posture matters because it's the one carrier connection in this app that could disappear without notice at any time.
A scanned parcel with no connection to the Shopify order behind it
Shopify's Admin API has no supported way to search orders by tracking number — a long-standing, repeatedly-confirmed gap in its own API surface. Without that link, a packer looking at a tracking number on the bench had no fast way to know whose order it was or where it was headed, and a question like "did this one actually go out" meant a separate trip into the Shopify admin.
The fix: for ePost Global, the app resolves orders through ERef — EPG's own external-reference field, which turns out to be populated with the Shopify order name at label time, giving a fully supported lookup path (orders(query: "name:...")) with no webhook infrastructure needed. UPS and DHL parcels, which carry no such reference, resolve through a locally-maintained order index built from Shopify's fulfillment webhooks. Either way, the order's name, destination, and shipping charge appear right next to the scan the moment it's recorded — enrichment with no per-scan network round-trip, and a parcel that resolves to no order at all is surfaced as a warning rather than silently dropped.
Carrier invoices quietly overcharging, with nothing checking them
EPG bills per parcel against whatever ShipStation quoted when the label was bought, and invoices arrive as a spreadsheet with no built-in way to tell whether a given line was billed correctly. A parcel billed twice, billed at a higher weight than it actually was, or simply charged above the quoted rate looked exactly like a correct line unless someone cross-checked every row by hand — and across a few hundred parcels a month, that's real, recurring money leaking out unnoticed.
The fix: the Invoice Audits page matches every invoice line to its scan (falling back to the final-mile tracking number when needed), compares the billed amount to ShipStation's quote, and sorts each parcel into overcharged, undercharged, billed twice, or no quote available — with net loss, overcharge rate, and a by-cause/by-destination breakdown computed automatically. From there, a dispute can be built, sent to EPG as a CSV with a plain-English cover summary (optionally drafted straight into Gmail), and tracked through to credited or rejected. A nightly job re-checks unverified parcels automatically, so the backlog shrinks on its own instead of waiting on someone to remember.

Problems that went unnoticed until a customer complained
A shipment that's been in transit too long, stuck without a status update for a week, or quietly costing more in shipping than the customer actually paid for it previously had no way to surface itself — someone had to think to go looking, and usually the first sign of trouble was a customer asking where their order was.
The fix: an Exceptions page sweeps every shipment daily for three categories — carrier exceptions, stale shipments with no status movement, and shipping losses where what the customer paid for shipping doesn't cover what the carrier actually billed — and a daily email digest puts the same list in an admin's inbox without them needing to check the app at all. Each problem can be dismissed once it's been looked at, but a dismissal is scoped to that specific problem category, so a shipment that develops a new issue later still shows up again rather than being silenced for good.

What changed after launch
Ship Logger has been in daily use on the packing floor since launch. Most of what followed came straight from watching how a real shipping day goes: a step that sends someone to another website, a parcel that shows up an hour too late, a mistake with no way to undo it. These are the updates that mattered most, and why each one made sense.
Buying the master UPS label without leaving the app
The first version drafted the master UPS shipment in ShipStation and then waited for a person to open ShipStation, enter the box weight, and buy the label by hand. That was cautious by design, but the caution was not earning anything. The recipient pays for these labels, not the warehouse, and every parcel already carries its own weight from the moment it is scanned, so the one number that was blocking an automatic purchase was already in the system.
What changed: the Submit window now adds up each box's weight, buys the label in one click, and prints the PDF automatically. The one click is deliberate, because it is a real purchase. A packer who spots a wrong weight or box count can void the label right there, before or after submitting, and an admin can correct the master tracking number directly instead of reopening the whole day. When ShipStation refuses a purchase, the screen now says why instead of showing a generic failure, and if a label already exists for the shipment, Ship Logger picks it up rather than getting stuck. Drafted shipments also now show up in ShipStation's own order search, where a person can actually find them.
Parcels that turn up after the day is submitted
Real days do not end cleanly. A parcel gets found on a shelf after close-out, or one arrives after Submit. Before this change, the choices were reopening the whole closed day or leaving the parcel out of the record, and both options corrupt the history the app exists to keep.
What changed: a packer can scan parcels into a shipment after it has been submitted. UPS and DHL parcels simply go in. For each ePost Global parcel, the packer chooses between sending it with the next shipment or adding it to a box on this one. Adding it to a box flags the master label for a rebuy, and the rebuy waits until every parcel is weighed, voids the old label, buys a new one, and records the swap in the shipment's notes. Late parcels carry a LATE stamp, show running counts of how many arrived late, and can be taken back out again.
The Submit window also now lists every box with its parcel count and total weight, including the packing allowance, so the figure the label will declare is visible before anyone clicks Buy.
Making mistakes cheap to fix and expensive to make by accident
Once more of the day's work happened inside the app, a stray click could do more damage. A review of every action that changes or removes something found a handful that fired immediately: voiding a bought label, granting or revoking admin access, deactivating a user, marking a dispute as sent, and deleting a draft dispute. Each now asks first. Reactivating a user is left as a single click, because that direction is not the dangerous one. Buying the label stays a single deliberate click as well, because adding a second confirmation there would only slow down the packer without adding protection.
Exceptions and analytics that catch more, and say when they cannot know
The daily exceptions sweep grew to cover DHL pickups that failed or were cancelled, which previously meant a parcel could sit waiting for a driver who was never coming. Order numbers on the Exceptions page now open the Shopify order directly, so working through a problem takes one click instead of a copy and paste. Analytics gained customs figures by country and carrier and an exception rate by weekday, which helps show whether trouble clusters on a particular day.
The other change here is honesty. Where a figure cannot be calculated, such as on-time delivery or rate-shopping savings when ShipStation does not supply the data, the page now says the data is unavailable and why, rather than showing a blank or a misleading zero.
Easier to use on a phone, and one of a family of apps
Ship Logger now sits alongside Order Desk and Product Desk as part of the ami markt toolset, and it was brought in line with them. Each app has its own sign-in color so nobody is unsure which one they are about to use, and Ship Logger's is cardboard brown, with the ami markt logo above it. The main menu was reorganized into Scan and Shipments as tabs, with reports, setup and links to the sister apps grouped under More. On phones, a menu button opens the same list, where the admin pages were previously reachable only through search. Pop-ups can be swiped down to close, pulling down from the top refreshes the page's data, and a Report an issue link in the menu opens the issue inbox that Order Desk already uses. The app also moved to its own address, ship.amimarkt.com.


How it was built
Ship Logger is Next.js (App Router) and TypeScript on Vercel, with Postgres via Drizzle ORM — Supabase in production, through its transaction pooler rather than a direct connection, since each serverless invocation opens its own short-lived connection and the direct-connection limit exhausts fast under concurrent load. A few decisions came directly out of running a real warehouse desk rather than a typical CRUD app:
- The scanner is treated as a keyboard, carefully. A document-level keystroke listener (not a focused input, which breaks the moment someone clicks elsewhere) buffers scans in a ref rather than React state, since per-character
setStatethrashes at scanner speed, and a configured prefix/suffix in the scanner's own firmware backs up the timing heuristic. - Database-level concurrency guards, not just application checks. A partial unique index enforces at most one open shipping session at a time, and another rejects two scans racing to claim the same sequence number in a session — both the kind of race condition that only shows up once, at the worst time, without a hard constraint underneath the application logic.
- An unofficial carrier endpoint, used honestly. The free ePost Global status feed is undocumented and could change or disappear with no notice, so the integration is built to fail soft: a parser anchored on the stable JSON structure rather than fragile page markup, and a failure that degrades to a visible banner rather than taking anything else down.
- Tests and checks on every change. The invoice parser and audit rules have unit tests, and every change runs the tests, a type check and lint before it can ship, because a quiet mistake in the audit math would cost real money.
- Soft-delete and short-lived undo everywhere it matters. A deleted shipment moves to a trash view before a 30-day purge makes it permanent, and a "Reset Day" action snapshots the session first so an accidental reset can be restored rather than simply gone.
The Shopify side is a custom app used purely as a server-side API credential via OAuth client-credentials — no interactive install flow, and no Shopify staff seat for anyone on the packing floor. ShipStation supplies real per-parcel weight, dimensions, and cost once a label exists, which is what makes both the invoice audit and the shipping-loss exception possible at all, and Resend sends the daily exception digest without anyone needing to check the app.
Where to see it
Ship Logger runs live at ship.amimarkt.com as OTC Shoppe Express's day-to-day shipping desk — it's an internal operations tool behind PIN sign-in, not a public product, so the screenshots above use placeholder orders, names, and tracking numbers rather than real shipment data.


