# Tracking Level

## Fetch Tracking Level

<mark style="color:blue;">`GET`</mark> `/wms/sku/tracking-level`

This api returns all or a set of **Tracking Levels** configured depending on the filter criteria passed or not. **Note** when more than one below parameters are sent the result will be filtered matching all the parameters and not any one. so filter should be applied accordingly or else result would be empty if all conditions are not met.

#### Query Parameters

| Name | Type   | Description                                                                               |
| ---- | ------ | ----------------------------------------------------------------------------------------- |
| name | String | Partial or full text matching the name of the **Tracking Level** like 'Combo' 'Each' etc. |
| id   | String | Blowhorn assigned/supplied integer unique id for the **Tracking Level** like 12345        |

#### Headers

| Name                                       | Type   | Description                              |
| ------------------------------------------ | ------ | ---------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark> | String | API key obtained by the Customer/Partner |

{% tabs %}
{% tab title="200: OK Response for no search criteria or matching criteria" %}

```javascript
{
    "count": 3,
    "previous": null,
    "next": 0,
    "result": [
        {
            "id": 58,
            "created_date": "2022-04-29T11:35:54.681038+05:30",
            "modified_date": "2022-04-29T12:19:11.669348+05:30",
            "name": "Combo",
            "level_one_name": "Combo of 2",
            "level_two_name": "Combo of 4",
            "level_three_name": "Combo of 6",
            "ratio_level_two_one": 200,
            "ratio_level_three_two": 150,
            "created_by": 108434,
            "modified_by": null,
            "customer": 40082
        },
        {
            "id": 5,
            "created_date": "2021-07-30T17:52:25.615928+05:30",
            "modified_date": "2021-07-30T17:52:25.616689+05:30",
            "name": "Single",
            "level_one_name": "Single",
            "level_two_name": "Box of 30",
            "level_three_name": "Pallet for 30",
            "ratio_level_two_one": 30,
            "ratio_level_three_two": 1,
            "created_by": 108434,
            "modified_by": 108434,
            "customer": 40082
        },
        {
            "id": 4,
            "created_date": "2021-07-30T17:51:58.203915+05:30",
            "modified_date": "2021-07-30T17:51:58.204736+05:30",
            "name": "Each",
            "level_one_name": "Each",
            "level_two_name": "Box of 25",
            "level_three_name": "Pallet for 25",
            "ratio_level_two_one": 25,
            "ratio_level_three_two": 1,
            "created_by": 108434,
            "modified_by": 108434,
            "customer": 40082
        }
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized/Validation Error" %}

```javascript
{
  "status": "FAIL",
  "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="200: OK No Product Group found for the search criteria" %}

```javascript
{
    "count": 0,
    "previous": null,
    "next": 0,
    "result": []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unexpected Error" %}

```javascript
{
  "status": "FAIL",
  "message": "Unexpected error"
}
```

{% endtab %}
{% endtabs %}

## Create Tracking Level

<mark style="color:green;">`POST`</mark> `/wms/sku/tracking-level`

This API is for creating new **Tracking Levels**.

#### Headers

| Name                                       | Type   | Description                              |
| ------------------------------------------ | ------ | ---------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark> | String | API key obtained by the Customer/Partner |

#### Request Body

| Name                                               | Type   | Description                                                                                                                                                          |
| -------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>             | String | Unique text identifier of the **Tracking Levels** for the client                                                                                                     |
| level\_one\_name<mark style="color:red;">\*</mark> | String | First level of tracking                                                                                                                                              |
| id                                                 | String | An identifier will be randomly generated by Blowhorn. You can optionally override this ID, but the ID must be unique across all **Tracking Levels** in your account. |
| level\_two\_name                                   | String | Second level of tracking                                                                                                                                             |
| level\_three\_name                                 | String | Third level of tracking                                                                                                                                              |
| ratio\_level\_two\_one                             | String | Ratio between two tracking levels                                                                                                                                    |
| ratio\_level\_three\_two                           | String | Ratio between last two tracking levels                                                                                                                               |

{% tabs %}
{% tab title="200: OK Successful creation of Tracking Level" %}

```javascript
{
    "status": "PASS",
    "message": {
        "id": 297
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request/Validation Error" %}

```javascript
{
    "status": "FAIL",
    "message": "Tracking Level already exists"
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized/Wrong API key" %}

```javascript
{
  "status": "FAIL",
  "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unexpected Error" %}

```javascript
{
  "status": "FAIL",
  "message": "Unexpected error"
}
```

{% endtab %}

{% tab title="400: Bad Request Missing required parameters" %}

```javascript
{
    "status": "FAIL",
    "message": "Missing required parameters."
}
```

{% endtab %}
{% endtabs %}

## Update Tracking Level

<mark style="color:orange;">`PUT`</mark> `/wms/sku/tracking-level`

This API is for updating an existing **Tracking Level**. Any or all of the below mentioned attribute of the **Tracking Level** can be updated using this API.

#### Headers

| Name     | Type   | Description                              |
| -------- | ------ | ---------------------------------------- |
| API\_KEY | String | API key obtained by the Customer/Partner |

#### Request Body

| Name                     | Type   | Description                                                                                                                                                                                                                                                                                                                                    |
| ------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                       | String | <p>Unique identifier either generated by Blowhorn or provided at the time of <strong>Tracking Level</strong> creation. </p><p><strong>Note</strong>: This is conditionally optional. Either <strong>id</strong> or <strong>name</strong> should be provided for identifying the <strong>Tracking Level</strong>  that needs to be updated.</p> |
| name                     | String | <p>Unique text identifier of the <strong>Tracking Level</strong> for the client. </p><p><strong>Note</strong>: This is conditionally optional. Either <strong>id</strong> or <strong>name</strong> should be provided for identifying the <strong>Tracking Level</strong>  that needs to be updated.</p>                                       |
| level\_one\_name         | String | First level of tracking                                                                                                                                                                                                                                                                                                                        |
| level\_two\_name         | String | Second level of tracking                                                                                                                                                                                                                                                                                                                       |
| level\_three\_name       | String | Third level of tracking                                                                                                                                                                                                                                                                                                                        |
| ratio\_level\_two\_one   | String | Ratio between first two levels                                                                                                                                                                                                                                                                                                                 |
| ratio\_level\_three\_two | String | Ratio between last two levels                                                                                                                                                                                                                                                                                                                  |

{% tabs %}
{% tab title="200: OK Successful updation of Product Group" %}

```javascript
{
    "status": "PASS",
    "message": "Tracking Level Updated successfully."
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request/Validation Error" %}

```javascript
{
    "status": "FAIL",
    "message": "Tracking Level does not exists"
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized/Wrong API key" %}

```javascript
{
  "status": "FAIL",
  "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unexpected error" %}

```javascript
{
  "status": "FAIL",
  "message": "Unexpected error"
}
```

{% endtab %}

{% tab title="400: Bad Request Missing required parameters" %}

```javascript
{
    "status": "FAIL",
    "message": "Missing required parameters."
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Create Tracking Level | Schema " %}

```json
{
    "name": "Combo",
    "level_one_name": "Combo of 2",
    "level_two_name": "Combo of 4",
    "level_three_name": "Combo of 6",
    "ratio_level_two_one": 200,
    "ratio_level_three_two": 150
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.blowhorn.com/api-docs/wms-inventory/tracking-level.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
