const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'men\'s cotton t-shirt',
destination_country: 'us',
mode: 'pro',
brand: 'Nike',
type: 'Apparel',
country_of_origin: 'CN'
})
};
fetch('https://api.traddal.com/v1/classify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842",
"original_description": "men's cotton t-shirt",
"customs_description": "men's cotton t-shirt, knitted",
"usedWebSearch": false,
"unclassifiable": true,
"reason": "Unable to identify a physical product from this description even after web search.",
"fromCache": false,
"top_result": {
"chapter": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"heading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"subheading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"tariff": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"confidence": "High",
"score": 0.95,
"reasoning": "This product is a men's cotton t-shirt which falls under knitted garments..."
},
"results": [
{
"code": "6109100012",
"country": "us",
"chapter": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"heading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"subheading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"tariff": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"score": 0.95,
"confidence": "High",
"reasoning": "Cotton t-shirts for men are classified under heading 6109..."
}
],
"country": "us",
"mode": "pro"
}{
"success": false,
"message": "Product description is required",
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842"
}{
"success": false,
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842",
"error": "invalid_request",
"message": "Invalid request parameters"
}{
"success": false,
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842",
"original_description": "print",
"customs_description": null,
"usedWebSearch": true,
"unclassifiable": true,
"reason": "Unable to identify a physical product from this description even after web search.",
"top_result": null,
"results": [],
"country": "us"
}{
"success": false,
"message": "Product description is required",
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842"
}Classify Product
Classify a product description to a 8+ digit HS code using AI powered classification.
Supported Countries: US, CA, EU, GB, GLOBAL
Classification Modes (mode):
mini— fastest modepro— balanced/default modemax— highest-accuracy mode
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'men\'s cotton t-shirt',
destination_country: 'us',
mode: 'pro',
brand: 'Nike',
type: 'Apparel',
country_of_origin: 'CN'
})
};
fetch('https://api.traddal.com/v1/classify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842",
"original_description": "men's cotton t-shirt",
"customs_description": "men's cotton t-shirt, knitted",
"usedWebSearch": false,
"unclassifiable": true,
"reason": "Unable to identify a physical product from this description even after web search.",
"fromCache": false,
"top_result": {
"chapter": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"heading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"subheading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"tariff": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"confidence": "High",
"score": 0.95,
"reasoning": "This product is a men's cotton t-shirt which falls under knitted garments..."
},
"results": [
{
"code": "6109100012",
"country": "us",
"chapter": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"heading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"subheading": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"tariff": {
"number": "6109",
"description": "T-shirts, singlets, tank tops and similar garments, knitted or crocheted"
},
"score": 0.95,
"confidence": "High",
"reasoning": "Cotton t-shirts for men are classified under heading 6109..."
}
],
"country": "us",
"mode": "pro"
}{
"success": false,
"message": "Product description is required",
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842"
}{
"success": false,
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842",
"error": "invalid_request",
"message": "Invalid request parameters"
}{
"success": false,
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842",
"original_description": "print",
"customs_description": null,
"usedWebSearch": true,
"unclassifiable": true,
"reason": "Unable to identify a physical product from this description even after web search.",
"top_result": null,
"results": [],
"country": "us"
}{
"success": false,
"message": "Product description is required",
"request_id": "c6f398bb-1dad-40e8-a991-a22a180ad842"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Required. Product description or HTS code to classify.
"men's cotton t-shirt"
Required. Target country for classification.
Supported values: us, ca, eu, gb, global (case-insensitive)
"us"
Classification mode.
mini: fastest modepro: default balanced modemax: highest-accuracy mode
mini, pro, max "pro"
Optional. Product title or listing name. Helps the AI understand the product when the description is abbreviated or vague.
"Nike Sportswear Club Tee"
Optional. Product brand. Helps infer the product category (e.g. a "mystery box" from a clothing brand is classified as clothing, not as a box).
"Nike"
Optional. Product SKU or part number.
"AR4997-013"
Optional. Product type or category. Directly tells the classifier what kind of product this is.
"Apparel"
Optional. 2-letter country code (ISO 3166-1 alpha-2) where the product was manufactured.
^[A-Za-z]{2}$"CN"
Optional. Product price. Can help disambiguate between commodity and premium goods.
29.99
Optional. 3-letter currency code (ISO 4217) for the price field.
^[A-Za-z]{3}$"USD"
Optional. An HS or HTS code to use as a classification hint. Accepts 2–10 digit codes with optional dots (e.g. "95", "9503", "9503.00.00.73").
"9503"
Response
Successful classification
true
Unique request ID for audit logging
"c6f398bb-1dad-40e8-a991-a22a180ad842"
The original product description submitted
"men's cotton t-shirt"
AI-normalized customs description
"men's cotton t-shirt, knitted"
Whether web search was used to enhance classification
false
Present and true when the product description could not be identified as a physical product.
Only returned on 422 responses.
Human-readable explanation of why classification failed.
Only present when unclassifiable is true.
"Unable to identify a physical product from this description even after web search."
Whether the result was served from cache
false
The highest-ranked classification result
Show child attributes
Show child attributes
Top classification candidates ranked by score
Show child attributes
Show child attributes
Country used for classification
"us"
Effective mode used for classification
mini, pro, max "pro"