# GetCrossBorderCode

Lists all parents of an HS Code.

`GET /api/v2/definitions/crossborder/{country}/{hsCode}/hierarchy`

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

Source: https://developer.avalara.com/products/crossborder/api/methods/Definitions/GetCrossBorderCode/

## Description

Retrieves the specified HS code and all of its parents, reflecting all sections, chapters, headings, and subheadings
            
a list of HS Codes that are the parents and information branches of the HS Code for the given
destination country, if lower detail is available.
            
This API will include information branches if applicable. These do not have HS Codes and cannot be referenced,
but can contain information relevant to deciding the correct HS Code.
            
This API is intended to be useful to review the descriptive hierarchy of an HS Code, which can be particularly helpful
when HS Codes can have multiple levels of generic descriptions.

### Security Policies

* This API depends on the following active services:*Required* (all):  AvaTaxGlobal.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `country` | string | path | Yes | The name or code of the destination country. |
| `hsCode` | string | path | Yes | The partial or full HS Code for which you would like to view all of the parents. |
| `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/) . |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `HsCodeModelFetchResult` |

### 200 Response: `HsCodeModelFetchResult`

| Property | Type | Required | Description |
|---|---|---|---|
| `@recordsetCount` | integer | No |  |
| `value` | HsCodeModel[] | No |  |
| `@nextLink` | string | No |  |
| `pageKey` | string | No |  |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/definitions/crossborder/{country}/{hsCode}/hierarchy" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```