Menu

That HS code from your supplier (or ChatGPT) might not exist: validating US HTS codes in Python
πŸ“°

That HS code from your supplier (or ChatGPT) might not exist: validating US HTS codes in Python

DEV Community: pythonΒ·anders leeΒ·6 days ago
#JONtElTF
#devtopython#devto#dev#code#lookup
Reading 0:00
15s threshold

If you ship physical goods to the US, every product needs a 10-digit HTS code on the customs entry. Those codes usually come from one of three places: the supplier's invoice, last year's spreadsheet, or more and more often an AI chat answer. All three have the same problem: nobody checks whether the code still exists.

It is easy to get wrong. Here are two real examples from this week's schedule (USITC HTS 2026 Revision 22):

8507.60.0020 is the code CBP rulings from 2016 to 2025 gave lithium-ion power banks. It is not in the current schedule. The US later split lithium-ion batteries into .10 (electric vehicles), .30 (energy storage systems) and .90 (everything else).

6201.40.99.99 looks perfectly plausible for a men's synthetic jacket. It never existed. Language models are very good at producing codes with the right shape.

A wrong code is not just a typo.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.