HS Code Classification
How CargoLint uses AI to suggest Harmonized System codes for your trade documents, and how it checks the codes a document declares.
What Are HS Codes?
The Harmonized System (HS) is an internationally standardized system for classifying traded products. HS codes are:
- 6 digits at the international level - the WCO subheading every country shares
- Extended to 8-10 digits - by each country’s own tariff schedule
- Required for customs clearance - on import and export declarations
- The basis of tariff rates - duty rates, trade agreement preferences and many regulatory requirements key on them
- Standardized internationally - used by more than 200 countries and economies
Example: fresh apples are HS 0808.10, in Chapter 08 (edible fruit and nuts).
How CargoLint Classifies HS Codes
CargoLint uses AI-powered recommendations to match line item descriptions to HS codes. The model understands plain trade language: you describe the goods the way you would on an invoice, and it recommends the most relevant codes.
The system works as follows:
- Read the line item descriptions on an invoice or a certificate of origin
- Analyse each description with the classification pipeline: retrieval over the HS nomenclature, the section and chapter notes, and a language model that reranks the candidates
- Recommend HS codes from the 5,600+ WCO 6-digit subheadings of HS 2022, ranked by relevance
- Return the top suggestions with confidence scores and the reasoning behind each
Suggestions are never applied automatically. A code is assigned to a line only when a person picks it in the HS code search.
Example Line Item
Each line item in GET /api/v1/documents/{id}/extractions carries its suggestions:
{
"index": 0,
"description": "Stainless steel electric mixer",
"originalHsCode": null,
"hsCodeSuggestions": [
{
"code": "8509.40",
"description": "Food grinders and mixers; fruit or vegetable juice extractors",
"confidence": 0.92,
"reasoning": "An electromechanical domestic appliance for mixing food.",
"source": "search"
},
{
"code": "8509.80",
"description": "Other appliances",
"confidence": 0.71,
"reasoning": "Other electromechanical domestic appliances.",
"source": "search"
}
]
}
HS Code Search API
Search for HS codes by product description or keyword:
curl -X GET "https://api.cargolint.com/api/v1/hs-codes/search?q=electric%20mixer&topK=10" \
-H "X-API-Key: YOUR_API_KEY"
topK is between 1 and 20 (10 by default). The search accepts plain-language descriptions: trade wording, brand-agnostic product names, and material or use details all improve the results.
HS Code Versions
CargoLint classifies against HS 2022, the edition in force, and suggests only HS 2022 codes. Codes retired with HS 2017 are not suggested, since they are no longer part of the nomenclature. The HS 2017 nomenclature is kept so the browse and lookup endpoints can show a code by version.
Confidence in HS Code Suggestions
HS code confidence scores determine how suggestions are handled:
- >= 0.70 - The top suggestion is shown as a recommendation to confirm
- 0.25 - 0.70 - Suggestions are shown; the line is flagged as missing a code
- < 0.25 - Suggestions below this floor are dropped; manual classification needed
Whatever the score, a line without a confirmed code holds its document in review.
Checks Applied to a Declared Code
A code printed on a document is checked at two levels, and the two are reported separately because they fail for different reasons.
The first 6 digits are the international (WCO) part every country shares. They are checked two ways: the subheading must exist in the current HS edition, and the line item’s description must independently route to it. When the description routes somewhere else, the code is reported as doubtful; when the subheading does not exist at all, the code is reported as unrecognised, and if exactly one single-digit change produces a code the description does route to, that near-match is offered as the likely intended code. A code your team has confirmed more than once for a near-identical description is not reported as doubtful.
Digits beyond the 6th belong to the destination country’s own tariff schedule, so they can only be checked when that schedule is loaded: the United States (HTS), Canada (10-digit classification numbers), the United Kingdom (10-digit commodity codes) and the European Union (TARIC, read for every member state). Other destinations stop at six digits, and the coverage line says so. The full code is matched against the currently effective lines under its subheading, and where several lines exist the description decides which one applies - or records the single question that would decide it, rather than guessing.
Which of these run depends on the document type:
| Document | Checks applied |
|---|---|
| Invoice, Certificate of Origin | All of the above - the line description describes the product |
| Bill of Lading | Only the checks that read no description: the subheading must exist, and a code longer than 6 digits must be a current tariff line. A B/L cargo line is freight (“said to contain: 36 cartons apparel”), so scoring a code against it would flag correct codes |
| Every other kind | None - their lines carry no HS codes |
The resulting state is shown as a pill on each line in the Document Issues panel; see what each HS code state means for the full list.
The same verdict runs everywhere a document is shown - Document Details, the review editor, and shared documents - so a line renders the same state, and the same badge colour, on every page. When two documents in one shipment declare different codes for the same goods, that disagreement is reported by the shipment consistency checks rather than the per-document rows.
Declared codes also drive other checks: they are matched against the regulated-goods lists, which can add rows to a shipment’s expected-documents checklist.
HS Code Selector (UI)
In the web dashboard, the HS Code Selector lets you:
- Search for codes by description
- Browse the hierarchical HS code tree (97 WCO chapters)
- Select a code and apply it to a line item
Common Classification Challenges
Material Composition
A product’s material can change its subheading:
- Cotton T-shirt - HS 6109.10 (T-shirts, knitted or crocheted, of cotton)
- Polyester T-shirt - HS 6109.90 (T-shirts, knitted or crocheted, of other textile materials)
A description that names the material gives the classifier what it needs.
Mixed Assemblies
Goods made of several materials or components are generally classified by the one that gives them their essential character (General Rule of Interpretation 3(b)), which is not always the largest share by weight or value. A description that says what each part is made of and what it does helps.
Use vs. Material
Some products are classified by what they are rather than what they are made of:
- Stainless steel kitchen knife - HS 8211 (knives with cutting blades)
- Stainless steel mixing bowl - HS 7323.93 (household articles of stainless steel)
Best Practices
- Provide complete product descriptions: material, form, use and, for mixed goods, the composition
- Use the trade’s standard terms for the goods
- Treat suggested codes as candidates to review, not answers
- Refer borderline classifications to a licensed customs broker or a binding ruling