# classify

Classify products.

`POST /hscodeselfclassify/classification`

**API:** Avalara Cross Border Classification
**Tag:** Classification
**API Version:** 1.0
**Base URL:** /
**Authentication:** Bearer token

Source: https://developer.avalara.com/products/self-serve-tariff-code/api/methods/Classification/classify/

## Description

Classifies products based on the provided request data. Supports start and continue actions for interactive classification.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `avalara-version` |  | header | Yes | API version. Current version is 1.0. |

## Request Body

**Content-Type:** `application/json`

## Responses

| Status | Description | Schema |
|---|---|---|
| 201 | Returns the classification result. | `ClassificationResponseProjection` |
| 400 | The request parameters are invalid. | `AvalaraAPIExceptionDetails` |
| 401 | Authentication failed due to invalid or missing authentication token. | `AvalaraAPIExceptionDetails` |
| 403 | Customer is not authorized to access this resource. | `AvalaraAPIExceptionDetails` |
| 500 | An unexpected server error occurred. | `AvalaraAPIExceptionDetails` |

### 201 Response: `ClassificationResponseProjection`

Response payload for a self-serve classification request. Carries the transaction identifier, the current state of the classification (selected item, candidate HS code, pending and resolved interactions), supporting metadata, and any error indicators.

| Property | Type | Required | Description |
|---|---|---|---|
| `txId` | string | No | Identifier of the classification transaction. Echo this value as 'txid' (lowercase 'i') in a continue request. Note: this response field is named 'txId' (camelCase) while the corresponding request field is 'txid' (lowercase 'i'); both refer to the same value, the casing difference is retained for backward compatibility. Example: `2090511033_0f0ebac742c540719baad02735e45007`. |
| `languageCode` | string | No | Response language as an ISO 639-1 code, echoing the language used to build the response. Example: `EN`. |
| `productDescription` | string | No | Product description that was submitted in the originating classification request, echoed back here for reference. Example: `sunglasses`. |
| `currentItemPaths` | string[] | No | Concept hierarchy paths ("//"-separated) of candidate items inferred from the product description. Useful for understanding how the engine interpreted the input. |
| `currentItemName` | string | No | Display name of the item currently selected by the engine. Set to "UNKNOWN_ITEM" when no item could be identified. Example: `sunglasses`. |
| `currentSIP` | string | No | Selected Item Path: concept hierarchy path ("//"-separated, root-to-leaf) of the selected item. Example: `glasses//spectacles//eyewear//apparel, footwear, headgear, fashion accessory, article of personal use//manufactured article//sunglasses`. |
| `currentItemDef` | string | No | Definition of the selected item from the underlying ontology. Empty when no definition is available. |
| `hsCode` | string | No | Classified HS code (typically 6 or 8 digits; 4-digit headings are zero-padded to 6 digits when the schedule stops at HS6). Empty until enough information has been gathered to reach a classification. Example: `900410`. |
| `assumedInteractions` | ClassificationResponseInteraction[] | No | Interactions whose answer was assumed by the engine via exception rules rather than asked of the user. |
| `knownInteractions` | ClassificationResponseInteraction[] | No | Interactions whose answer is currently known (resolved), either by a profile rule or because the user has already answered them. |
| `orderedInteractions` | ClassificationResponseInteraction[] | No | All past interactions in the order they were asked or resolved during this classification session. |
| `currentItemInteraction` | ClassificationResponseInteraction | No | The currently pending item-selection interaction, when the engine is asking the caller to confirm which item the product description refers to. Null when no item-selection question is pending. |
| `currentQuestionInteraction` | ClassificationResponseInteraction | No | The currently pending question that the caller is expected to answer in a continue request. Null when the classification has reached a final HS code or has errored out. |
| `potentialHeadings` | string[] | No | HS headings that remain in scope as potential matches given the information gathered so far. |
| `rational` | string | No | Comma-separated list of GRI rules and HS legal notes that justify the current classification. Example: `GRI 1, Chapter 70 Note 1(d), Chapter 71 Note 3(l), GRI 6`. |
| `authSources` | string[] | No | Authoritative sources (for example, CROSS rulings) that support the current classification. |
| `duration` | integer | No | Time spent processing the request, in milliseconds. Example: `1675`. |
| `systemError` | boolean | No | True when the engine encountered an unhandled or unrecoverable error (HTTP-level status 901). Null when no system error occurred. Example: `false`. |
| `mixedContentError` | boolean | No | True when the engine raised a MixedContentException, indicating the product description requires a mixed-content (VALUED) breakdown that has not been provided (HTTP-level status 905). Null otherwise. Example: `false`. |
| `multiItemError` | boolean | No | True when the engine raised a MultipleItemException, indicating the product description references more than one distinct item (HTTP-level status 902), like sets and kits. Null otherwise. Example: `false`. |
| `itemOutOfScopeError` | boolean | No | True when the engine raised an ItemOutOfScopeException, indicating the selected item falls outside the supported tariff scope (HTTP-level status 900). Null otherwise. Example: `false`. |
| `errorDetail` | string | No | Human-readable detail of the error, populated when one of the *Error flags is set. Example: `Item 'foo' is out of scope.`. |
| `dataVersion` | string | No | HS schedule version used for this classification. Equal to 'schedule'. Example: `HS2022`. |
| `dataBuildDate` | string | No | Build timestamp of the underlying classification graph used for this response. Returned as a free-form string wrapped in literal single quotes. Example: `'Tue Jan 14 03:25:49 UTC 2025'`. |
| `schedule` | string | No | HS schedule version used for this classification. Equal to 'dataVersion'. Example: `HS2022`. |