DOCS

Category Validation

Category Validation

Check whether an item's assigned categories fit the product, and get better category suggestions when they don't.

Category validation 

Product categories describe what an item is, usually as a hierarchy from a broad root to a specific leaf — for example, ["Footwear", "Athletic", "Running Shoes"]. Accurate categories keep your catalog clean and feed downstream processes such as classification and trade compliance, where a mis-categorized item can produce the wrong result.

Catalogs accumulate category errors over time — from manual entry, supplier feeds, or migrations between systems. Zonos Category Validation checks whether the categories assigned to an item actually describe that item, and when they don't, suggests better categories drawn from the categories your organization already uses.

How it works 

Zonos Category Validation uses AI to judge whether the category hierarchy you supply correctly describes an item, based on the item's name and any additional details you provide such as brand, material, and description.

For each item it returns a verdict of CORRECT or WRONG along with a confidence score. When the verdict is WRONG, it returns a ranked list of suggested categories so you can correct the assignment. Suggestions are drawn from your organization's category tree — the set of category paths your organization uses — and any categories you submit are added to that tree automatically, so a well-maintained tree produces better suggestions over time.

This is a batch endpoint — you can validate many items in a single request, and the results are returned in the same order as the input.

Verdict and confidence 

Each result includes a verdict:

  • CORRECT — the item plausibly belongs in the assigned categories.
  • WRONG — the item does not belong in the assigned categories.

Each result also includes a confidenceScore between 0.0 and 1.0 indicating how confident the model is in the verdict it returned. The score reflects certainty in the verdict itself, so a confidently WRONG result has a high confidenceScore just as a confidently CORRECT one does. When the verdict is WRONG, the suggestedCategories list contains alternative category hierarchies, each with a confidence value and sorted from most to least likely. When the verdict is CORRECT, suggestedCategories is empty.

We recommend using the confidence score to decide which results to accept automatically and which to route to manual review.

Validate categories 

To validate categories, use the categoriesValidate mutation. Each item requires a name and the categories hierarchy to validate. You can optionally include brand, material, description, amount, currencyCode, globalTradeItemNumber, and imageUrl to improve accuracy. Submit multiple items in a single request to validate in bulk.

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}

In the example above, the first item's categories are confirmed as CORRECT with high confidence and no suggestions. The second item is confidently flagged WRONG, and the suggestedCategories list proposes better-fitting categories ranked by confidence.

Manage your category tree 

Your organization's category tree is the set of category paths Zonos knows your organization uses. Category Validation draws its suggestedCategories from this tree, so keeping it accurate and complete directly improves the quality of suggestions. Categories you submit to categoriesValidate are added to the tree automatically, but you can also manage it directly.

Each category is a hierarchy stored as a path array, from broad root to specific leaf — for example, ["Footwear", "Athletic", "Running Shoes"].

List your categories

Use the categories query to retrieve your organization's category tree. Results are paginated.

1query Categories {
2 categories(first: 50) {
3 totalCount
4 edges {
5 node {
6 id
7 path
8 }
9 }
10 }
11}

Add categories

Use the categoriesCreate mutation to add one or more category paths to your tree. This is useful for seeding the tree before validation so suggestions can draw on your full taxonomy.

1mutation CategoriesCreate($input: [CategoryCreateInput!]!) {
2 categoriesCreate(input: $input) {
3 id
4 path
5 }
6}

Update or remove categories

Use the categoryUpdate mutation to correct a category's path by its id, or the categoryDelete mutation to remove a category that no longer applies. Pruning stale or incorrect categories keeps suggestions relevant.

1mutation CategoryUpdate($input: CategoryUpdateInput!) {
2 categoryUpdate(input: $input) {
3 id
4 path
5 }
6}

To remove a category, pass its id to the categoryDelete mutation. It returns SUCCESS or FAILURE.

1mutation CategoryDelete($id: ID!) {
2 categoryDelete(id: $id)
3}
GraphQL API ReferenceTypes, inputs, and operations used in this guide
Book a demo

Was this page helpful?