The situation
Orders came in across a set of merchant storefronts — some Shopify, some WooCommerce — and had to reach carrier systems for pickup and delivery. That handoff was being done semi-manually, and every gap in it cost real money: a parcel that never got booked is a customer who never got their order.
What we did
Built a relay, not a script. Orders are matched to carrier records by barcode, falling back to SKU where a barcode is absent. That sounds like a detail; it is the entire integration. Merchants label stock inconsistently, and an integration that assumes one clean identifier will match the wrong product or nothing at all.
Made failure loud instead of silent. The original failure mode was the dangerous kind: an order that couldn’t be matched simply vanished, with no error anywhere. We added a sweep that reconciles what was received against what was successfully pushed, and surfaces the difference. If an order can’t be relayed, somebody finds out that day.
Handled the carrier’s rate limits properly. Carrier APIs throttle, and throttling arrives exactly when volume is highest — peak season, the worst possible time to lose orders. The relay backs off and retries on rate-limit responses rather than treating them as failures.
Added a heartbeat. A relay that has quietly died looks identical to a relay with nothing to do. A heartbeat distinguishes the two, so a stopped integration is noticed in minutes rather than at the end of the week.
Why it mattered
The measurable win is the hours nobody spends re-keying orders. The real win is the class of problem that stopped existing: orders that fell into a gap between two systems and were only discovered when a customer complained.
Most integrations are written for the happy path. Production is not the happy path.