DEV Community

chuanbuilds
chuanbuilds

Posted on

I Built a Tariff Lookup and Learned Why "Laptop" Is Not a Good Enough Word

Shipping side project hardware internationally made me sit down and actually read the Harmonized System for the first time. Ports and laptops, it turns out, do not live in the same subheading. A laptop is 8471.30 (portable automatic data processing machines); a port replicator or USB hub is a different heading entirely. Same desk, different tax rate.

The interesting engineering problem: tariff schedules are hierarchical — 2-digit chapter, 4-digit heading, 6-digit subheading — and the first six digits are shared across 200+ countries. That means one lookup table can serve the US, EU, UK and China, which is exactly the kind of data structure you want as a static export.

I documented the classification logic while building a laptop import duty reference and it's been the single most useful artifact for quoting customers accurate landed costs. The code is boring; the data model is the product.

Top comments (0)