DOCS

Category validation

Category validation

Check whether the categories assigned to each item actually describe it.

GraphQL

The categoriesValidate mutation validates whether each item's supplied categories correctly describe the item. For every item you submit, it returns a verdict and a confidenceScore. When the verdict is WRONG, the response also returns plausible alternative categories drawn from your organization's category universe.

Use it to catch mis-categorized items before incorrect categories affect downstream classification, landed cost, or restriction results—and to suggest the right category back to whoever entered the item.

Verdicts and confidence 

Each item in the response carries a verdict and a confidenceScore (0–1) expressing the model's confidence in that verdict.

VerdictMeaning
CORRECTThe item plausibly belongs in the assigned categories.
WRONGThe item clearly does not belong in the assigned categories.

When the verdict is WRONG, suggestedCategories is populated with plausible alternatives from your organization's category universe. Each suggestion has its own category hierarchy (root → leaf) and a confidence score—the model's probability that it is the best-fit category, sorted descending. When the verdict is CORRECT, suggestedCategories is empty.

Validate categories via API 

Submit one or more items in a single request. name and categories are required for each item; including optional details like description, brand, material, and amount improves accuracy. The example below validates two items—one correctly categorized and one clearly mis-categorized.

1mutation CategoriesValidate($input: [CategoryValidateInput!]!) {
2 categoriesValidate(input: $input) {
3 id
4 name
5 categories
6 verdict
7 confidenceScore
8 suggestedCategories {
9 category
10 confidence
11 }
12 }
13}

Input fields

FieldTypeDescription
nameString!The product name or short description. Required.
categories[String!]!The category hierarchy (root → leaf) to validate. Required.
amountDecimalThe price of the item.
currencyCodeCurrencyCodeThe currency the amount is in.
brandStringThe brand of the item.
descriptionStringThe full description associated with the item.
materialStringThe material composition of the item.
globalTradeItemNumberStringA Global Trade Item Number (GTIN) such as UPC, EAN, GTIN-8, or GTIN-14.
imageUrlStringThe location of an image related to the item.

The descriptive fields are echoed back on each CategoryValidation in the response, so every stored validation is self-describing.

GraphQL API ReferenceTypes, inputs, and operations used in this guide
Book a demo

Was this page helpful?