# VerifyHSCode

Verify the HSCode to be valid/invalid

`POST /api/v2/companies/{companyId}/items/hscodes/$verify`

**API:** AvaTax API
**Tag:** Items
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `text/plain`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Items/VerifyHSCode/

## Description

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The unique ID of the company |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `ItemHSCodeVerificationInputModel[]`

Represents a HsCodeClassification SLA Response for a given company.

| Property | Type | Required | Description |
|---|---|---|---|
| `itemId` | integer | **Yes** | The unique ID of this item. Example: `10021213`. |
| `country` | string | **Yes** | The country code for HS code verification (2-letter ISO 3166 country code). Example: `DE`. |
| `hsCode` | string | **Yes** | The HS code to verify. Example: `9011900000`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `ItemHSCodeVerificationOutputModel` |
| 400 | Bad Request | `ProblemDetails` |
| 401 | Unauthorized | `ProblemDetails` |
| 404 | Not Found | `ProblemDetails` |
| 422 | Client Error | `ProblemDetails` |
| 500 | Server Error |  |

### 200 Response: `ItemHSCodeVerificationOutputModel`

Response for HS code verification batch requests. When Avalara.ItemMasterCoreService.Models.v2.ItemHSCodeVerificationOutputModel.failed is non-empty, no rows were persisted or published.

| Property | Type | Required | Description |
|---|---|---|---|
| `total` | integer | No | Number of rows in the request (same as request array length). Example: `3`. |
| `failed` | ItemHSCodeVerificationFailedRowModel[] | No | Rows that failed validation; empty when the full batch was accepted. |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/items/hscodes/$verify" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "itemId": 10021213,
    "country": "DE",
    "hsCode": "9011900000"
  }
]'
```